LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't write diiferent commands in the same row ow command line of VII

Hi guys,

I try to write some commands in the command line to instrument and it doesn't work.

F:C?;F:START?;F:STOP?

F:C? means center frequency, 

F:START? start quency

and F:STOP? stop frequency

but the result shows only center frequency.

Someone here knows why?

/mctnnn

0 Kudos
Message 1 of 11
(2,155 Views)

What instrument you are using?

If you have code, please post it.

 

And to avoid frustrated smileys, :S put your code in code brackets 

F:START?;
0 Kudos
Message 2 of 11
(2,147 Views)

Simple question that you probably already checked, but are the responses just being sent as multiple separate responses and you need to (VISA) Read multiple times (one per query)?


GCentral
0 Kudos
Message 3 of 11
(2,137 Views)

I try to write and read to and from a spectrum analyzer.

The code is simple:

ReadWrite2Specan.png

command2Instrument.png

/mctnnn

0 Kudos
Message 4 of 11
(2,131 Views)

@Atizss wrote:

What instrument you are using?

If you have code, please post it.

 

And to avoid frustrated smileys, :S put your code in code brackets 

F:START?;

The better solution is you can go into your profile settings on ni.com and disable the automatic smileys.

Message 5 of 11
(2,125 Views)

Thank you cbutcher for your reply,

The response from instrument shows only center frequency.

Can explain further what you mean and how to do it with Read mulitple time?

/mctnnn

0 Kudos
Message 6 of 11
(2,124 Views)

Something perhaps like the following (with appropriate setup and close VIs before and after):

You can just wire 3 if the input string is a constantYou can just wire 3 if the input string is a constant


GCentral
0 Kudos
Message 7 of 11
(2,111 Views)

@mctnnn wrote:

Can explain further what you mean and how to do it with Read mulitple time?


You need to perform a read for each query you sent.  So perform 3 reads.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(2,107 Views)

Thank cbutcher,

your design looks more professional one.

I try and use it.

Regards,

/mctnnn

0 Kudos
Message 9 of 11
(2,100 Views)

@mctnnn wrote:

Thank cbutcher,

your design looks more professional one.

I try and use it.

Regards,

/mctnnn


I mean, I'm flattered, but just remember that adding "professional looking" stuff isn't as good as not adding any stuff. So if you create a VI that uses these 3 commands all the time, and never changes the written string, then just wire a constant 3 instead of doing the string search.

 

The string search is useful if you might have an arbitrary number of commands concatenated (and you don't have a way of knowing how many from when you concatenated them, which you should). So I don't anticipate it's likely to be necessary unless the "message building" part is separated from the "visa writing" part by a 'module boundary' etc (software engineering, not LabVIEW term), and you don't want to also pass an integer into the Write/Read function as to number of Reads needed.


GCentral
0 Kudos
Message 10 of 11
(2,095 Views)