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

TOPIC: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2

Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 6 months ago #1443

Hello all,

I'm using 2 motors (SM23165DT and SM23165D as Motor 1 and Motor 2, respectively) over an RS-232 daisy-chain. There's one analog input being fed into the 15-pin D-sub on Motor 2. Right now I'm just running everything through the SMI Terminal. It's a very simple X- and Z-axis table, with a down-right-up-left movement repeated for a predetermined number of cycles. The motors never need to move at the same time, so I have separate programs in each motor that just use the RS-232 line to start the next motor moving when they're finished (using something like PRINT(#130,"GOTO23",#13), for instance).

My issue is that Motor 2 is happy to respond to those commands from Motor 1, but when it sends out commands, they show up in the SMI Terminal, but Motor 1 does not respond to them. When I type those same commands into the terminal, Motor 1 will respond. I'm guessing that they're not being echoed from the computer to Motor 1, but both motors and SMI have ECHO turned on. Any suggestions, short of using some other program on the computer that will control both motors?

Apologies for any gross or obvious errors in this setup; both servos and serial communication are newer topics to me.

Thanks in advance.

-J

Re: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 6 months ago #1445

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
What you are seeing is normal for the RS232 daisy chain. Motor1 can send commands to Motor2, but Motor2 cannot send commands to Motor1. This is due to the way the daisy chain is wired.

Here's what you can do. On the 15-pin connectors, connect pin-5 to pin-5, pin-6 to pin-6 and pin-13 to pin-13. Open the secondary RS485 port in each motor with the following command...

OCHN(RS4,1,N,9600,1,8,C) 'Open ports 4 and 5 as RS485 channel 1.

Now.. change your PRINT commands to PRINT1. RS485 will allow commands in both directions.
ex. PRINT1(#130,"GOTO23",#13)
The following user(s) said Thank You: Solidified3d

Re: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 6 months ago #1450

csearcy wrote:
What you are seeing is normal for the RS232 daisy chain. Motor1 can send commands to Motor2, but Motor2 cannot send commands to Motor1. This is due to the way the daisy chain is wired.

Here's what you can do. On the 15-pin connectors, connect pin-5 to pin-5, pin-6 to pin-6 and pin-13 to pin-13. Open the secondary RS485 port in each motor with the following command...

OCHN(RS4,1,N,9600,1,8,C) 'Open ports 4 and 5 as RS485 channel 1.

Now.. change your PRINT commands to PRINT1. RS485 will allow commands in both directions.
ex. PRINT1(#130,"GOTO23",#13)


OK, I thought that may be the case with the daisy chain. I will give the RS485 a shot. Thanks for the help.

Re: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 6 months ago #1457

Everything works wonderful with the RS-485. Thanks again for your help, csearcy.
The following user(s) said Thank You: csearcy

Re: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 1 month ago #1567

Hi.
I had a similar problem using RS232 comms between two SM23165D motors and followed your advice, re wiring pins 5,6 & 13. I then wrote a little bit of test code to try out the comms using the 'OCHN(RS4,1,N,9600,1,8,C)' command at the beginning of each motors code. My comms were not successful...
Can any-one post a very simple program that I can use to check my motor comms please?

Also, what is the best way to hold the program in motor 2 until it is called by motor 1. Can I use a while loop and jump over it with a GOTO command from motor 1?

Cheers.

Re: Daisy-chain RS232 - Motor 1 not receiving commands from Motor 2 2 years, 1 month ago #1568

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
If you have two motors connected via RS232 and can connect to them with the SMI software, you can test the RS485 connection in the Terminal Window of SMI.. if you have the two motors connected like you said(pins 5,6 and 13). You should first download a program to each motor that opens their RS485 port with the OCHN command as you specified. You should also give the motor an address.

'Ex. Motor1
SADDR1
OCHN(RS4,1,N,9600,1,8,C)
END

'Ex. Motor2
SADDR2
OCHN(RS4,1,N,9600,1,8,C)
END


Using the SMI software Terminal Window, type a command from Motor1 to Motor2 via RS485...

1PRINT1(#130,"a=123",#13)

Then check the variable "a" in Motor2...

2Ra

You should get 123 back.


As for program flow control between two motors via RS485... Have the program in Motor2 loop until Motor1 changes a variable...


C10
a=0 'Clear out a handshake variable.. which can be set to 123 using the PRINT1 example above

'Do something... and wait for Motor1 to let me move on

WHILE a!=123 LOOP
PRINT1(#129,"a=123",#13) 'Set variable a in Motor1 to 123 as a handshake
RETURN
Last Edit: 2 years, 1 month ago by csearcy.
  • Page:
  • 1
  • 2
Moderators: hsummer, csearcy
Time to create page: 1.21 seconds