Discussion:
where do i start when writing instr. driver (VISA, serial) for 3rd p controller
(too old to reply)
st syd
2008-08-04 09:10:15 UTC
Permalink
i am trying to write an instrument driver for a motion controller/amplifier called the MC-CQ-B which i bought from National Aperture. I think i need to write it using VISA and ascii codes, but how do i start on this? i need the controller to drive a simple dc brushed motor which it is capable of doing. The commands are simple and need to drive the motor forward at a set speed, hold at a set distance and drive it back to home.The controller uses a serial RS232 port.i am using labview 7.1 SE, on windows xp.is there a better way (simpler) way to do this, than to write in visa?thanks,sriram
st syd
2008-08-04 13:40:12 UTC
Permalink
here is the labview driver i was provided with, how ca i reconfigure this to make it work properly? thanks.sriram


labviewformccqbmotioncontroller.zip:
http://forums.ni.com/attachments/ni/140/31371/1/labviewformccqbmotioncontroller.zip
Song_M
2008-08-05 20:10:11 UTC
Permalink
Hey st syd, It seems like button panel is the top level VI.  Can you verify communication with the instrument through this top level VI?  It it does communicate, then you will need to find in the manual the commands to send to perform the actions required, then you can modify the driver.  If it does not, I recommend that you set the baud rates and serial settings accordingly, then try again in either the top level VI or hyperterminal to make sure communication is established.  Thanks! st syd.
st syd
2008-08-06 06:40:07 UTC
Permalink
hi, i have tried to establish communication but it does not appear to work.i have also set the baud rate, etc to what has been recommended by the controller.the ascii commands seem to be preloaded into the driver. Also where can i learn about the ascii commands and what they will do? Do i have to contact the manufacturer (are the command system specific), or are the commands generic for all controllers.thanks in advance
tflink
2008-08-06 09:10:15 UTC
Permalink
Hello,
 
Yes, the commands to send are specific for each device so that you have to get from the manufacturer.
I have found a manual on their home page which includes help to set up communication and how to program including command descriptions.
 
I also saw in the read me file that was included in the zip you attached that you need to use null modem cable, did you notice that?
 
Sending UART commands using VISA is the simplest way but I see in the code that they provided that they managed to make it look complicated.
Maybe you can start by testing the communincation in the application software that they say thew provide in the manual and when that is working look at the VISA examples in Labview to Open port and send the commands you need.
 
BR
Thomas
st syd
2008-08-12 03:40:07 UTC
Permalink
Hey, Thanks you all for your help.Can you provide me with a template of how to use visa to communicate with a motion controller, where you can input velocity, or distance for the motor, if it is possible.Thanks,st_syd
Song_M
2008-08-12 21:10:13 UTC
Permalink
Hey st syd! The input velocity, distance of the motor communication commands should all be listed in the manual for your device.  I recommend using the simple VISA read and write example VI provided with LabVIEW example finder to first write to the device, then read from it to establish communications
Loading...