03-30-2023 11:19 PM
Hi Sir,
For the communication with some sensors or BLE, we need to write the Hex data, also read the Hex data, then parse to what we want.
But looks like the VISA VI is accept string, also output string.
Normally, how should be set this ?
Thanks.
03-31-2023 07:55 AM
Do you have more details on the data frame? For reading, you need to use the format of the data frame to read it properly.
When dealing with non-normal display format strings, make sure the Display Visibility is turned on for your controls/indicators/constants.
04-21-2023 10:03 AM - edited 04-21-2023 10:04 AM
Hi Sir,
Sorry for late reply, I had a business trip to Vietnam for two weeks.
The background is that I purchase a temperature sensor, from the instruction of the sensor:
send : 01 03 00 02 00 02 65 CB
and also get back some hex value like that.
So that is the reason i asked this, how to deal with this when the sensor accept hex data and return hex data.
Thanks.
04-22-2023 04:00 AM
Hi
Hex is a translation of integer, or other number representations in hexadecimal.
Attached a vi in LabVIEW 2020 that translates the first part of your string into a 16 bit integer. (I16)
And also translates that back to the same string even with the leading zero by asking for 4 places.
This should help you in realising your own translation dependend on the integer type(s) used.
04-22-2023 09:04 AM
Thanks for your info,
What is the difference for hex display and normal display:
Also for the output, we need to convert like this ?
04-23-2023 06:44 AM
@Brzhou wrote:
What is the difference for hex display and normal display:
Normal display shows the string as ASCII characters. Hex display will show the hexadecimal representation for every byte. For instance, if you have the string "301" in normal display, it will show as "3330 31" is hex display.
@Brzhou wrote:
Also for the output, we need to convert like this ?
Since you have not given us information on the content of the messages, we cannot say how to do the conversion.
04-23-2023 09:52 AM
Understand.
"301" --> 33 30 31
But finally this will impact the content to VISA write or not ? or just different kind of display to us ?
Thanks.
04-23-2023 11:46 AM
04-23-2023 05:33 PM
@Brzhou wrote:
Understand.
"301" --> 33 30 31
But finally this will impact the content to VISA write or not ? or just different kind of display to us ?
Thanks.
Only the display to us is different. The bytes in the string are the same.
04-24-2023 12:43 AM
Thanks both for your reply.