LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

byte reading from serial

Solved!
Go to solution

Hi all,

I have a small application that consists of reading data from a serial port using VISA READ function. The source of data that i am trying to acquire from the serial port is a microcontroller that is sending a word or a byte( 8bits) . However, when trying to download the programming code into the microcontroller, the programming software saves the code as HEX file in the chip.

 

That was all just an explanation to get into the problem.

 

in oreder to get my application done, i used the attached VI which i did not program but added some functions to it for many purposes.The Vi is working perfectly and everything is working well, but it seems that i got some misunderstanding right here.

 

what i am trying to understand right here is why a (hexadecimal string to number) function is used as long as i configured everything to read bytes( 8bits)

 

I am very confused Smiley Sad

 

any suggestions would be appreciated.

 

Thank you 

Bill David
Download All
0 Kudos
Message 1 of 6
(2,829 Views)

Hi Bill David,

 

you say your vi is working correctly.

 

you receive 1 or 2 bytes. and the a 'byte of information' could also be in hex format.

 

try the vi (LV2012) attached. if you are using some other version of labview let me know.  instead of string datatype try with numeric or other datatypes also.

 

RENN

Kudos always welcome for helpful posts 🙂
0 Kudos
Message 2 of 6
(2,819 Views)

Thank you RENN

I am using labview 8.5 , could you please convert it so i can try your VI ? 🙂

 

Thank you

Bill David
0 Kudos
Message 3 of 6
(2,801 Views)

Dear RENN

i understand that the byte of information could also be in HEX but if you just take a closer look at the consumer loop you gonna find that the programmer of this VI has used the division function where he divided by 255 which represents the decimal representation of a byte (8 bit) 2 to the power 8= 256 so he divides by 255 .

 

i am very confused with that  Smiley Sad

 

 

Thank you

Bill David
0 Kudos
Message 4 of 6
(2,796 Views)
Solution
Accepted by topic author Bildavid
0 Kudos
Message 5 of 6
(2,795 Views)
0 Kudos
Message 6 of 6
(2,774 Views)