01-17-2017 10:20 AM
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
Solved! Go to Solution.
01-17-2017 10:51 AM
Try something like this:
01-17-2017 10:53 AM
Try something like this:
01-17-2017 12:16 PM
Yep, just use Build Array and then VISA Write inside of a FOR loop that uses an Autoindexing Tunnel. Do this all the time.
01-17-2017 12:53 PM - edited 01-17-2017 12:55 PM
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
01-17-2017 03:59 PM
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
01-17-2017 04:37 PM - edited 01-17-2017 04:37 PM
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.
01-18-2017 01:24 AM - edited 01-18-2017 01:26 AM
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
01-18-2017 06:17 AM
@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
01-18-2017 06:46 AM
I recommend you read some help documents: