LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

winbatch or a better way

I'm trying to use LabVIEW to send ASCII commands to a MDrive 23 stepper motor controller.  This was previously done with a WinBatch system and the wwser4i.dll.
 
In LabVIEW however, my problem is that I need to work on the ASCII command application and would like to get away from the serial port control structure because I know its already been done many times.
 
Trying to find a plug in serial read and write aleays leads me into the bowels of the serial port control. I consider myself a novice to LabVIEW and would like (impatiently) to move on to this application.  
 
What is needed is to send simple (mostly text) sequences like "VM"  (set velocity max) , "A" (set acceleration) and extended commands like "SL -8000" (slew backwards 8000 steps) and "PR V" (print current velocity on the default printer).
 
This seems like such a simple application and I have no problem using case structures to provide the commands and print the ocassional responses. However, back to the serial port, Is there a simple complete VI that will allow me to plug into my application to the serial port?
 
Thanks
0 Kudos
Message 1 of 5
(2,858 Views)
There are a couple of shipping examples of serial communication. One is called Basic Serial Write and Read and the other is Advanced Serial Write and Read. The biggest difference is how they handle a termination character that is often required. You should be able to modify either for you application. If you plan to call either as a subVI though, you would be better off moving the VISA Serial Port Config and the VISA Close out and placing them in the top level VI. You should not have to call either repeatedly.
0 Kudos
Message 2 of 5
(2,855 Views)
Thanks.  I saw that but when I started looking closer I thought it required a driver for whatever was on the other end. In this case I don't have a driver.
0 Kudos
Message 3 of 5
(2,835 Views)
Don't know what you mean by "I thought it required a driver for whatever was on the other end". I think you may be getting the terminology of "driver" mixed up. There's drivers for the communication mechanism, such as the serial port drivers, and there's drivers for instruments, which are nothing more than VIs that implement the commands. For the former, you already have that - it gets installed when you install LabVIEW and VISA. For instrument drivers you can see if someone has already written up those VIs or you would need to write them up yourself.

I didn't see instrument drivers for the MDrive, which means you'll probably have to write them up yourself. You can create a new instrument driver project from the LabVIEW startup page, or select "New..." from the File menu, and select "Project -> Project from Wizard -> Instrument Driver Project". Even better is to download one of the serial-based instrument drivers from the Instrument Driver Network to see how they're done.
0 Kudos
Message 4 of 5
(2,822 Views)
Very useful reply. Thanks. This is really helping with the big picture for me.
0 Kudos
Message 5 of 5
(2,813 Views)