LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how long does it take to write data from network analyzer

I am using LabVIEW to control two DC power supplies through GPIB-USB and I have a DAQ-6008 generating 8-bit digital output. I am connecting two DC power supplies and the 8-bit digital signal to my circuit and want to measure s parameters (all S11, S12, S21, S22) and write their magnitude and phase to a .txt file in my laptop. It worked but took about 1.5 minutes to write data (magnitude and phase of four s parameters) for a fixed DAQ output and fixed DC voltage by only sweeping 6 points. Is it a reasonable time? Because eventually I will have more than ten thousand combinations and need to record s parameters for all these combinations and it will take too long. I would like to know which part spends more time or how I can reduce the time to write four s parameters. Thanks a lot.

 

 

 

0 Kudos
Message 1 of 4
(2,766 Views)

Looking at the program, I'm kind of surprised that it only takes 1.5 minutes.Smiley Wink

 

With each iteration, you are completely reprogramming each of the instruments - even when a parameter does not change. You've got front panel controls for the analyzer but I don't see how or why you would change them once the VI starts. Included in each of the instrument VIs is the intialize function and with the defaults, you are probably resetting the instrument each time as well. Pull out the functions that only need to called when the program first starts. In the loop, only have the absolute minimum instrument functions. For example, your code right now has a read of the power supplies. You are not doing anything with this so why have it? For the analyzer, within the loop you probably only need to have the functions from the Initiate to the Read Data.

 

When you start to fix this, do NOT need to use a sequence structure for this. Just use the error in/error out connections to enforce data flow.

Message 2 of 4
(2,740 Views)

Hi Dennis, Thanks for taking a look at my code and also your reply!!

 

So you mean I should delete some of the controls in the front panel  and make them a fixed value or default in the block diagram to reduce the front panel controls? What does it mean that I am resetting the instrument each time? Do I need the initialize VI and close VI in every iteration or I should have them out of the loops so all the instrument are initialized and closed only once throughout the entire process? For the network analyzer, when you said I only need the VIs from initialize.vi to read data.vi (the second one from the end), do you mean that I can delete the close.vi? and why does it make the program faster? I know I have a bunch of stupid questions and thanks in advance!!

 

 

0 Kudos
Message 3 of 4
(2,727 Views)

Hello yll,

 

-So you mean I should delete some of the controls in the front panel  and make them a fixed value or default in the block diagram to reduce the front panel controls

What Dennis is saying is that your front panel controls are only read once by your program.  The are read at the beginning and the value is passed into the while loop.  This is the value that will be used, even if you change the front panel.  You can verify this by using highlight execution. 

 

-What does it mean that I am resetting the instrument each time?

Everytime you call the initialize VI, you send a command for the instrument to reset.  This is not necessary, since you want your settings to remain for the entire program.  You can reset it when you "first" start using it, but as your program keeps going, you do not need to reset it.

 

-Do I need the initialize VI and close VI in every iteration or I should have them out of the loops so all the instrument are initialized and closed only once throughout the entire process?

That is exactly what you should do.

 

-For the network analyzer, when you said I only need the VIs from initialize.vi to read data.vi (the second one from the end), do you mean that I can delete the close.vi? and why does it make the program faster?

You should probably add the close outside the loop, as good practise.  I would still put the initialize outside the loop.

 

I hope this helps.

O. Proulx
National Instruments
www.ni.com/support
Message 4 of 4
(2,713 Views)