01-24-2025 07:24 AM
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.
01-24-2025 07:58 AM
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:
01-24-2025 08:16 AM
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.
01-24-2025 10:56 AM
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…
01-28-2025 03:11 AM
No I do not get any errors, I added new error handlers as well, but there no error.
01-28-2025 10:15 AM
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?
01-28-2025 12:46 PM
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
01-30-2025 07:05 AM
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
01-30-2025 07:11 AM
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.
01-30-2025 07:57 AM
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"!