Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the VI so slow? VI using AFG 3011 and TPS 2014 drivers

Solved!
Go to solution

I am using signal generator AFG 3011 and oscillosope TPS 2014 driver VIs to generate a signal at various frequncy points, and then get the voltages to obtain the magnitude and phase plot. The VI I have attached does calculate and plot as well. The problem is just to calculate 3 frequency points its taking a long time and I need to take like 50 -100 points. It takes like few minutes just for 3 points. Is there something wrong with the Vi  or am I using the incorrect way?

0 Kudos
Message 1 of 6
(4,077 Views)

Yes, there are some things wrong with the VI and yes, you are using the driver functions in an incorrect way.

 

First, there are a couple scope config functions that should be moved to the initialize state. You are configuring each channel and then calling the horizontal settings function twicw - you only have a single timebase. Doing all of this in parallel makes no sense since the scope and GPIB is a sequential operation.

 

You are also using the Read function to get the waveforms from each channel. You should look at what each function is actually doing. Each time the read is called, the function makes the scope do a new acquisition. What you really want to do is a single Initiate followed by two Fetches. You have a bigger problem with the Read Measurements function. I believe each one of these will trigger a capture as well. Since you have already transferred both channels, use LabVIEW functions to calculate those parameters. Those you can use in parallel.

Message 2 of 6
(4,065 Views)

I need to have two different volts/div for two channels.How can I avoid using Config functions twice and set the two different volts/div?

 

I tried two different cases in sequence to fetch the wave and read the waveform  parameters for two channels but this doesnt seem to run the VI faster either.

 

If I use  read multiple waveforms to fetch the two plots from the two channels, what function can I use to  accurately measure parameters of the signals obatined from scope using Labview? 

0 Kudos
Message 3 of 6
(4,018 Views)
Solution
Accepted by topic author poo123

I said to eliminate the duplicate to the horizontal/timebase. That is not at all the same thing as the volts/div (vertical).

 

I have no idea how or if you used a case statement. What I envision is something like the code below. I only showd the analysis operation for one channel. You are already retuning the frequency with a LabVIEW function, you know.

 

 

p.s. Just realized that in an earlier post, you said you were using the serial port. Crank up the baud rate to as high as it can go and lower your expectations.

0 Kudos
Message 4 of 6
(4,005 Views)

I wanted to change the baud rate to  19200. I edited the port configurations in MAX and also the serial configuration for the initialize block for the scope.

I also set the same baud rate in RS232 setup in the Oscope itself in the utilities.

 

The VI test panel in MAX  also returns the query *IDN?/n as TEKTRONIX,TPS 2014,0,CF:91.1CT FV:v10.20 TPS2PWR1:v1.00\n.

 

 

The problem is when I try to run the VI, the initialize block for scope  gives an error as 1073807246.

 

But if the VI is run with same baud rate 9600 as before, it runs. What could be the cause of the error?

 

 

 

0 Kudos
Message 5 of 6
(3,915 Views)

That another program still uses this port. It could be MAX still open or hyperterminal or something else.

Please do not report only the error number but also its sign or even better the complete errormessage string.

greetings from the Netherlands
0 Kudos
Message 6 of 6
(3,903 Views)