Code through the serial port

8 years 8 months ago #29526319 by infoa
Hello,

I am working with a sdc2130 controller. I am very interesting to send a script code through the serial port to the controller. I like send one script to the controller from a embbebed system. I can´t use a PC or roborun application. I have only a RS232 connection. It´s possible?


Thanks,

Please Log in or Create an account to join the conversation.

8 years 8 months ago #29526331 by Michael Burton
Yes.

Use the supplied serial cable. Communication is at 9600 8 bits no parity 1 stop bit, Then just send the control strings.

Please Log in or Create an account to join the conversation.

8 years 8 months ago #29526333 by infoa
Hello Michael,

Thank you for your answer. I have not expressed properly or I don\'t understand you.

Now, the embedded system and the controller can speak through the serial port, I use RS232, 115Kbps. It can send commands such as \"^ ECHOF 1\" or \"! VAR 5\". This is working ok.

On the other hand, I write one script on my computer and I sent it to the controller from the Roborun application . I write this code:
<!--
Dim velocidad as Integer
velocidad = 200
Dim velocidad_alta as Integer
velocidad = 400
...
...
...
-->

When I build it, i can see the device code:

<!--
\'DECLARE velocidad AS Integer
\'=====================================================
0: CONST8 200 |02|C8 \'push signed value of next byte to stack
@Push variable \'velocidad\' address into stack.
2: CONST0 |01 \'push 0 in stackk
3: ISTORE |06 \'pop address, pop value from stack and save at int var(address)
\'=====================================================
\'DECLARE velocidad_alta AS Integer
\'=====================================================
4: CONST16 400 |03|90|01 \'push signed value of next 2 bytes (LS,MS) to stack
@Push variable \'velocidad\' address into stack.
...
...
...
-->

I am interested to send this script to the controller, from an embedded system. I can not use Roborun. Can I send this code directly ?

CONST8 200 |02|C8
CONST0 |01
ISTORE |06
...
...

I can`t find some command to doing this. Thanks.

Please Log in or Create an account to join the conversation.

8 years 8 months ago #29526335 by roboteq
Replied by roboteq on topic Re:Code through the serial port
there is no easy way for you to send the compiled script code to the controller.

The procedure involves sending the %HLD comand to enter the loading mode. After that the data is sent as a hex-like code.

The actual protocol is simple but undocumented.

You may be able to figure it out by connecting another PC on the Rx data input of the controller and capture the data that is actually been sent.

Please Log in or Create an account to join the conversation.

Time to create page: 0.137 seconds