04-18-2021 09:30 PM
Hello, I have managed to get data from SMA Sunny WebBox using RPC through UDP, but I can't seem to convert the data from UDP read VI from a string to number after obtaining the values using array.
Any idea what type of string/data is coming out of UDP read VI?
I have also noticed the string for each letters have one spacing between each other.
I have attached some images below.
Thanks,
Jason
04-18-2021 11:13 PM - edited 04-18-2021 11:14 PM
After checking the code. I found out the output of the UDP read to be an ASCII code.
How do I convert ASCII code to back to normal strings?
Thanks,
Jason
04-19-2021 03:15 AM - edited 04-19-2021 03:17 AM
Seems I had fix the issue myself, thanks. Here the VI to log data every 15 seconds from SMA Sunny WebBox using UDP everyone 😃
The solution to the parsing was to simply strip '0' I have inserted.
04-19-2021 03:22 AM - edited 04-19-2021 03:27 AM
Hi Jason,
two comments:
04-19-2021 03:46 AM
UTF-8 does not use embedded 0 bytes. This is definitely UTF-16BE if it works like this. As long as you do not use extended ASCII characters, the LabVIEW strings would be directly compatible with UTF8, since the first 127 character codes in UTF8 are equivalent to the 7-bit ASCII codes that are also used in all normal Windows codepages for the first 127 characters.
04-19-2021 07:01 AM - edited 04-19-2021 07:05 AM
Hi GerdW,
I took a few days break in between when programming this and I seems to have forgotten about the removal of '0's when I am back to programming it. 😅
In order to prevent race condition, what would be the better way to send string data to the VI. Do I link it directly? I realise the data from UDP is slightly slower than the data at the indicators.
I need those indicators on the GUI, would using array for the output values achieve the same results?
Thanks,
Jason
04-19-2021 07:07 AM - edited 04-19-2021 07:07 AM
Hi Jason,
@Jason_Y wrote:
In order to prevent race condition, what would be the better way to send string data to the VI. Do I link it directly?
Yes, usually you just use wires to transfer data! (Pretty basic LabVIEW stuff…)
@Jason_Y wrote:
I need those indicators on the GUI, would using array for the output values achieve the same results?
In the end: yes.
I prefer clusters as you can label each cluster element individually…