LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB to 422 Converter Woes

If the line is not terminated by something, it isn't recognized as a command.

Thanks for the idea, anyway!
0 Kudos
Message 21 of 53
(3,544 Views)

Try manually setting the buffer size using 'VISA Set I/O Buffer Size.vi'. You MUST wire the 'size' input.

0 Kudos
Message 22 of 53
(3,476 Views)

Hi,

Thank you Brian for that vi for the ims...it is a good starting point when one want to write a labview programm to controle the IMS drives without having to use the IMS software.

However, I am having problem with that vi. I have a IMS Mdrive23, old generation. In order to see if I can send command to the Mdrive using Labview, I used your vi and the command "FD" (set to Factory Default"). If everything works perfectly, I should get the following response from the Mdrive: "Copyright 2001-2007 by Intelligent Motion Systems, Inc".

The problem is that I don't get that response all the time, instead I get "FD".

More intringuing is that the proper  response is given alternatively with FD when I run the vi several consecutive times.

Would you have some ideas of what could be wrong?

Initially, I thought that the buffer of the Mdrive was full.

What's really intringuing is that it is alternative : "FD" or "Copyright 2001-2007 by Intelligent Motion Systems, Inc", depending on how many times I run the vi.

I would really appreciate to have some comments on that issue.

0 Kudos
Message 23 of 53
(3,366 Views)
The "FD" command is being echoed back from the MDrive, AND it is sending the startup block after it resets.  The VI I sent you may or may not read all data, depending on the timing.  If you increase the time delay inside the read loop, I bet you will get all data.  You will have to increase it quite a bit, or put a manual stop button on it once you see all the data.
0 Kudos
Message 24 of 53
(3,356 Views)

Thanks Brian for the quick reply.

Regarding the time in the loop and its meaning: is that time related to the response time of the MDrive for all commands or just for the command "FD" ?

Thanks.

0 Kudos
Message 25 of 53
(3,339 Views)
It should just be the "FD" command.  It takes some time, I think about a second.  The other commands should happen much faster than that.
0 Kudos
Message 26 of 53
(3,328 Views)
Brian,

I am trying to use an MDrive17Plus with Labview. I am taking a look at ims vi you posted. Which termination character should I be using. It is still not clear to me even after reading the posts.
Thanks
Any other hints will help.
0 Kudos
Message 27 of 53
(3,064 Views)
Sam-
 
My only real experience with the MDrive and Labview was with the simple VI I posted.  I did my project using an HMI that interfaced to the MDrives.  I did another project with Labview and MicroLynx controllers, but that syntax is different.  You should be able to run the VI I posted without a problem.  The termination character I have setup on the write is a CR/LF.  If you get a popup error, then you will want to turn off automatic error handling.  That VI is not what I would use for a true application, though.
 
Brian
0 Kudos
Message 28 of 53
(3,043 Views)
I am able to write single commands to my MDrive17 now through the USB port. I have a few more questions though.
1. Why am I getting the commands echoed back when reading the buffer? It would be very useful to be able to both write and read.
2. Instead of issuing individual commands, how can I run a script?

Thanks
Sam
0 Kudos
Message 29 of 53
(3,017 Views)

1. There is a command to turn the echo off.

2.  I'm not sure, but assume that you mean to run an on-board program.

As with all devices, especially motion controllers, it is best to become intimately familiar with the device before trying to run it from Labview.

0 Kudos
Message 30 of 53
(3,012 Views)