03-05-2020 11:42 AM
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
Solved! Go to Solution.
03-05-2020 12:51 PM - edited 03-05-2020 12:53 PM
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.
03-05-2020 02:24 PM
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?
03-05-2020 03:22 PM