06-28-2014 09:04 PM
Hi, When i use VISA to read more than 1 byte data, only the first array got data, but i want to separate the 40 bits data into 5 arrays. Is anybody knows how to separate the data into arrays? Thank you for the reply!!!!
Solved! Go to Solution.
06-29-2014 12:42 PM
What is the format of the data? I'm guessing it is NOT sending out ASCII data. It is sending raw bytes.
So you want 40 bits. That is 5 bytes. So first, let's remove the Bytes At Port. Instead, wire a 5 to the number of bytes to read. Also make sure the termination character is turned off (it is a boolean input on the top of the Configure Serial Port). You will now read 5 bytes at a time. Now use the String To Byte Array to make an array of U8. Use a Number To Byte Array inside of a FOR loop to turn your array of bytes into a 2D Array of Booleans. You can use Index Array to separate your rows from there.
06-29-2014 10:33 PM
Thank you for your advice. But now the the problem is the data in 5 arrays are not the data we want. the data in read buffer is 2 , 4, 8, 16,32. But when we run the program the 5 arrays are not 2,4,8,16,32. Could you please give me some advice about that? Thank you so much!
06-30-2014 07:06 AM - edited 06-30-2014 07:06 AM
Your problem is the attempt to convert from ASCII. As I said before, you have raw binary data. So do not touch anything that deals with ASCII. All you need to do is take your byte array and convert each element to a Boolean Array.