LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex to ASCII conversion

I am trying to send the ASCII string to the VISA write by sending the input comand + CRC which is calculated as FF-1 + Hex(Input Command).
I managed to calculate CRC and have it in hex form.
Now I need to convert CRC into ASCII and then send it together with input command.

Can you add the part that I am missing?

I tried few things but was not lucky.

Thanks,
Pedja
0 Kudos
Message 1 of 4
(3,265 Views)
Coop:

Try this.


Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 2 of 4
(3,265 Views)
Pedja,

Whatever you are doing in that example does not look like a CRC computation (see e.g. http://www.relisoft.com/Science/CrcMath.html ), but I'm no expert here. (Also, you seem to be doing FF+1-X in the code as opposed to FF-1+X described in your post).

Again, I am pretty sure that your device expects the raw string, and not the hexadecimally formatted representation of it.

Do you have more detailed instructions on what your device expects, maybe an example command together with the resulting string that needs to be sent? How long are the commands? How many bits in the CRC?
0 Kudos
Message 3 of 4
(3,265 Views)
Hi,

The CRC calculation is given in the manual as FF+1-X.
Sorry for making the confussion with minus sign.
I admit I do not know much about calculating the CRC but the example is given in the manual as FF+1-X that is why I am just using that.
And it works. I communicate with the device and I read everything properly so we don't have to worry about that at least.

Thanks a lot for all support,
Pedja
0 Kudos
Message 4 of 4
(3,265 Views)