1 post in this topic

Hi,

i'm doing a project that receive 3 values from MES: AutorizaçãoMES [DINT], OF_MES [DINT], and QtdExpectavel [UDINT]. I want a checksum calculation based in this 3 values.

this is the code i made

 ToAryByte(In:=AutorizaçãoMES, Order:=_LOW_HIGH, aryout:= arrayChecksum[0]);
 ToAryByte(In:=OF_MES, Order:=_LOW_HIGH, AryOut:=arrayChecksum[4]);
 ToAryByte(In:=QtdExpectavel, Order:=_LOW_HIGH, AryOut:=arrayChecksum[8]);
 Checksum1 := arrayChecksum;
 Checksum_PLC_MES:=WORD_TO_UINT( AryCRC16(In:=arrayChecksum[0], Size:=uint#12, OutOrder := _HIGH_LOW));

 in the attach i have the code simulation with values.

The CRC16 result is not the expected, Can anyone help me with that?

 

Thank you in advance

 

Screen Shot 04-04-24 at 07.06 PM.PNG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now