10-07-2008 01:05 AM
Hi all,
I attaced the problem VI.
You would see that the input string is in HEX, but after operaion it change to ASCII value.
Please help me modify.
Regards,
Robert
10-07-2008 01:42 AM
Hi!
Still, I don't understand in depth what you're trying to do...
Anyway, I've made some little changes to the VI you attached. "Add array elements" is a good choice, but I'd first convert elements to a greater data type, such as U16 or U32, to avoid high bytes truncation, since sum is of the same data type as the input!
"Number to hexadecimal string" function is not what you want. The name is a little misleading, since this function converts a number to a "normal" string, which contrains that number in hexadecimal format, but it is intended to be hexadecimal for human (i.e. who reads it), not for PC! If you have to do byte manipulation, I strongly suggest to compute everywhere with U8 array (Byte array), you do all data manipulation you need, and you convert to string (byte array to string function) only immediately before sending data to VISA write. Don't mind if you can't read this string, or if it has strange characters! It isn't you that have to read this string, but the serial port!!!
So, for short: manipulate everywhere U8 array of data, and then convert it to string with "Byte array to string"!
I've also put another useful function, to divide high byte and low byte, in case you need it.... even if I think you shouldn't use this to do your task!
Let me know if you solved!
graziano
10-07-2008 02:16 AM
Hi!
This is a little more complete!
graziano
10-07-2008 08:26 AM
HI Graziano,
Thanks for your support.
I knew very little about HEX number and string convertion.
But after viewing your prog, It taught me a lot on it.
Regards,
Robert
10-07-2008 08:30 AM
Hi!
Thanks for rating me, from forum renewals is my first accepted solution!
Anyway, keep in mind that my VI is not so smart, knowing exactly what you have to do would allow me to improve it; if you encounter further problems, please post!
graziano