From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-13-2017 01:18 AM
Dear guys
I have a problem in the edit the CRC16 code,i can't get the CRC16 checksum is same as the correct command list showing.pls help to have a look about my Vi,if have a bug or no attention point,thanks a lot.attached my vi,fyi.
Solved! Go to Solution.
11-13-2017 01:22 AM
I want to send the string"01 03 00 00 00 08",then generate a CRC "0C 44",but the result is not my attention.
11-13-2017 01:59 AM
Hi,
To start with your second post. The ModBus CRC of the command you give is not 0x0C44 but it is 0x440C
In you program you convert a string into a byte array. If you convert the slave address '01' as a string into a byte array you will get two bytes 0x30 and 0x31. The are ascii character and what you need is a single byte with the value of 0x01.
If change your VI.
Kees
11-13-2017 02:16 AM
Dear Kees,
Thanks a lot.i got it.i use labview 13.0 version,i can't open you VI,but i have change my vi,now it can meet the result when swap the low 8bit and high 8bit,thanks a lot again.i'm misguided by the meter communication spec.
11-15-2017 01:45 AM - edited 11-15-2017 01:45 AM
To be complete. Here is the LV 2013 version.
Kees
05-02-2019 03:58 PM
(*bump*) I have attached your code with the incorporated byte swap for version 2018. Kees' version appended two zero-value bytes that made the Modbus CRC calculation invalid, and your approach seemed more straightforward.