03-30-2021 07:25 AM
I am trying to read some temperature sensors DS18B20 with Arduino and then display the readings from the two sensors on a string display using Labview
the problem I am facing is that there is a new character that appears in the middle of the string
also if anyone can help me with that string manipulation, that I want to separate the address of the sensor and its readings in two different arrays of strings, is that possible
\
Solved! Go to Solution.
03-30-2021 07:36 AM - edited 03-30-2021 07:40 AM
It would also help if you posted your Arduino sketch so we can verify your message protocol.
Now with your LabVIEW code...
Unfortunately, that is all the help I can really give without seeing the Arduino code. But you still might want to give this a good look: VIWeek 2020/Proper way to communicate over serial
EDIT: One more thing. I would not send the units from the Arduino. Just send the channel and value. You can then just use the Match Pattern to find the colon in the string. Before the match will be the channel name and after match will be the value.
03-30-2021 07:58 AM
thanks a lot for your fast reply, I appreciate it
I will attach the Arduino code below and the string i am sending is as follows ("Sensor 1: 24.06 °C") and what I get at the Labview string display is as follow ("Sensor 1: 24.06A°C") where did that A came from as attached in the first picture
03-30-2021 08:29 AM
@mentawy wrote:
where did that A came from as attached in the first picture
It appears to be from the sensor driver. It is a 0xC5. I would have to get into the sensor driver code to see if there is something in there. It could be reading an extra register or the string is not properly terminated.
03-31-2021 08:50 AM
@mentawy wrote:
thanks a lot for your fast reply, I appreciate it
I will attach the Arduino code below and the string i am sending is as follows ("Sensor 1: 24.06 °C") and what I get at the Labview string display is as follow ("Sensor 1: 24.06A°C") where did that A came from as attached in the first picture
I haven't looked at your pictures, but very much suspect this is to do with UTF-8 Encoding.
In UTF-8 the degree symbol is given by the code 0xC2B0 "°"
Your string is being read as the two ASCII characters 0xC2 "Â" and 0xB0 "°"
0xDEAD