02-04-2020 04:48 PM
Howdy everyone,
I'm new to LabVIEW and I just started to use LabVIEW to control a DAQmx to generate digital signals. I simply use buttons to control one digital terminal correspondingly,however, I want to realize the following sequence. First, once I hit the start button, switch 1 will be turned on and generate digital signals on corresponding terminal. After I turn off switch 1, switch 2 will be turned on to generate signals on another terminal. After switch 2 is turned off, the whole process will end. I have no clue to how realize the sequence so I definitely need some help from you. Is there any suggestion of where should I start? Or is there any VI example that I can learn to realize the button sequence from? Thanks!
02-04-2020 06:53 PM
Hi Nathanzzs,
I am not sure I understand your requirement. Are going to make Switch1 go F->T->F and then Switch2 go F->T->F?
If you put them both in the same loop then you can just press whichever one you need to.
Also, when using a while loop you should not let it hog the processor too much. I usually add a "Wait(ms)" function with an input of 50 or 100 inside the loop.
02-04-2020 08:21 PM
Hi Nathanzzs,
I'd take a look over a State Machine tutorial.
Since you don't know the duration of the two switches in advance, but you do know the order and set of operations, I think it will be a good fit.
Your states could be something like:
Note this guide for DAQmx vs the DAQ Express nodes (you should learn DAQmx if you can): Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications