Hi everyone,
I have been working for some months with LabVIEW in order to develop an application to control a SCORBOT ER-IX.
For those who don't know, this SCORBOT has a controller-B and is programmed trough serial port with ACL. It also has a software called ATS (Advanced Terminal Server) to send programs to the controller and others useful functions.
A part of my work consist in communicate a LabVIEW script with the SCORBOT. I have already ended this part, and then I am going to work in the machine vision part to analyze images from a camera and send the SCORBOT the positions and orders to make determinated orders.
The reason for this message is that some months ago I used the VISA library to manipulate serial port. It's very easy to do because of the simple operations, but the behaviour of the data sending and reception wasn't appropiate.
In these days, I obtained a solution that allowed me sending commands to the robot and receive it's response. The SCORBOT worked fine, it executed the instructions properly, but the response was always quite strange because the echo and the response were mixed.
I couldn't understand why that was happening. Hyperterminal works fine, but my LabVIEW code doesn't and is a very simple thing.
At last I put a serial port reader that looked for data in every iteration of a for loop.
The problem of that was the imposibility of knowing when the controller and/or robot have finished an instruction and were ready to receive more. I only get an script to send orders, but sending lists of them, waiting for the previous before sending the next, wasn't possible.
After some tests with serial port sniffer, hyperterminal, LabVIEW, ... I discovered that SCORBOT need instructions to be send byte to byte and when he receives the '\r' char executes the command. SCORBOT needs also some time to process each byte, so I have to wait (for the moment, 10ms).
I tried to write byte to byte in the serial port with VISA functions, but that doesn't work. I guess there maybe some internal buffers, so the data is send when they are full...
At last, I solve the problem using an Active X, mscomm.ocx and invoking the functions on it, but I wonder if is possible to do that with the VISA library, and if not, I think is a thing to look at for new versions.
I think VISA could be an easier way to do those things, but for the moment is not accurate or I don't know how to do that.
Thanks to everyone.
PS: I have my working code, so if anyone need to take a look on it, tell me.