LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequenced commands to VISA port

Solved!
Go to solution

Hello all,

 

how can send multiple commands to a VISA port?

in the attached drawing you will see a case structure, inside the case sturcture there are 2 commands, I want to send the first command be able to wait a while (delay) and then send the next command.

 

tnx 

0 Kudos
Message 1 of 12
(3,457 Views)

Try something like this:

 

commandSeq.PNG

========================
=== Engineer Ambiguously ===
========================
Message 2 of 12
(3,429 Views)

Try something like this:

 

commandSeq.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 12
(3,427 Views)

Yep, just use Build Array and then VISA Write inside of a FOR loop that uses an Autoindexing Tunnel.  Do this all the time.


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 4 of 12
(3,409 Views)

Sometimes I prefer using a command string from a configuration file. You can use the proper scpi syntax to concatenate multiple commands. In the command string you can use format specifier, this way you can use Format Into string with your command to set parameters in the code.

 

Edit: You can also use Spreadsheet String To Array

 

Ben64

0 Kudos
Message 5 of 12
(3,398 Views)

Hey RTSLVU,

 

tnx for the quick reply, can you please explain what do i see in the picture you attached?

like, where do i enter the commands, what does VOLT,FREQ and configure CI500 1ix means?

 

tnx

0 Kudos
Message 6 of 12
(3,373 Views)
Solution
Accepted by topic author ddwins

ddwins wrote:

tnx for the quick reply, can you please explain what do i see in the picture you attached?

like, where do i enter the commands, what does VOLT,FREQ and configure CI500 1ix means?


Those were just the commands for the instrument he was using.  In your case, I would just use a loop to iterate over your delays since the commands are otherwise exactly the same.


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
Message 7 of 12
(3,362 Views)

Hi crossrulz,

Im new with labview so I would need all the specifics you can give me.

from what I understand you connected the two VISA data wires into the FOR loop, inside the FOR loop there is this object that you are entering a constant string containing the follows:

LR%d

rM

r

what does "r" means? 

what is the use for "/"? does it seperate between commands?

also, I want to use labview in order to control the motion of a DC micromotor, the commands I need to send to the motor are as followed:

LR num / num is a value entered by user and tells how much increments the motor rotates
M / begining of motion
delay(#) / wait before sending another command
LR num*(-2) / the motor needs to move twice the distance to the other direction
M / begining of second motion
delay(#) / '' ''
LR num / motor returns to inital position
M / begining of 3rd motion

 I need these commands to be sent one after the other.

 

tnx

0 Kudos
Message 8 of 12
(3,341 Views)

@ddwins wrote:

Hi crossrulz,

Im new with labview so I would need all the specifics you can give me.

from what I understand you connected the two VISA data wires into the FOR loop, inside the FOR loop there is this object that you are entering a constant string containing the follows:

LR%d\rM\r

 

 I need these commands to be sent one after the other.

 

tnx


You should look through the self paced training material, but to adress some points:

The is the format string of the Format Into String, if you r-click Format Into String you can select Edit Format string for more information, but in this case it's LE[decimal number][return]M[return]

The decimal number is the wired "i", "\r" = return.

By placing it in a loop, you'll send each row one after another.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 9 of 12
(3,334 Views)

I recommend you read some help documents:

Format Into String Function

Format Specifier Syntax


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 10 of 12
(3,330 Views)