VB.net Serial port communications to motor controller

  • Thread starter Thread starter Rozdower
  • Start date Start date
R

Rozdower

Guest
Hi all,

I'm writing a simple new interface to get away from the cumbersome factory software we are using to communicate with a 1994 Kollmorgen BDS5 motor controller. I haven't written VB in a long time except to make a data logger for some load cells that just spat data out and it collected it and put it in a file. One way data mostly.

I have successfully established communications with the drive with a terminal window and a simple send command. Upon opening the port, I send a VbCr to the drive 3 times which it then spits out a "-->" Prompt that lets the user know the drive is ready for accepting commands.

Now the issue I am having is, I have two buttons that will change the operating mode of the drive. Mode 1 is Serial Torque and mode 2 is Serial Velocity. When each mode is selected, 2-3 commands need to be sent to the drive sequentially. I have then in a group like this.

Serialport1.write ("PLIM OFF" & VbCr)

Serialport1.write ("TQ ON" & VbCr)

Serialport1.write ("GEAR OFF" & VbCr)

It tries to send them super fast (9600) baud, oh my, but all three get sent faster than the drive can get back a response and it kicks back errors. Drive didn't like the command "AR OFF", so I'm assuming all the commands got smushed together upon arrival. Is there a way, with a timer or something that can send each command with a second delay/Pause?

I need to poll the drive to see the speed and a few other variables but that's a whole different matter. I have to send a "P and the name of the variable I want to see. "P" for print. Basic much? Then take response and feed it into a textbox for viewing. I can figure that one out. Just the delay in sending the commands has me scratching my head.

I'm not asking for a pot of gold here just a few tips to point me in the right direction.

Thanks in advance!

Tom

Continue reading...
 
Back
Top