0

I have a message that I need to add a checksum INTO...

Dave Hitchman 4 weeks ago in IQANdesign updated by Gustav Widén (System support) 4 weeks ago 1

The j1939 message/frame I need to create has a counter/checksum in it. 

Now I can calculate the checksum using the constituent values of the frame (e.g. byte 1 is a 4 bit control type and a 4 bit mode), but I would rather use the bytes of the finished message so the checksum can be done more 'generically' without caring what is in those bytes. 

So assume the output j1939 is called Fred maybe there is something like Fred.byte(1) or similar I can use in the maths, I cant see it but maybe someone knows of something I missed. 

Then I would like the function (calcChecksum) to be available to ALL frames (Fred, Bob, Delilah...) without being rewritten - also dont really see how that can be done but at the moment until Fred.byte(1) etc. is sorted it doesnt matter.

There is a built-in function for calculating checksum on the frame, the channel type "CRC parameter".

If the message checksum match one of the methods that can be configured with this channel, it is a very easy solution.