LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help for triggering a digital output with a comparasion function

Solved!
Go to solution

 

I want to trigger a digital output using a comparasion function, I am learning the basic stuff of LabVIEW 2014 using DAQ Assistants. My VI is a Temperature reader and a I want to turn on a specific component when the temperature is above the set point, the Led on the Front Panel turns on fine when the conditions are met, but I cant generate a digital output from it, I attached the full VI, the error, the DAQ Assistant I use to read the analog output from my sensor, and the DAQ Assistant I want to use to generate my digital output, also a VI screenshot of the program working without the last Assistant.

 

Hope is enough to help me. Thanks

 

 

    

0 Kudos
Message 1 of 4
(2,009 Views)
Solution
Accepted by topic author Lefcandy

You've got several problems, some of which are caused by using DAQ Assistants and the dread blue dynamic data type wire.

 

1.  You have a Data Array which is empty.  (Hard to see at first with that boolean style that was chosen.).  So you are sending 0 elements to a DAQ Assistant expecting 1 element for 1 channel.

2. The DAQ Assistant reading a single channel of voltage is set to read 1000 samples.  So withing the blue wire (which effectively hides the underlying data), you really have an array of 1000 elements.  One of those elements (first? last?) gets displayed on the two scalar indicators.  The coercion dot shows the datatype is being changed.  The array is begin compared to a scalar, which puts out another blue wire which really has an array of 1000 boolean elements in it.  The "From DDT" blue express VI bullet converts the blue wire to an actual array of 1000 boolean values.  That gets passed to the DAQ Assistant that is doing a digital write of 1 sample 1 channel.  So again a mismatch on the number of channels.

 

So for number one, get rid of the boolean array control and just let it be a boolean scalar.

For Number two, decide how you want to handle those 1000 elements (first, last average), how you want to handle the array with the comparison (any element greater, all elements greater,  .....)  and have it resolve to a single boolean value to pass to the digital output.

 

Try to get rid of the DAQ Assistants and their related blue wires and use regular DAQmx functions.

 

0 Kudos
Message 2 of 4
(1,973 Views)

Thank you so much for answer me, changing the Samples to read to 1 worked.

So using regular DAQmx functions is better, which is the best way to learn to use those functions?

0 Kudos
Message 3 of 4
(1,954 Views)