LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading 16 bytes, getting 5 as output? why?

In the begining of the program I read 16 bytes from VISA read function. Since I am reading hexadecimal string, so I need to convert it to unsigned byte array in order to be able to separate the data in 4 signals later.

However, after reading the 16 bytes and converting I just get 5 bytes as an output and not all the 16. why? 

PS: Because my connection with bluetooth is asynchronous I need to search for FFFF (2bytes) which are indicators of my four signals. 

 

Could you please check to see where is the problem?

Download All
0 Kudos
Message 1 of 5
(2,591 Views)

Why do you convert the VISA resource name instead of the read data?

LV 2011, Win7
Message 2 of 5
(2,586 Views)

what a clumsy mistake, yes you were right 🙂

But now I have another problem, it is reading the 16 bytes. but all the values in those 16 bytes are 0s. why?

0 Kudos
Message 3 of 5
(2,566 Views)

 

If you run this with Execution Highlighting turned on it should be immediately obvious. The loop will exit whether or not the data read is equal to FFFF. If no data is read then the output will be an empty string, hence the zeros.

 

MC

0 Kudos
Message 4 of 5
(2,559 Views)

I do highlight it and it even gives me zeros when it finds the FFFF and continues the program. 😕

0 Kudos
Message 5 of 5
(2,553 Views)