02.06.2013 Views

TMCL™ Firmware Manual - Trinamic

TMCL™ Firmware Manual - Trinamic

TMCL™ Firmware Manual - Trinamic

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PD-109-57 V2 TMCL <strong>Firmware</strong> <strong>Manual</strong> (V1.00/2010-FEB-18) 14<br />

The binary command format for RS232 and RS485 is as follows:<br />

Bytes Meaning<br />

1 Module address<br />

1 Command number<br />

1 Type number<br />

1 Motor or Bank number<br />

4 Value (MSB first!)<br />

1 Checksum*<br />

*The checksum is calculated by adding up all the other bytes using an 8-bit addition.<br />

Checksum calculation<br />

As mentioned above, the checksum is calculated by adding up all bytes (including the module address byte)<br />

using 8-bit addition. Here are two examples to show how to do this:<br />

in C:<br />

unsigned char i, Checksum;<br />

unsigned char Command[9];<br />

//Set the “Command” array to the desired command<br />

Checksum = Command[0];<br />

for(i=1; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!