From a PM
QUOTE
theres no plc but I do have two programmable serial ports (programmed in basic). Thats EXACTLY what I need to do but I can't locate the references for the communication strings. Can you be of any assistance (is this available in the knowledgebase? If so I wasn't able to locate) Any assistance would be greatly appreciated.
HERE is the 2098 serial command reference. The 1398 varies but is very similar. I know there is documentation for the 1398 serial command reference but can't seem to find it.
The following is actually for a 2098. I have done this with a 1398 but have no current 1398 machines doing this. The hardest part is calculating the checksum. The following is the structure of the ASCII string you will send to the drive.
:aapppfdd..ddcc<cr>
: = New Command
a = Drive Address
p = Parameter (fill with zeros – 74 = 074)
f = Command
d = Data
c = Checksum
<cr> = End of string ($r)
The following is one of the strings I send to a drive. It is to retrieve the fault status
:010740D4$r
Since it am requesting data and not sending a parameter, the string has no data in it. Just the drive address (01), the parameter (074), the command (0), the checksum (D4), and the end statement ($r).
Like I said earlier the hardest part is the checksum. It would probably easier if I did serial communications everyday, perhaps someone else can help with this part.
To calculate the checksum you must add the ASCII numbers for each character in your string excluding the colon (: ). Then subtract 256 by the sum, then convert it to a hexadecimal number and use the last two digits of it. For mine it would be the following
48+49+48+55+52+48 = 300
256-300 = -44
-44 in hex = D4
If there were more than two digits you would only use the least significant two
The drive returns the following when there are not drive faults
:0107400000000054$r
Now at this point the proper thing to do would to be to take the values before the 54, which is our checksum, and make sure that it has returned the proper value. But I'm not trying to launch a space shuttle here so I skip that step and know that :01074 is the address it is coming from, 074 is the parameter, and 0 is the command I sent to the drive. From that I realize that the next 8 zeros is the data returned and move this value to another string to parse out the drive faults
Hope that helps. Call AB and see if you can get the serial reference for the 1398. I can't find it