LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable DAQ using boolean control

Hi everyone,

im trying to use two types of control ( numeric control) and ( vertical slider) to output analouge signal to the same port of DAQ ( lets say port ao). the problem is if i do that the DAQ will give error because the channel is shared. that is why i was thinking if there is a way to use boolean switch in order to disable the DAQ attached to one controller at a time?

for example if the switch is 1 it enables the numeric control and disables the vertical slider, and if its 0 it enables the vertical slider and disable the numeric control FOR THE SAME DAQ PORT (ONE PORT).

 

thanks alot.

 

🙂

0 Kudos
Message 1 of 18
(3,295 Views)

I don't understand why you need two different controls and what you are calling a controller. If you want a vertical slider and a numeric control to set an analog output, simply right click on the slider and select Visible Items>Digital Display. Then you have a single control for setting the voltage.

0 Kudos
Message 2 of 18
(3,288 Views)

oh sorry i didnt explain why i need that,

the numeric control is because im importing data from txt file to labview  and they will be printed in numeric array and im using array index to send it to the DAQ to control the LED intensity so its is not manual adjusting its imported data.

the vertical slider is to make it manual control so when i dont have data to import to labview i use the sliders to adjust the analogue output of the DAQ

0 Kudos
Message 3 of 18
(3,284 Views)

Then you just need a Boolean to switch between manual and file?

0 Kudos
Message 4 of 18
(3,280 Views)

yeah, but i dont know how to disable and enable the daq in labview.

0 Kudos
Message 5 of 18
(3,277 Views)

I'm not sure why you really need to enable/disable anything since the manual control would be inside a case statement and would have no affect but you would use the disabled property to enable/disable a control. Just right click, select Create>Property Node and browse to the Disabled property. When it is created, you will need to right click on it and change it to Write. Right click on that to create a constant.

0 Kudos
Message 6 of 18
(3,272 Views)

you mean only the (disable/enable) box of slider inside case structure and i keep the slider outside the case structure? sorry im new in labview if u find my questions a bit lame.

 

and how to disable the importing file feature when the sliders are ON?

0 Kudos
Message 7 of 18
(3,266 Views)

I would imagine a simple case statement wired to a Boolean with text Import/Manual. The case statement would have property nodes inside to enable/disable and have the read file code in one case and the slider in the other.

Message 8 of 18
(3,259 Views)

wouldnt this still give error because the same DAQ port will be connected to two control elements? 

i dont have labview now i will have access to it in 2 hours time when the lab opens

i will try it and let you know but i guess the VI refuses same port of daq used twice in one GUI.

 

and one more thing if you dont mind, i have asked for help once in the forum about gaussian best fit function. they helped me to create plot but i dont know how to place the gaussian best fit to it, do u mind if u give a look to it?

0 Kudos
Message 9 of 18
(3,253 Views)

If you are using two separate analog outputs, then you would have an error whether the voltage is coming from a file or from a control, right? If in one case you drive 2 channels and in the other only one, you would have to stop whatever task that might be running and create a new task. On the other hand, if you always are going to have two channels, then you must use a single task and a single DAQmx Write.

0 Kudos
Message 10 of 18
(3,245 Views)