LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Initiate motor Controller

I have a motor controller that is programmed by downloading an ASCII file to it, and then sending it ASCII commands. I know I can use the instrument IO assistant to write the programs and send them to the unit. How do I initiate the IO assistant to do the down load? Also how can I tie in keyboard strokes to initiate the commands to the controller?
 
Thank you,
0 Kudos
Message 1 of 2
(2,926 Views)
So let me make sure I understand your application first.

You have a motor controller connected via serial or GPIB and you need to send an ASCII file to the controller which tells the controller how to operate. It then receives ASCII commands via serial/GPIB again and uses the file to decipher what to do. If this is incorrect, please clarify, if I am correct, then you would do the following.

Since the IO Assistant only understand how to send ASCII characters (since that is all serial knows), you would have to send the file by first openning the file and reading the characters to send. From your post, it sounds like you have figured this out. As far as telling your controller to download the ascii, this must be a command that you must send to your instrument. All you send is ASCII characters and the instrument should understand them as some sort of command telling it to download.

As far as the keystrokes, you can do this by calling the user32.dll located in C:/windows/system32. I believe the correct function  is keybd_event. For more information on this, please refer to Microsoft's MSDN website.


Brandon Vasquez
Applications Engineer
National Instruments

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 2 of 2
(2,895 Views)