HexaDecimal to String Conversion in Studio 5000 Logix Designer

mdia

Member
Join Date
Jan 2020
Location
USA
Posts
2
I am working on calculating a checksum value for a command that is to be sent from an Allen-Bradley CompactLogix PLC to a Mass flow controller. An example of a command is the following: "@@@022SX!20.00;CHECKSUM".
1. The checksum is the sum of every characters' ASCII code value (starting from character 3).
2.Then this sum (which would be in decimal format) has to be converted to HexaDecimal
3. Finally, the last two characters of the result have to be extracted and that would be the value of the checksum.

(For Ex: the value of every individual characters' ASCII code (starting from point 3) of the above command is 715. in HexaDecimal, 715 = 2CB. So , the value of the checksum for this command would be 2CB)

I got to the point where i found the sum of ASCII code. Any idea on how to convert that to a HexaDecimal and then convert that HexaDecimal to a string so that I could concatenate it to the command string??
 

Similar Topics

Hi, i want to convert a hexadecimal string like 'FFFFFD0E' to integer. i know it equals -754. but i can not convert it in twincat. i can do it in...
Replies
6
Views
6,774
I really need your help here! I have a Decimal Number that is being transferred in 1-byte words. The original number is larger than 1 byte...
Replies
2
Views
2,370
I am trying to mask the first 8 digits of binary code in a Allen Bradley remote I/O module for alarm tracking puposes. I only need to read the...
Replies
3
Views
3,230
Hi all, I am programming a Omron PLC. I need advice on this issue I am having. How do you convert D100 - &150 to D101 - #150. If I used...
Replies
3
Views
1,870
Please help, i'm working on a project where i need to convert decimal to hexadecimal, but i dont have a clue on how to do it. Thanks guys
Replies
21
Views
21,434
Back
Top Bottom