11-07-2016 08:42 PM - edited 11-07-2016 08:52 PM
Hi all,
My situation currently is setting up proper communication between the Arduino and a UHF reader/ writer.
I am using
-Arduino Mega 2560
-Arduino compatible Compiler for LabVIEW
-Reader “CF-RU5106”
-Shield for Serial communication “RS232”
Tested the Arduino Compiler for LabVIEW and it works. I set up serial settings, and now starting to create serial instances for data flow. One mistake I made is that I totally forgot to take into consideration of the CRC-16. I tried setting up CRC computation code provided by the manufacturer using Formula Node in LabVIEW but was unsuccessful.
Any feedback or suggestions is much appreciated.
11-09-2016 11:02 AM
Hi jp978,
I think the following links should prove to be helpful in your application:
CRC16 Checksum:
http://www.ni.com/example/26488/en/
Tutorial: MathScript and Formula Nodes:
http://www.ni.com/white-paper/7572/en/
In order to receive the most sufficient help, I would also recommend posting your code.
11-09-2016 11:16 AM
Thanks
I came across various CRC LabVIEW examples and found two that seem to fit my application requirements. I am currently changing my code, and I will post it as soon as it looks decent enough to read.
11-16-2016 02:43 PM
This is what my code is looking like. So far I dont quite understand the CRC portion, but most of it consist of formulating the command for the reader.
Any feedback will help.
11-18-2016 10:29 AM
Hi jp978,
Here are some links that should prove to be useful for developing a CRC code:
Inline CRC Reference Library:
https://decibel.ni.com/content/docs/DOC-11072
CRC16 Checksum:
http://www.ni.com/example/26488/en/
CRC -16 Reference Calculator:
http://www.ni.com/example/26568/en/
CRC CCIT 16bits:
http://www.ni.com/example/26390/en/
CRC codes are something that we do not necessarily specialize in developing. I would recommend developing a CRC code based on a predeveloped algorithm as shown in some of these examples.
I hope this helps!
11-18-2016 04:25 PM
Here is a CRC-16.vi that I got from the LabVIEW Code Exchange a few years ago when I had to deal with them.
11-18-2016 04:30 PM
I will look at the links. Thank you.
11-18-2016 04:31 PM
Thanks for the sample. I will test it with my code.
11-20-2016 03:19 AM
I managed to get a value for the CRC code. I verified with some example code from the arduino forums and also some online CRC calculators. I managed to create a serial command using VISA, i will post the code below.
The problem currently is either setting the command and not receiving a string from the reader. Any suggestions will help.
RedoProj is the main code.
11-21-2016 06:25 PM
Hi jp978,
If you wouldn't mind elaborating on the error you are seeing I think that would help in this case. I am a bit unclear on the scope of the problem. Specifically, what error are you seeing when the string does not come through to the reader? Also, what is your expected output?