LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can one write text commands to a usb device through VISA?

I'm glad you got it working but I must say that, if it were me, I would investigate and fix the source of any errors rather than trying  to ignore them.
0 Kudos
Message 21 of 25
(1,043 Views)
I'm back at it. Got side tracked for a while but I am still needing to develop the stepper motor driver vi further. The first thing I want to do when I run the vi is send a command that enables optical stops for the stepper motor. This command is /1n2R\r. Then I may want to run follow-up commands like /1A9000R\r (tells the stepper motor controller/driver to move to position 9000); then return the stepper motor to zero position with /1A0R\r. Warren passed along methods for concatenating commands. If I want the stepper motor controller to enable the optical stops, move to stepper to postion 9000, and then back to zero, is use of the concatenation command a practical way to do this? Thanks in advance.
0 Kudos
Message 22 of 25
(1,016 Views)


@GeeWhiz wrote:
I'm back at it. Got side tracked for a while but I am still needing to develop the stepper motor driver vi further. The first thing I want to do when I run the vi is send a command that enables optical stops for the stepper motor. This command is /1n2R\r. Then I may want to run follow-up commands like /1A9000R\r (tells the stepper motor controller/driver to move to position 9000); then return the stepper motor to zero position with /1A0R\r. Warren passed along methods for concatenating commands. If I want the stepper motor controller to enable the optical stops, move to stepper to postion 9000, and then back to zero, is use of the concatenation command a practical way to do this? Thanks in advance.

That depends a bit on the device. Usually motion controllers execute any command at the moment they receive it irrespective if they are in the middle of another motion (sometimes with and sometimes without first decelariting the aborted move). And if you think about it this is usually highly desirable. If you give it a command to move to the other end of the room and suddenly find out that this is highly unsafe you would not want to wait until it reached that position (running over a few expensive instruments or even worse humans) before you can send him the command to stop or move into the other direction.

So you can probably append the first two commands but then will have to sit in a loop and monitor the current position or a "position reached" status before you can go to the next motion command.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 23 of 25
(1,012 Views)
Good comment Rolf. My stepper motor control statements allows commands like the positioning commands to be series into1 command. However, I believe the "enable optical stops" has to be done first and seperate. I'll give it a try.  Thanks
0 Kudos
Message 24 of 25
(1,005 Views)

Hello,
I am a novice in labview and i have a similar problem.
I am using Visa to communicate to the host pc OpenOCD from the remote pc via telnet. I have successfully managed to open a telnet connection but i cannot send the commands using the visa write. The command i am trying to send is poll. So i tried sending the command as 'poll\n' and 'poll\r' and 'poll\r\n' but to no avail. I receive no errors while sendind any of the command. The command is not sent to the local pc. I checked the connection via the test panel in the NI Max. when i send the 'poll\n' command there it works perfectly. I am attaching a screenshot of my code. Can anyone please help me out. I have asked this question in another thread but later found that this thread had similar discussion

 

Labview.PNG

 

0 Kudos
Message 25 of 25
(466 Views)