LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous graphing of two (or more) signals from the same DAQ

Hi, 

I am trying to set up a universal data acquisition for multiple sensors: resistance, voltage, currents, etc. 

My plan was to select the amount and type of sensor from the front panel. 

But my problem is that it only read from one of the sensors.

I attach my program where it is set up to two different sensors. 

Does anyone know what I am doing wrong?

 

Is there a template/example of a similair program such as Flexlogger for LabVIEW?

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

Hi M.,

 

you REALLY should cleanup your VI to remove all (atleast most of) the local variables because of race conditions.

Then remove all that Rube-Goldberg code! (Like: Why is "ON/OFF" a DBL indicator when it only holds a boolean value???)

Why are there loops running as fast as possible, just to burn CPU power?

Why are there 2 stop buttons for two loops, but also two loops set to run forever?

 

But my problem is that it only read from one of the sensors.

Because you programmed it this way!

See the DAQmxRead function polymorph instance saying "1Chan"!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,260 Views)

Hi GerdW, 

Thanks for looking into my program and trying to help. 

Sorry for my ignorance. Just started working with LabVIEW and programming. So this is the first time to develop a system. A lot of things I'm trying to learn and understand. 

- I will try to clean my local values. Not sure how to do it. But I will look into it. - Didn't know it would cause problems because of race conditions. 

- Hmm. I quite can't figure out what you mean when you say my "ON/OFF" is a DBL? I transfer it to an integer and use it as a switch for my timer which is a DBL. 

- I didn't set up a timer for my loops, because it caused some troubles when I saw the readings. But thanks for letting me know that it takes too much CPU power. I will look into it. 

- the two stop-buttons isn't configured yet. Just got it to work and left it. I control my program only the run and stop buttons at the top.

- As I see it, there is only one channel going into DAQmxRead as programmed? I switch the sensor type with the case structure, and still just one channel going in. 

 

I hope there is a friendly soul, who can explain what to do to get readings from multiple channels. 

0 Kudos
Message 3 of 4
(2,245 Views)

Hi M.,

 

I will try to clean my local values. Not sure how to do it.

Use wires instead: THINK DATAFLOW!

 

I quite can't figure out what you mean when you say my "ON/OFF" is a DBL? I transfer it to an integer and use it as a switch for my timer which is a DBL.

That "ON/OFF" is of orange color: that means you created a DBL value. Why use a DBL value just to store an (blue!) integer value? Why use numeric values at all when you just want to store that (green) boolean value???

 

I control my program only the run and stop buttons at the top.

Which is wrong.

Someone said: Using that STOP button in the menu is like using a tree to stop your car…

 

there is only one channel going into DAQmxRead as programmed?

Not "going into that function", but "you configured the function to read just one channel"!

See the type selector below the DAQmxRead function? Where it says "1 chan N samples"? Here you selected just ONE CHANNEL!

Btw. your DAQmx Physical Channel controls are also set to just one channel: why do you even wonder you are reading only one channel???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(2,242 Views)