Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write the scpi code to realize multi-frequency sweeps?

Hello.

I am using Labview 7.0 to control a function generator. First, I need to get a frequency sweep linearly from 10000Hz to 1000Hz in 5 sec and the sweep should be triggered by an external signal. Then I use "GPIB write.vi" and write down the following codes:

APPL:SIN 10000,3;

TRIG:SOUR EXT;

TRIG:SLOP POS;

FREQ:STAR 10000;

FREQ:STOP 1000;

SWE:SPAC LIN;

SWE:TIME 5;

SWE:STAT ON;

Then I run the VI and send the trigger signal. The result is exactly what I want. So I want to do a little more complicated operation: sweeps back to 1000Hz at the end of the first sweep.Now I find it is hard to be done. If I just write the second sweep code after the first one, the function generator will only follow the second sweep order.

I tried to use the Flat Sequence Structure to give the first sweep order and wait 5 sec to give the second one. It indeed worked.But I have to change the trigger source from external to internal. Then I can not control the time to start the first sweep precisely.

So can anyone help me to write the code to realize 2 different frequency sweeps after I send an external trigger signal?

Thank you so much.

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

Hi

 

You seem to want an arbitray waveform after an external trigger.

A bit more complex than what is a simple sweep.

If your function generator can do that (some can) you best can download a LabVIEW driver and not write scpi directly.

greetings from the Netherlands
0 Kudos
Message 2 of 6
(4,538 Views)

Thanks for your reply.

I'm sorry that I forget to mention that my function generator is Agilent 33250a. Its user's guide said that the trigger code is only available for sweep and burst. So arbitrary waveform may not be a possible way to resolve the problem.

0 Kudos
Message 3 of 6
(4,530 Views)

Hello,

      Here is the link to the LabVIEW Plug and Play Instrument Driver for your instrument:

 

Cheers,

 

NathanT

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

I have downloaded and use the driver in your reply. But it doesn't solve the problem.

Thank you as well.

0 Kudos
Message 5 of 6
(4,505 Views)

I am sorry to hear that the LabVIEW Plug and Play Instrument Driver does not meet your needs.  However, the great thing about Plug and Play Instrument Drivers is that you can modify the driver to have it do what you need, which in most cases is easier than starting from scratch.  If you do end up modifying the driver, please explain your changes/additions and we can look into adding them into the Instrument Driver.

 

Cheers,

 

NathanT

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