02-01-2011 06:07 AM
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?
02-01-2011 06:14 AM
Why do you convert the VISA resource name instead of the read data?
02-01-2011 07:10 AM
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?
02-01-2011 07:30 AM
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
02-01-2011 07:38 AM
I do highlight it and it even gives me zeros when it finds the FFFF and continues the program. 😕