LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous data acquisition with Agilent 34972A

Hello everybody,

 

at the moment I am working with the Agilent 34972A driver for the first time and I have a problem.

I develloped a LabVIEW VI which should log 6 temperatures and 2 voltages. The programme works fine and I receive a text data after logging. But it seems as if LabVIEW records the channels step by step and there are always about 5s between two different temperatures or voltages for each channel.

I want them to be parallelized and continuous.

It might be possible that my LabVIEW VI is the problem because I actually had no idea how to create my VI and I was really surprised when it seemed to work.

It would be great if anyone can help me fix my problem or give me some advice how to change my VI.

 

I attached my VI and a text data to show you how it looks like.

I want new temperatures and voltages been logged every 100ms.

 

I use Agilent 34972A and LabVIEW2011.

 

Thank you very much and if anything isn't clear yet, just ask.

 

Download All
0 Kudos
Message 1 of 17
(9,431 Views)
There's very little in that program that is correct. Instead of the monitor function and reading one channel at a time, use the function to read the entire scan. The logging part is completely wrong because you use local variables placed outside the loop. They only get updated once and you keep writing stale data. Use a producer/consumer architecture.
0 Kudos
Message 2 of 17
(9,420 Views)

Thank you for the response.

I'll try to change the program. Actually I tried to read the entire scan but I have absolutely no idea how. The problem is that I don't know how to choose and change a channel when I don't split them. Could you give me some advice?

The logging part seemed wrong for me too. I copied that from a VI I created some months ago and didn't really know how to put them together. But I'll try to work on it.

 

0 Kudos
Message 3 of 17
(9,408 Views)

You do not understand how to use that instrument correctly.

 

You must follow these steps.

 

1] Configure every channel for the measurement you want it to take.

2] Configure any scaling if needed

3] Build a scan list of the channels you want to scan

4] Scan the channels at regular intervals 

 

The scan will read each channel sequencilay and send back the measurments 

 

I use a state machine regularly with the 34972A

 

Here is an example of steps 1-3 configuring DC volts, Scaling DC shunts, K type thermocouples, and building a scan list.

 

Init data logger.PNG

 

To scan the instrument use the Scan-now vi that I attached. It will return a numeric array, string array, or CSV string containing each measurement.

 

Also don't be confused by my example using Agilent 34970 vi's the 34970 and 34972 are identical except for the communication options.

 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 17
(9,400 Views)

Thank you for the helpful response.

I changed my VI and now I can configurate the measurements.

But I still don't know how to put my 'measurement part' and my 'logging part' together.

Besides... when I schould not use the monitor.vi, which should I take instead?

0 Kudos
Message 5 of 17
(9,357 Views)
Look at the attached VI or the examples that come with the instrument. Turn on Context Help and read the function descriptions.
0 Kudos
Message 6 of 17
(9,340 Views)

Like Dennis said look at the examples, my "Scan-now.vi" is just a modified example that came with it.

 

This instrument is a data logger, it is designed to take a lot of measurements at regular intervals.

 

It's not a fast DAQ, it is really not designed to take continuous measurements, the monitor function is there for monitoring if you need to keep a close eye on something by physically watching the instrument and that's really all. 

 

 

A basic program using the 34970 or 34972 would go something like this.

Configure channels

Build scan list

Scan

Save and display measurements

Wait for next scan interval

Go to Scan

 

Again I find a simple state machine to be the best program architecture for this instrument.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 17
(9,330 Views)

Thanks again for your help.

 

I changed my VI and the reading and scanning works fine.

Even my data logging part works well. But both together is not working the way I want to.

I am pretty sure that I have to use a While Loop but I don't know where to put it. I tried everything put my txt data looks always like in the attached jpg.

Can you help me fix my problem? Do I really have to use a While Loop or is there a function I don't know yet?

 

text data.JPGVI Screenshot.JPG

0 Kudos
Message 8 of 17
(9,298 Views)
Yes, in order to continuously read, you must use a while loop. It should be around the scan and read function. The configuration should be outside the loop. The logging you have inside the loop makes no sense. I would suggest a producer/consumer design.
0 Kudos
Message 9 of 17
(9,291 Views)

Okay I got it.

I just deleted the two While Loops and put one around everything.

Now it works! 🙂

 

0 Kudos
Message 10 of 17
(9,289 Views)