LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can not measure temperature and voltage simultaneously

I am a beginner with labview. I want to measre temperature and voltage simultaneously. When I run
the VI, I can get temperature or voltage, but not togther. I attach my VI, please give me suggestion on
how to make it work. 3X
0 Kudos
Message 1 of 11
(4,253 Views)
Since I don't know your exact configuration I will make some basic assumptions based on how it appears that you have configured the DAQ Assistant Express VIs.
Assumptions:
1. You have only one DAQ board in your system.
2. You want to scan continously
3. You want to acquire 3 temperature channels at a rate of 1000S/s and take 100 readings at a time
4. You want to acquire 2 voltage channels at a rate of 1000S/s and take 1000 readings at a time.

Based on this configuration your first problem is that you have configured the DAQ board to acquire continously in the first call to the DAQ Assistant (your first frame of the sequence structure). This ties up all the analog acquisition resources without releasing them. When you make your second call to the DAQ Assistant (your second frame of the sequence structure) you are creating a conflict because the DAQ board is already busy running your first request. At this point you are probably receiving an error but you might not see this since you are not doing error checking in your code. This is also why you are only getting one set of data. Next iteration of the while loop the first call to the DAQ Assistance reconfigures the board and executes again and so the cycle repeats itself.

I don't have a DAQ board installed so I can't confirm with certainty if I am correct but you can do this by simply changing the DAQ Assistant properties. In the 'Task Timing' tab change from 'Acquire Continuosly' to 'Acquire N Samples'.

Assuming this works all you have done is confirmed that my assumptions are correct and technically your program should work. So now some programming advice.

It's ok to scan all channels at once even though they might not be of the same type so go ahead and configure all your channels in one DAQ Assistant call and get rid of the sequence structure. Decide on one set of parameters for Scan Rate and Samples to Read, in your case I doubt this will be a problem. Since you are performing the same analysis on all channels you don't need to parse your data simply pass the 'data' from your DAQ Assistant into a single 'Amplitude and Level Measurements' Express VI. You will now have a single array with all your Mean values based on the order the channels are configured. If you want to plot the data in different graphs all you need to do is parse your channels using the 'Split Signals' or 'Select Signals' Express VI.

Hope this makes some sense.

-Christer
Message 2 of 11
(4,253 Views)
You are right. I made change in Timing' tab from 'Acquire Continuosly' to 'Acquire N Samples'.
Then I can got those data simultaneously. However, it
is very slow. I wander it is realtime measurement or not. Dose this matter with the PC?

Now I am following your advice to make other changes in programming.

Thanks.

Wu
0 Kudos
Message 3 of 11
(4,253 Views)
Make the other changes. The solution you curretnly have is slow for several reasons.
1. Everytime through a while loop iteration you reconfigure the DAQ operation (configure, start, stop)twice.
2. In addition every time through a while loop iteration you perform the following operations. Scan at 1000Scans/s and take 100 readings, this takes 100ms. Then you do the same thing but taking 1000 readings, this takes 1s.
3. then add the analysis to this.

Without bringing in the PC performance every iteration takes atleast 1.1 seconds. Thus the appearance of slow performance.

So what the changes will create is to only call the DAQ function once to configure and start the acquisition (Acquire Continously). Another way to increase the perfor
mance is to change the Scan rate to 10,000 Scans/s (Hz) and 100 readings. With these seetings the update rate would be ~10ms. This will give you a much better real time appearance.

Sounds like you are on the right track, good luck.

-Christer
Message 4 of 11
(4,253 Views)
In this case I can not set both temperature and voltage in one DAQ assistant. I don't know why.
Tere should be a way, but I can't find it.
BTW: Do you know how seperate the signals of temperature and show them in different thermometers?
0 Kudos
Message 5 of 11
(4,253 Views)
I found another problem.
I cannot set the x axis to show the the relative time.
Does the y axis show the real value of data when I set it multiplied by 1? I mean that when the signal went through the amplifier(SCXI-1102), had the signal been amplifiered?
I am confusing with it for a long time.
0 Kudos
Message 6 of 11
(4,253 Views)
I don't have a DAQ board installed so I can't confirm it on this end but I would be surprised if you can't have all channels configured in one DAQ Assistant call. I will confirm if I get the time.

To separate the signals use my previous recommendation. "If you want to plot the data in different graphs all you need to do is parse your channels using the 'Split Signals' or 'Select Signals' Express VI." In your case take the 'Mean DC' output and pass it into the 'Select Signals' Express VI. From there you should be able to send the selected signals into seperate thermometer indicators.
0 Kudos
Message 7 of 11
(4,253 Views)
Wu

It is not possible to combine different measurement types with DAQ Assistant. However, you can combine different types programmatically. Click here for information on how to do that.

To change the x-axis scale to relative time, right click the Graph in the front panel. Go to X-scale -> Formatting. Under the �Format and Precision� tab, select �x-axis� from the drop down menu. Then select �Relative Time� from the selection box.

The SCXI-1102 has programmable gain amplifiers that can be programmed for a gain of 1 or 100. If you programmatically set the gain to 1, then the SCXI would no
t amplify the signal.


Russell G.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 11
(4,253 Views)
It is realy nice.
However, when I tried to add more channels to test temperature, I could not make it.
Also I do not know how to save the data in this program.
0 Kudos
Message 9 of 11
(4,253 Views)
To save data, please check out the example programs under Help -> Find Examples. There are plenty to choose from to help you get started with saving data.

Please open a new discussion forum post for any other questions that you might have.

Russell G.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 11
(4,253 Views)