LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pressure sensors

Hi, everyone. 

I have a code to read pressure sensors and present it in a graph. 

When I start it goes very slowly as in picture PRESSURE 4. I wan to see a realtime data like in a normal seconds. 

I am new to labview and do not really understand what can go wrong in this code. 

I would really appreciate any help.

0 Kudos
Message 1 of 10
(182 Views)

Hi Natig,

 


@Natig wrote:

I am new to labview and do not really understand what can go wrong in this code. 

I would really appreciate any help.


When you are new to LabVIEW then you should take some beginner tutorials. There are some offer at the top of the LabVIEW board!

 


@Natig wrote:

When I start it goes very slowly as in picture PRESSURE 4. I wan to see a realtime data like in a normal seconds. 


You set both task to read 1001 samples at 10kS/s, so the reading will need 0.1001 s. This will limit the iteration rate to ~10Hz.

Additionally you placed a 500ms wait inside your loop, so it will iterate with just 2Hz.

 

What do you understand as "realtime"? We mostly understand you want to use a cRIO device instead of your Windows computer + ULx hardware…

 

Suggestions:

  • Set the number of samples to read to 200. This will give an update rate of 50Hz.
  • Remove the wait from your loop, so the DAQ device will determine the loop rate…
Best regards,
GerdW


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

Hi, with realtime I mean I want to see what is in sensor  in the graph during an experiment. 

I changed samples to read and removed wait function. I think some other problems because lines do not change with time. Once I pres run I see lines in graph but then they do not change as time goes on. Just like in the picture 7. 

0 Kudos
Message 3 of 10
(163 Views)

Hi Natig,

 


@Natig wrote:

I think some other problems because lines do not change with time.


Are there any errors in the loop?

You don't check them in your VI…

Best regards,
GerdW


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

No I do not get any errors, I added new error handlers as well, but there no error. 

0 Kudos
Message 5 of 10
(75 Views)

Hi Natig,

 


@Natig wrote:

No I do not get any errors, I added new error handlers as well, but there no error. 


So the problem could be in the wiring of your sensors to the DAQ device…

Did you check the wiring? Can you read the expected data using a simple DMM?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(58 Views)

Let's go back a few steps. 

Try reading just one channel first, with no filtering, until you get the quick response you're looking for. 

 

 

Once you have it going, then add the second  channel. I believe you can read the two channels, with just one function,  not sure if this how it goes, but something like this: 

Using physical channel like Dev0/Ai0-Ai1 and then change the function 

LVNinja_0-1738089979023.png

 

Message 7 of 10
(48 Views)

I deleted mixed graph and used waveform chart instead it worked. 

But now I have a new problem, Although I have two channel only one the their value is right in the graph, second one is represented with minimum value (-10 in create channel vi). You can see it from pictures. For channel 1 i expect 6.8 and for channel 2 I expect 1,9.

 

I have litteraly copied the same code in order to be able to see 2 different channels. But it seems one of them is not working. I am using ULx library not DAQ.

 

And one more problem is X axes in graph which shows 9 digits number, I have unchecked autoscale and tried to change startin and ending point manually but it returns to that 9 digits number instantly, I need to see seconds there

 

 

0 Kudos
Message 8 of 10
(24 Views)

With only one channel, I got the response I wanted (without filter graph is too noisy). 

I am using ULx library not DAQ, it is possible to change functions in read function to 2 d DBL, but I couldnt find how to change physical channel to Dev0/Ai0-Ai1. There was no option like this, only single channels was possible. 

0 Kudos
Message 9 of 10
(22 Views)

Hi Natig,

 


@Natig wrote:

With only one channel, I got the response I wanted (without filter graph is too noisy). 

I am using ULx library not DAQ, it is possible to change functions in read function to 2 d DBL, but I couldnt find how to change physical channel to Dev0/Ai0-Ai1. There was no option like this, only single channels was possible. 


With DAQmx you use the channel constant/control and select the channels as "ai0:1" (to select any channels from ai0 to ai1). I guess ULx handles this very similar…

 

You only need ONE task that reads 2 channels with "N samples"!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(15 Views)