11-15-2012 09:37 AM
Hello,
I am building a VI to aquire sampled voltages from a sensor in either continuous or finite mode. To acheive this, I was going to use a case statement with a wire from the Sample mode input of the DAQmx Timing VI to the condition terminal, the idea being that I could have aeither a while looped case for the continuous or single acquisition depending on the setting of this control.
However instead of the expected sample mode as cases of the case statement, I just get 1, and 0.
Is this a good way of doing this, and if so how can I get my case structure to work correctly?
Thanks
Dave
Solved! Go to Solution.
11-15-2012 10:32 AM
Hi Dave,
I would simply use an Enum control to select the sample mode. Connect the enum to the case structure and you will be able to right click on the case selector and click "Add case for every value". Your cases will then be 'Finite Samples, Continuous Samples, etc.'
I've attached the .vi with this small edit (Note: I removed the local variable; it's better to just wire directly where you can)
Thanks,
11-15-2012 10:54 AM
Thanks Eden, thats the sort of thing I was looking for. However, the enum control does not seem to be recognised - I have Error -200077 even though the enum is set to the correct value...
Dave
11-15-2012 11:19 AM
Hi Dave,
Apologies - I take it that error is coming from the DAQ function? I forgot that it was using the sample mode input.
Perhaps, then, it'll be best to continue to use the ring control - the cases will be numbered and will correspond to the numeric value of the ring selection (i.e. finite samples = 0). I have attached a small example if it is not clear.
By the way, the case structure may not automatically populate for every case, in which case you can right click on the case structure -> add case after.
Best regards,
11-19-2012 04:17 AM
Thanks for your help Eden, that illustrated it just fine
Dave