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: Testing and setting baud rate on RS232 chain

Testing and setting baud rate on RS232 chain 5 years ago #247

I'd like to set up both my motors to 38400 baud at the start of my program. Is there a sequence of commands and port settings that will set all the motors on an RS232 daisy-chain to the same baud rate irrespective of what their rates and states were to start with?
I've been trying to work out how SMI does it when it detects motors. It seems to send 2 WAKE commands and a BAUD# command for each rate, and then a BAUD# command at the desired rate, but what if the RS232 port is set to a different rate to the motors at the start of this procedure? Won't the motors just ignore everything?

When a motor is in ECHO mode, does it act like a wire link and echo the state of the Rx line on the Tx line regardless of speed, or does it only echo characters that are received at the correct rate?

Re: Testing and setting baud rate on RS232 chain 5 years ago #252

  • csearcy
  • Posts: 480
  • Karma: 23
If the commands are coming from a host, the motor defaults to 9600 and will receive commands at that baud rate. The host can send the BAUD# globally to set all motors to 38400, and then the host can switch to 38400 and continue communications.

The OCHN command can also be used in the SmartMotor program to set the port to 38400 when the program boots up.

When ECHO is off, only the response will be returned.
When ECHO is on, the command and response will be returned.
Note: The motor will only respond to commands sent at the correct baud rate.
The following user(s) said Thank You: Chris Dancer

Re: Testing and setting baud rate on RS232 chain 5 years ago #253

That's what I thought should happen, but when I tried it it didn't work, the motors just kept communicating at 9600. Maybe there was an uncleared error flag.
It occurred to me this morning that the simplest way to do it is to have each motor set its own baud rate at startup.

What I meant in my question about ECHOing was will a motor echo commands that are sent to it at a baud rate other than the one it is set to (simple hardware link from Rx to Tx) or does the motor receive a character on the Rx pin, interpret it, then re-transmit it?

- Chris

Re: Testing and setting baud rate on RS232 chain 5 years ago #266

Thanks. I think I'll use OCHN to set the baud rate at startup, that's the simplest and most reliable way.

What I meant about ECHOing was, for instance, if a motor has ECHO on, and its baud rate is 9600, and it receives a command at 38400 baud, obviously it won't respond to the command, but will it echo it on the Tx line at 38,400 baud?
Or to put it another way, does a motor ECHO characters by reading them and re-transmitting them using its UART, or does it just switch on a hardware buffer between Rx and Tx?

Re: Testing and setting baud rate on RS232 chain 5 years ago #267

An issue I have just found is that the BAUD# command when sent from the host does not work. I have tried using it from the terminal in SMI and my own programs, the motor just seems to ignore it.
Example copied from the monitor display:

'Comms port is at 9600
RMODE O 'Report movement mode returns "off"
BAUD38400 'Change baud rate to 38400
RMODE O 'This should return no response, because baud rate should now be 38400!

As you can see the rate is stuck at 9600. It didn't change when I sent the BAUD# command. Why not?

Re: Testing and setting baud rate on RS232 chain 4 years, 12 months ago #282

  • csearcy
  • Posts: 480
  • Karma: 23
The motor will only ECHO commands sent at the correct Baud Rate.
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.47 seconds