Checksum - Red Lion

gimli

Member
Join Date
Nov 2014
Location
nowhere
Posts
34
Hello all,

Looking for some help with creating a checksum using Crimson 3.0 (Red Lion). This is the algorithm used in to produce a value which I need to duplicate using Crimson 3.0 and compare.


Based on LRC algorithm
Set LRC = 0
For each value v
do
Set LRC = (LRC + v) AND 0xFF
end do
Set LRC = (((LRC XOR 0xFF) + 1) AND 0xFF)


I did not notice any functions that might be used to do this. Any help would be greatly appreciated.

Thanks much


🍻
 
Eliminate the "set" term in your assignment statements.

"&" is the symbol for bitwise AND.

"^" is the symbol for bitwise XOR.

Refer to page 220 of the Crimson user manual for proper syntax of the For, While, and Do statements.

It isn't clear from your code where the values for 'v' are coming from.
 
In the Crimson 3 manual, search for a section titled "And, Or, and XOR". Also, search for a section called "The DO Loop".

With those two sections and their pseudo-code you're pretty much there.
 
Wow thanks for the quick response. I will check out that info in the manual. Very new to Red Lion

Kolyur,
The values of v are coming from a AB 505 (Integers)..just used v for the post to simplify...I should've been more clear.(y)

thanks much
 

Similar Topics

Hello all, I'm trying to recreate the following checksum calculation in the PLC. The example is written in C++ of which I am not very familiar...
Replies
8
Views
3,064
PLC is Automation Direct P2000. Destination device is a servo drive. Pacific Scientific SC755 with a custom program in BASIC. I have a copy of the...
Replies
2
Views
4,051
I have a PLC connected to a modem. I can tap into the modem via ethernet and read the Modbus messages coming in. So I use Modbus Poll. I'm...
Replies
10
Views
8,195
Does a change in the program always equal a checksum change? For instance, if I change a timer preset from 10 to 15 does the checksum change...
Replies
8
Views
3,512
HI, I have doubt in allen bradely plc , am using udp communication. My aim is to find the checksum of received message. what is my problem is...
Replies
1
Views
1,639
Back
Top Bottom