取消
显示结果 
搜索替代 
您的意思是: 

byte reading from serial

已解决!
转到解答

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 难过表情

 

any suggestions would be appreciated.

 

Thank you 

Bill David
下载全部
0 项奖励
1 条消息(共 6 条)
3,215 次查看

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 项奖励
2 条消息(共 6 条)
3,205 次查看

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 项奖励
3 条消息(共 6 条)
3,187 次查看

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  难过表情

 

 

Thank you

Bill David
0 项奖励
4 条消息(共 6 条)
3,182 次查看
解答
已被主题作者 Bildavid 接受
0 项奖励
5 条消息(共 6 条)
3,181 次查看
0 项奖励
6 条消息(共 6 条)
3,160 次查看