08-02-2013 10:21 AM
I have two VIs. One collect data from a USB and the other collect data from a Serial port. Both work fine seperately. What is the easiest way to couple both and work simultaneously to collect data.
08-02-2013 11:19 AM
Short answer: Use them as sub-VI's in a single program...
Long answer: You need to break these down into steps. Consider a State Machine architecture and have a step to configure your serial port and DAQ, a step to take the DAQ reading and serial port data, a step to graph and save the data, a step to wait for a timer to expire and take the data...
08-02-2013 11:33 AM - edited 08-02-2013 11:34 AM
Is there a specific reason you cannot just run them both in separate loops in one VI? How do you want to "couple" them? You can have a producer consumer architecture where you can run your two VI's in separate "producer" loops and have one consumer loop which will grap the data from your producer loops from a buffer and run some operation on them.
08-02-2013 12:55 PM
I would lean toward a producer/comsumer design pattern with one producer and two consumers. The two consumers will handle the data collection with one on th eserial port and the other on the USB. The producer would handle all the UI stuff. To give updates to the UI the consumers can user user events to notifiy the producer something needs to be updated.