FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use COM port (RS-232) to control LED Panel problem in LabVIEW

Solved!
Go to solution

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

0 Kudos
Message 11 of 15
(5,067 Views)

Hi!

   Still, I don't understand in depth what you're trying to do... Smiley Happy

 

   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!!! Smiley Wink

 

   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

Message 12 of 15
(5,061 Views)
Solution
Accepted by topic author Mr. Robert

Hi!

   This is a little more complete!

 

graziano

Message 13 of 15
(5,057 Views)

 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

0 Kudos
Message 14 of 15
(5,042 Views)

Hi!

   Thanks for rating me, from forum renewals is my first accepted solution! Smiley Happy

 

    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

0 Kudos
Message 15 of 15
(5,037 Views)