LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use DAQmx Timing control as input to case statement

Solved!
Go to solution

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

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

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,

Eden S
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 5
(2,422 Views)

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

0 Kudos
Message 3 of 5
(2,417 Views)
Solution
Accepted by djroseman

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,

Eden S
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 5
(2,410 Views)

Thanks for your help Eden, that illustrated it just fine

 

Dave

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