Computer control vs. configuration utility control

I have two jrk 21v3 motor controllers purchased from you a few weeks apart. Along with the first I bought a linear actuator.

I configured both motor controllers with the “Jrk Configuration” utility. Both move the linear actuator as expected when sliding the input slider of that utility.

I wrote a little computer program to communicate with the motor controller over the USB line. The linear actuator moves as expected using the first motor controller. When I swap in the second motor controller, which is configured identically, the linear actuator doesn’t move at all. However, when I try the “Jrk Configuration” utility again it does move in response to that utilities input slider.

Any idea on what is wrong?

Hello. If I understand correctly, your program is not able to control the second jrk. You haven’t given any information on how your code works or how it selects which jrk to talk to. If you want help debugging your program, I suggest that you simplify your program as much as possible and post the entire code. Also, you will probably have to close your program before the swapping the jrks unless you are doing something advanced.

–David

There’s only one MC at a time. I swap them in and out, so the program needn’t select which MC to talk to. I close the program in between swaps.

The code that’s works with one MC but not with the other MC follows. The compiler is PowerBasic.

Function PBMain
 Local hComm As Dword
 Local target As Long
 Local serialByte0, serialByte1 As Long

' open COM4 port
 hComm = FreeFile
 Comm Open "COM4" As #hComm

' set up port (or use default)
' Comm Set #hComm, Baud     = 115200  ' baud
' Comm Set #hComm, Byte     = 8       ' bits
' Comm Set #hComm, Parity   = 0       ' no parity
' Comm Set #hComm, Stop     = 0       ' 1 stop bit
' Comm Set #hComm, TxBuffer = 2048    ' 2K transmit buffer
' Comm Set #hComm, RxBuffer = 4096    ' 4K receive buffer
                                            
' example target position
 target = 2600

 serialByte1 = target
 Shift Right serialByte1, 5
 serialByte0 = &b11000000 + (target And &b11111)

' &hAA, device number, command with MSB cleared, data bytes
 Comm Send #hComm, Chr$(&hAA, 11)
 Comm Send #hComm, Chr$(serialByte0, serialByte1)

 WaitKey$

' close port
 Comm Close #hComm
End Function

Hello.

Have you configured both jrks to be on COM4? Can you double check the Device Manager to make sure that the Command Port of each jrk is assigned to COM4? Posting a screenshot of the Device Manager would be useful. If both jrks are sharing a COM port, you should be careful to never plug both jrks into the computer at the same time, or else the COM port might become unusable.

–David

That was the problem. The first jrk used COM4, the second COM5. When I changed, in the program, COM4 to COM5, it worked with the second jrk. Thanks.