Jump to content

How would I allow for multiple actions...


Recommended Posts

Hey, I'm not really sure how to even search for this, so I'll have to ask you.

I have a button that tells some equipment to start taking measurements. When the measurements have been taken, the program reads the info from the equipment, parses it, and sends it to an array.

But sometimes we click the wrong button. :) And when we do, we curse.

So I want to include a Cancel button that will ignore the data that comes from the machine. My problem is, it reads the value before it lets me click the button. It won't even register that the button was clicked until the equipment is finished.

LabView is so linear, I guess my question is "how do I do two things at once?".

Thanks :)

-James

Link to comment

Wow! LabVIEW is not linear at all!!

The reason that the buttons do not respond is that they are in the same while loop as your communications. (LabVIEW reads the state of the buttons just once per loop iteration, turn the globe on to see what I mean), so the buttons don't get re-read until the next iteration of the while loop. Move your communications into a separate while loop and then your GUI will respond in a more timely fashion.

However, this does not solve your problem really, in that once the communication starts, your program needs to be able to interrupt it, so you'll need to do some design work on the comms (e.g. have a flag that is checked routinely at each stage of the communication) to allow the user to push a 'cancel' button and your comms will then abort back to a known state.

Link to comment
LabVIEW is not linear at all!!

Yay! I'm self-taught, so I still have some learning to do.

Okay, that sounds good. I'll see if I can't figure this out. Note: I don't need to interrupt it, I can just ignore the output when it finishes (the time doesn't matter so much as the data being overwritten).

Thanks.

Link to comment
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.