serial communication (RS-232)

Hello world,
I have a servo motor "Trinamic PD-146-60-SE" which I want to control with my "Arduino MEGA 2560". But how can they communicate each other with RS232? I can find in Datasheet of the Trinamic Motor that the pin 10 is "RS232_TxD" ->RS232 transmit data
the pin 11 is "RS232_RxD" ->RS232 receive data

Which pin has to be combined which pin on Arduino?

If this problem is solved my second question is, which how commands can I control the Motor?

Thanks!

You need a RS232 adapter, such as
http://www.nkcelectronics.com/rs232-to-ttl-converter-board-33v232335.html
or
http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.html
and then use Serial1, Seriial2, or Serial3 from the Mega to talk to it.

Standard RS232 is high voltage (+/- 12V perhaps, though not always), so you have to be
careful when interfacing to logic-level serial connections such as the Arduino TX/RX pins.

Thanks for the answers but it doesn't help much. The RS232 is a 26-pin sub-d socket. I connect pin 10(RS232_TxD) to the Rx1 pin of my Arduino and pin 11(RS232_RxD) to the Tx1 pin of my Arduino. Now I had to write some commands to the Arduino Mega 2560 to move the Trinamic servo motor.
If I write the TMCL commands to control the motor

Tmcl Commands
ROL 0, 500000 //Rotate motor left with speed 500000
WAIT TICKS, 0, 500 //wait
MST 0 //Stop motor

But it doesn't work.
I get this message:
exit status 1
'ROL' was not declared in this scope

of course, it doesn't work because ROL is not a arduino command. but how can i move the motor?

nwr7:
'ROL' was not declared in this scope

of course, it doesn't work because ROL is not a arduino command. but how can i move the motor?

You need to post a link to the datasheet for the motor driver so we can see what instructions it requires.

My guess is that you need to send a message to the driver that include the phrase "ROL"

...R

https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0ahUKEwjRhfPPyYjUAhXBKFAKHbAQCosQFgg6MAI&url=https%3A%2F%2Fwww.trinamic.com%2Ffileadmin%2Fassets%2FProducts%2FDrives_Documents%2FPD-146-60-SE_TMCL_firmware_manual.pdf&usg=AFQjCNGUSOmNmomXOvAbL4dfx1VPfYxJmQ&cad=rja

Above you can download the datasheet for the motor.

I have had a look at that document. There are 107 pages. It would take me too long to figure it out. Sorry. In any case i don't think I could figure it out well enough to explain it to you without having a motor to experiment with.

On page 5 it seems to suggest that there is a

Step/Direction/Enable Input (Step/Direction support in hardware, differential, single ended and open
collector signals accepted)

That would make life much simpler but I can't find any details about it. Maybe there is another document.

...R

Hi,
in the PDF document you can find in page 14, how it is possible to control with binary commands. An example to this is given in page 23 and 24.
I found a few tmcl code library in this link: https://www.trinamic.com/support/software/tmcl-ide/
if i want to test the program, i get an error from arduino "exit status 1: variable or field 'SendCmd' declared void".
I am not good at programming, because of that I would be very thankful for every help!

nwr7:
in the PDF document you can find in page 14, how it is possible to control with binary commands. An example to this is given in page 23 and 24.

Indeed. But I am not prepared to suggest how to implement that when I cannot try my suggestions first.

...R

I solved the problem. I needed a MAX232. I bought and connected it to my arduino like here: Der Pegelumsetzer MAX232: Elektronik-Magazin

Now, it works!

Thank you all, for your help!