LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq mx read

I'm using a daq to collect current signals coming from 8 different machines and translating this information into temperature. My VI needs to do a few things and everything seems to be working just fine except for the part where it actually reads the current signals. I had tested this a few weeks ago with only one channel and everything seemed to be working fine. Now that I have compiled all of the individual sections, I can't seem to get the temperature readings to work. I believe the problem is within the daq mx section, but I could be wrong. Is there anything that seems wrong with it? Thank you!

0 Kudos
Message 1 of 10
(5,171 Views)

Try wiring a DAQmx Start Task outside the While loop, but after the DAQmx Timing VI.

 

There are some other useful DAQmx tips located at http://www.ni.com/white-paper/2835/en/

0 Kudos
Message 2 of 10
(5,160 Views)

Are you getting any errors?

 

30 second loop rate!!!  Why so large?  My guess is that is where your problems are.  You are continuously sampling data at 1200 samples per second and then only reading it every 30 seconds.  That's 36k samples.  That may be causing a buffer over run.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(5,148 Views)

@crossrulz wrote:

Are you getting any errors?

 

30 second loop rate!!!  Why so large?  My guess is that is where your problems are.  You are continuously sampling data at 1200 samples per second and then only reading it every 30 seconds.  That's 36k samples.  That may be causing a buffer over run.


I have a 30 second loop rate because I don't need to make readings very often. I am not receiving any errors. The only thing wrong is that all of my "exit temp" and "mid temp" readings are saying "0" in my labview code. However, I am getting around a 5ma reading for most of them when I use the test panels in NI MAX, so I know that there is no problem with the devices themselves or with the daq. The problem exists in my code. What would you recommend changing the samples/second to? Or, is the problem with the 30 second loop rate? I will play around with those to see if they give me the fix that I'm looking for in the meanwhile. Thank you!

0 Kudos
Message 4 of 10
(5,141 Views)

@Heiso wrote:

Try wiring a DAQmx Start Task outside the While loop, but after the DAQmx Timing VI.

 

There are some other useful DAQmx tips located at http://www.ni.com/white-paper/2835/en/


Tried it and nothing changed :/. Thanks for the suggestion, though.

0 Kudos
Message 5 of 10
(5,140 Views)

It's strange that no buffer overflow is thrown out in this case. You should probe the error wire at the output of the DAQmx.vi. Also, try adding the Available samples per channel property to the DAQmx Read property node and check how many samples are available to read (0?). Also put a probe on the waveform wire that connect to a numeric indicator, I think the last of the y-values will be displayed.

 

Ben64

0 Kudos
Message 6 of 10
(5,122 Views)

@ben64 wrote:

It's strange that no buffer overflow is thrown out in this case. You should probe the error wire at the output of the DAQmx.vi. Also, try adding the Available samples per channel property to the DAQmx Read property node and check how many samples are available to read (0?). Also put a probe on the waveform wire that connect to a numeric indicator, I think the last of the y-values will be displayed.

 

Ben64


I've probed at just about every node I can imagine and I get nothing but zero values, which is very odd to me because this isn't the case in the NI MAX test panels.

0 Kudos
Message 7 of 10
(5,115 Views)

The only way to stop your vi is to press the abort button because of the false constant wired to the stop terminal of the loop that contain the event structure. If you stop your vi like this the error will not be displayed.

 

Now, what are the differences when you are using MAX? In MAX you are running a single channel at a sampling rate of 12.5 Hz which is quite different that in your vi.

 

Also, right-click the Array To Cluster function and change the cluster size from 9 to 8.

 

What modules are you using in your compact DAQ?

 

Ben64

0 Kudos
Message 8 of 10
(5,106 Views)

@ben64 wrote:

The only way to stop your vi is to press the abort button because of the false constant wired to the stop terminal of the loop that contain the event structure. If you stop your vi like this the error will not be displayed.

 

Now, what are the differences when you are using MAX? In MAX you are running a single channel at a sampling rate of 12.5 Hz which is quite different that in your vi.

 

Also, right-click the Array To Cluster function and change the cluster size from 9 to 8.

 

What modules are you using in your compact DAQ?

 

Ben64


When I use MAX, I get a reading of about 5ma but when I run my VI, the readings are all at a steady zero. I actually just changed the constant value hooked up to the daqmx read "number of samples per channel" from "-1" to "2" and now I am getting readings for "exit temp" and "mid temp"s but now there is no graph and the "hot" and "cold" strings are also not showing. I have no idea why this is. Any thoughts?

0 Kudos
Message 9 of 10
(5,088 Views)

jmejiagusmer,

 

I highly recommend checking out some of our DAQmx examples built-into LabVIEW. If you go to Help->Find Examples, you'll bring up the Example Finder. There are several Current Input examples under Hardware Input and Output->DAQmx->Analog Input. I recommend trying the Current-Continuous Input example. I think looking at an example might help you understand how continuous current input should be formatted. 

0 Kudos
Message 10 of 10
(5,054 Views)