Host Command instruction for Allen Bradley Ultra 200

  • Thread starter FACTORY AUTOMATION SYSTEMS LTD
  • Start date
F

Thread Starter

FACTORY AUTOMATION SYSTEMS LTD

Dear List, I am in the process of developing an Indexing servo system using Allen Bradley Plc 5/20, Allen Bradley Ultra 200 Index Servo drive and Allen Bradley Panel view 900. The Servo drive is to communicate to PLC 5/20 via the serial port using Host Command instructions (ASCII Code). Plc 5/20 will be used to manipulate the Indexing distance and this is then displayed in a panelview900. The trouble I am facing is I am not able to figure out how the Checksum is derived in the command instruction inspite of trying all that is explained in the Host command help in the Blue Master software. Example, if I give a Command to the Servo Drive as:001B50800003E80F0<cr>, How is the Checksum F0 derived in above command? Please, if you have done something like this before , I will appreciate any help you can offer me. With thanks, Gabriel Wamiti, Factory Automation Systems . Email:[email protected]co.ke . Cell:254-733-795-661
 
Is that an accurate copy of an actual message? I find it "odd" that it has an odd number of digits. Other than that, it looks like the Intel Hex format that we used to use (and still use) to download program code to EPROM programmers and the like. Each two digits was a byte of data, and if you summed all the bytes, including the checksum, the result would be zero (the bottom two hex digits of the result would be 00). To create a checksum, just take the two's complement of the sum of all the other bytes and plunk it on the end.
 
L

Larry Lawver

To further illuminate the Host Command Protocol checksum process, and to respond to a question Gabriel sent me offlist, here is how the checksum for his sample command is generated. His sample: :001B50800003E80F0<cr> The colon and the carriage return signal the start and finish of the command. The 00 at the beginning is the node number of the target Ultra; the 1B5 is a command number, and the 0800003E80 is the data need by that command number. All commands are assembled from node, command number, data, and checksum fields. The shortest possible command would be seven characters long; the longest I've seen is nineteen characters long. All characters used are hexadecimal, that is, only the values 0-9 and A-F can appear. To calculate the checksum, each character must be considered as the 8-bit ASCII that gets transmitted, that is, 30h through 39h and 41h through 46h. Yes, it is confusing at this point. Hexadecimal data must be represented as ASCII which is easiest to represent as---- hexadecimal!! So, in the example, we must sum as follows: 0=3D30h 0=3D30h 1=3D31h B=3D42h 5=3D35h 0=3D30h 8=3D38h 0=3D30h 0=3D30h 0=3D30h 0=3D30h 3=3D33h E=3D45h 8=3D38h 0=3D30h _______ =3D=3D310h (Everyone following along with their Windows calculator, except Curt? <G>) The next step is inversion, which produces something like: FFFFFCEF (depending on your environment's field length) Then, add 1 to that: FFFFFCF0 Only the last two characters are used: F0 These must be interpreted as two ASCII characters and appended to the node, command number and data. The final result is the command string from Gabriel's example. By the way, I intentionally explained this very differently from the way Allen-Bradley explains it, to provide a completely different point of view on a confusing subject. Hope this helps! Larry Lawver Rexel / Central Florida
 
L

Larry Lawver

Hey, Gabriel--- My motion specialist, Terry Huber, and I have worked out an implementation of the Host Command Protocol for the Ultra and the MicroLogix controllers. I am planning for this to be my first submission to the PLCArchive, but I haven't generalized it yet. In the meantime I have a program, which serves a specific purpose from which general capabilities can be distilled. If anyone is interested, contact me offlist for a copy of the file (in .RSS format). The Host Command Protocol was obviously developed outside the Allen-Bradley universe, then brought in through corporate merger. It reveals weaknesses in the ASCII commands in the MicroLogix series; you should have an easier time with the PLC-5/20. To calculate the checksum, you must: 1.) Select each character in the command, whatever the length. 2.) Deal with hexadecimal as a nibble, while characters are bytes. 3.) Sum the nibbles. 4.) Throw away any overflow. 5.) Convert the remaining two characters to ASCII and append it to the command. This could have been more complicated, but it would have taken thousands of consultants millions of billable years. The code works in the least sophisticated A-B processors. The command assembly process, including the checksum, is revealed in LAD 10. Listers: This is a pretty interesting problem, and I already think my approach has flaws. I welcome all improvement suggestions, especially from Ken Roach. Eventually, I will post a general solution to the PLCArchive. Meanwhile, attack at will! Hope this helps! Larry Lawver Rexel / Central Florida [email protected]
 
L

Larry Lawver

Somehow, a lot of "3D" fields got added to my sum of the ASCII codes! All of the "3D" appearances should be ignored, as shown here! > 0=30h > 0=30h > 1=31h > B=42h > 5=35h > 0=30h > 8=38h > 0=30h > 0=30h > 0=30h > 0=30h > 3=33h > E=45h > 8=38h > 0=30h > _______ > 310h > > Hope this helps! Larry Lawver Rexel / Central Florida
 
Top