LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vector Signal Generator

Solved!
Go to solution

Hi,

 

can please anyone help me with this!

 

I want to:

 

 

  • Ensure that the sweep stops automatically after completing one full cycle.
  • Dynamically configure parameters (like Start/Stop Power, Step Size, and Dwell Time) without syntax errors in the SCPI commands.

 

0 Kudos
Message 1 of 5
(186 Views)

It is somewhat difficult to suggest how you should proceed.  The VI you attached is woefully incomplete, and written in a very sloppy manner, with wires running every-which-way (often backwards) and a lot of missing VIs (in addition, I'm sure, to the missing "Initialize", <something to do with VISA>, and "Close".

 

I've made a nice-looking Snippet of the code you attached.  Why did you right-justify the multiple commands in the Text box?  Don't you think it looks much more readable left-justified?

Balo1234.png

 

I assume you have a manual for the Vector Signal Generator, and the commands "make sense" for this instrument.  Do you really want to send all of those commands at the same time?

 

Why do you have a "Run Forever" While Loop?

 

What do you want to do with the four values you are converting into strings?

 

Are there other people in your organization to whom you can turn for help in getting the basic LabVIEW code put together?  Someone who knows about the Instrument you are trying to control (or can at least help you "look at the Manual" and figure out how to configure the command sequences?   

 

Bob Schor

0 Kudos
Message 2 of 5
(153 Views)

Hi Bob, thanks for your reply.


Before posting the code here, I tried it on the instrument and it ‘actually’ worked. I was able to set the frequency on the device and I was able to sweep the power step by step. I don't understand what you mean by sloppy, because the code I wrote is from the manual. The fact that you don't see the Initialise and Close block is probably because you don't have the driver for the device. On the point of whether there is a person in my company who could help me: If I had that person, I wouldn't be posting my problem here!


Now to the original problem: I want to change the values in the front panel and not automatically from the code I have written. that means I want to change the power start, stop, dwell time and steps dynamically.

0 Kudos
Message 3 of 5
(136 Views)
Solution
Accepted by Balo1234

@Balo1234 wrote:

Hi Bob, thanks for your reply.


Before posting the code here, I tried it on the instrument and it ‘actually’ worked. I was able to set the frequency on the device and I was able to sweep the power step by step. I don't understand what you mean by sloppy, because the code I wrote is from the manual.  I don't have access to the manual, so I don't know how you are supposed to configure it "programmatically" (presumably using VISA commands).  The fact that you don't see the Initialise and Close block is probably because you don't have athe driver for the device.  True -- you might have either included it, or given

us some clues what functions it provides (probably explained in the manual that wasn't included).  On the point of whether there is a person in my company who could help me: If I had that person, I wouldn't be posting my problem here!  Good point -- I'm trying to learn enough about your device to provide some suggestions ...


Now to the original problem: I want to change the values in the front panel and not automatically from the code I have written. that means I want to change the power start, stop, dwell time and steps dynamically.  I'm hoping the manual explains how to do this.


So here's a question -- have you ever plugged your device into your computer via a USB port, opened MAX, and tried to set up communications with the device over VISA?  If you open MAX and look at "Devices and Interfaces", can you identify which one is your Vector Signal Generator?  If so, open a Test Panel and try to set up communication with your device using VISA.  You'll need to set a bunch of parmeters (such as Baud Rate, Parity, etc., check your User Manual for what your device expects).  There are some other settings (whose names I don't recall right now), one in particular is to set VISA up so when the device outputs data to you, it ends it with a <CR><LF> (or at least an <LF>), as that greatly facilitates your ability to read data using VISA.

 

What I mean by that is when you configure VISA in LabVIEW (I didn't see that code anywhere), you use the default configuration that  strings from the external device end with <LF> (also called <NL>, for New Line, 0x0A).  Your VISA Read code becomes "VISA Read", specifying 1000 bytes to read (or, if you like binary, 1024 bytes).  What this does is to read from your device until it has sent all it wants to send, ending with <NL>, which lets the Read complete, and presents you with a string (of less than 1000 or 1024 bytes) that your device meant to send.

 

[Obviously, if the manual says "In this mode, the device sends a million bytes until you tell it to stop", this won't work, but that would be somewhat unexpected ...].

 

Bob Schor

0 Kudos
Message 4 of 5
(119 Views)

Thank you, this helped me a lot!!

0 Kudos
Message 5 of 5
(109 Views)