07-22-2009 08:00 AM
I would like to send a string of hexadecimal values to the serial port (using the "VISA write" block).
At the moment, I have a working design that will take a string of hex values, and convert them into an unsigned byte array.
However, it would seem that the "VISA write" block only accepts a string as its input.
If I use the "Byte array to string" block, then I can only convert the hex values that correspond directly to ascii characters. I.e. it will only convert hex values that lie between 0x20 and 0x7E. However, I need to be able to send values in the range 0x01 to 0xF8.
Any suggestions welcome.
Dan
07-22-2009 08:43 AM
07-22-2009 08:48 AM - edited 07-22-2009 08:49 AM
DanB1983 wrote:If I use the "Byte array to string" block, then I can only convert the hex values that correspond directly to ascii characters. I.e. it will only convert hex values that lie between 0x20 and 0x7E. However, I need to be able to send values in the range 0x01 to 0xF8.
No it doesn't. Why would you think that?
07-29-2009 04:53 AM
Hello,
I have also used typecast:
It really depends on how explicit you want the code to be, using Byte array to string is more obvious. Both execute in less than a millisecond on my machine.
07-29-2009 11:28 PM - edited 07-29-2009 11:30 PM
02-22-2018 08:31 AM
Hello,
please if you have found the solution told me I have the same problem
02-22-2018 09:34 AM
What specifically is your problem? As explained above, there is no problem with converting between byte arrays and strings.