LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read maintains at one value

Hello everyone, we are now using Labview for our project but we are facing a problem.

 

In our project, we use DAQmx Virtual Channel for our I/P(input) and O/P(output). For we need to compare the value get by I/P so I connect the DAQmx Read to our I/P and set it to 1 channel multiple samples. But the value come from DAQmx Read remins at 5.38V, even though I change the value to I/P.

 

Could anyone tell me where is wrong with my vi. ?

 

And this program is to control 1 relay, what if I want to control 2 relays separately ? How can I combine these two program together? I try to use two paralle while loops or one loop with 2 signals but both of them cannot work...

 

Please help me! Thank you!!!!

0 Kudos
Message 1 of 17
(2,787 Views)
Can you post an image of the block diagram? I'm posting from my phone and your description is very confusing. The DAQmx Read is the input and saying you connect it to I/P does not make any sense. Whatever you get from the DAQmx Read will depend on your sensor, how you connect it to your daq card, and how you configure the task. You have provided none of this essential information.

For controlling digital, either separate while loops or a single with both channels in a task will most certainly work. You have to program it correctly, of course. Please refer to the examples.
0 Kudos
Message 2 of 17
(2,776 Views)

Here is my block diagram

w.png

0 Kudos
Message 3 of 17
(2,766 Views)
Since you have defined the task in MAX instead of you code, I have no idea of your settings. I also have no idea of what you are actually reading. It makes no sense for nsamples when you are discarding all but the very first one. You aren't even making the multiple samples visible. Some basic debug on your part is required.
0 Kudos
Message 4 of 17
(2,758 Views)

Er...I'm a very beginner for Labview. This my first time to use DAQmx.

At first I used DAQ assistance to get my input, but we decided to use DAQmx Virtual Channel for people can choose the channel from front panel directly. The I/P is used to get voltage from our power source, as we need to use voltage to get our SOC so we need to extract value from the I/P.

As it is DAQmx Event which cannot be connected with 1D array of double (source for our index array) so we choose to use DAQmx Read.

 

How could we get all values? 

"making the multiple samples visible" you mean can get every value from I/P ?

 

Here is our original vi. with DAQ assistance

q.png

 

0 Kudos
Message 5 of 17
(2,750 Views)
You can't do squat from the front panel. You have to do your configuration in MAX.

You don't seem to understand any of the fundamentals. The DAQmx Read returns a dbl array. You simply use an array indicator to display all of the values you read. To me, it would make more sense to take the mean of all of the samples.

And please use some correct terms. Your I/P is the name of a control not the result of the read. Your DAQmx Event is a nonsense term when you use it.
0 Kudos
Message 6 of 17
(2,737 Views)

I try to use array indicator but the value of DAQmx Read is still remains 5.38V

 

I need to use all values inside the array for our value inside I/P keeps changing.

0 Kudos
Message 7 of 17
(2,730 Views)
Attach an image of the front panel that shows all of these values. If they are truly all the same, then either that it's the actual input, which your can verify with a meter, or you have miswired the connections to your da qdevice, or you have not configured it correctly. Your code does not have any configuration information as I have already mentioned.
0 Kudos
Message 8 of 17
(2,725 Views)
'value inside I/P' seems to be another concept that you have made up. It is totally meaningless to me.
0 Kudos
Message 9 of 17
(2,722 Views)

a.png

here is our front panel pic.

 

Sorry for not express clearly. I mean Voltage is the value that we get from our I/P channel. We provide this value with a power source which can change from 0V to 10V. Different Voltage will has a different SOC value. When SOC is less than 100, our Output Voltage will generate a constant voltage through our O/P channel.

0 Kudos
Message 10 of 17
(2,714 Views)