LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure to control signal output type

Can you use a case structure to control what kind of signal is outputted by the DAQ? I am trying to output either a sine wave, constant 5V, or no signal based on a three option string control, but I can't arrange the simulate signal and daq assistant in any way that allows me to only generate the selected signal. Please advise. Thank you!

0 Kudos
Message 1 of 5
(2,620 Views)

Show us what you've tried.

 

Assuming different functions are used to generate each type of signal, you just need to put each of those in there own case of the case structure.

0 Kudos
Message 2 of 5
(2,604 Views)

Attached is the method that I thought should work with a case structure, and what I have settled with using for now. Thank you!

Download All
0 Kudos
Message 3 of 5
(2,588 Views)

I would put the DAQ assistant outside the case structure.

 

Inside the case structure, you have one case simulate a sine wave, another case simulate another wave.  For no signal, just have a signal that outpus zero volts.

 

The reason you don't get anything on Analog input is that that loop doesn't run until the first loop ends.  You've created a data dependency between the two while loops by having the boolean wire go from the first analog output loop to the second analog input loop.

 

That is a basic principle of Dataflow programming. I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

To have the two loops run simultaneously, you need to eliminate that wire between them.

0 Kudos
Message 4 of 5
(2,582 Views)

Thanks for the response. I figured out several of the things you pointed out between my last post and now, but thank you for including an explanation - I made the changes but wasn't positive why they worked. I just went through the 6 hour tutorial yesterday actually, so hopefully just more practice will make things easier. Thanks again for your explanations!

0 Kudos
Message 5 of 5
(2,577 Views)