Hello,
I was trying to create a VI that:
1-Reads data from Serial Port. This data are strings containing several information and arrives each 500ms. On the end of each string, CRC is appended. I use % to separate CRC from other data.
2- For each string, my VI must, first, find % and remove the incoming CRC.
3- Then I have to check if the CRC of the string received is equal to CRC appended.
Please see this example:
![CRC_fpanel.png CRC_fpanel.png]()
In this example, the incoming string is:
ETS3#1984;18,93;1030,36;44,85;57,87;0;ON;5,00;USB;0,69;3,20;16,62;-0,51;0,16;9,89;ON;0.000000;0.000000%4785
The CRC is 4785(hex) and was appended at the origin of the communication link.
Then, if I compute the CRC of the data (incoming string without the CRC) I should get the same value. But I get a wrong value (DBDB).
The interesting is that if I use this VI found here:
http://forums.ni.com/t5/Example-Program-Drafts/Inline-CRC-Reference-Library-CRC-32-CRC-16-and-CRC-8/ta-p/3500715
the value of the CRC is correct (option CRC-16-CCITT-xMODEM).
So if I am not wrong, the problem can be the fact that I am using the subVI in a loop since there is a First Call function included.
Can anyone help me with this?
Bellow there is a snippet of my VI
![crc_check.png crc_check.png]()
Thanks a lot in advance.
Duarte