Welcome, Guest
Username Password: Remember me
Messages posted to this category need to be reviewed by the moderator before it gets posted.
  • Page:
  • 1

TOPIC: RS232 communication / 2 motors

RS232 communication / 2 motors 1 year, 11 months ago #1638

  • Antoine
  • Posts: 6
  • Karma: 0

I am trying to have 2 SM23165DT motors working together but I am unable to have even a PRINT(#130,GOSUB...) or x:2=a sent to the second motor (adress 2). From the PC interface I can send commands that work fine.
Motors communicate well with PC interface, and well alone (but it is not my goal)

I have ECHO on both programms downloaded to both motors (programms are different)
I have adressed motors so Motor 1 should manage all (I wish I can print and read variables in motor 2)

Could you help me?

Thanks in advance


Re: RS232 communication / 2 motors 1 year, 11 months ago #1641

  • csearcy
  • Posts: 480
  • Karma: 23
The commands like x:2=a are only available with the -C and -DN options that add a CANbus port to the motor. The RS232 commands can only go from Motor1 to Motor2, not from Motor2 to Motor1.

The workaround you may want to use is to open the RS485 ports on each motor. You will need to wire pins 5 to 5, 6 to 6, and 13 to 13 for this to work, and add the following instruction to each motor program.

OCHN(RS4,1,N,9600,1,8,C) 'Open RS485 port at 9600

Example of motor1 sending commands to motor2...
PRINT1(#130,"GOSUB(10)",#13) 'run subroutine 10 in motor2

Example of motor2 sending commands to motor1...
PRINT1(#129,"GOSUB(10)",#13) 'run subroutine 10 in motor1
PRINT1(#129,"a=",x,#13) 'set motor1's variable a equal to motor2's variable x
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.39 seconds