bwgames Posted August 29, 2006 Report Share Posted August 29, 2006 Is it possible, in LabView (8.0), to run two things at once? I.e. I have a front panel with buttons and indicators. Every 5 seconds or so, the device connected via serial port outputs a list of boolean states which should be used to update the boolean state of the FP indicators. At the same time, if a button is pressed on the FP, a command needs to be sent via the serial port. I can do the sending of the command by wiring the T/F output to a case structure and sending it that way (even though it gets horribly complex with ~40 buttons, each one wired to its own case statement - there must be a easier way?), but I'm not sure how to read the serial port at the same time. A timer to read the serial port every 5 seconds probably wouldn't work due to the fact it would need precise timing. I want to be able to read the serial port and use the info to affect indicators whilst at the same time acting on any changes by the user to the FP. Does anyone have any pointers/example VIs? Thanks. Quote Link to comment
Ulrich Posted August 29, 2006 Report Share Posted August 29, 2006 Hi bwgames, welcome to lava!!! "I want to be able to read the serial port and use the info to affect indicators whilst at the same time acting on any changes by the user to the FP." e.g. you can run a sub VI dynamically for reading the serial port, while the main vi is acting on FP changes. "(even though it gets horribly complex with ~40 buttons, each one wired to its own case statement - there must be a easier way?)" You can put all buttons in one case. See the attachment. hope it's helpful for you Ulrich Download File:post-3940-1156855192.vi Quote Link to comment
Jacemdom Posted August 29, 2006 Report Share Posted August 29, 2006 Salut. Have you checked the different "Frameworks" and "Design Patterns" available in the template browser? Quote Link to comment
bwgames Posted August 30, 2006 Author Report Share Posted August 30, 2006 Thanks for the feedback. The case VI gave me exactly the info I needed. Looking more closely at the Producer/Consumer(Data) template now - this seems to be exactly what I need - use a SubVi in the False case structure to process any button changes, and in the consumer loop, act on the array received from the serial port. One question I do have - how would I set current boolean states of LEDs based on what is in an array cell? I.e. how would I link an array cell to a boolean indicator? Quote Link to comment
Ulrich Posted August 30, 2006 Report Share Posted August 30, 2006 One question I do have - how would I set current boolean states of LEDs based on what is in an array cell? I.e. how would I link an array cell to a boolean indicator? Hi bwgames, i hope i understood you and this vi can help you. have a nice day Ulrich Download File:post-3940-1156946142.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.