02-18-2013 04:44 AM
Suppose each time from the serial port 25 byte you read then use one string to byte array & thats it.
It has to work.
02-18-2013 04:44 AM
Sorry, take it
02-18-2013 04:47 AM
>>Suppose each time from the serial port 25 byte you read then use one string to byte array & thats it.
No, there are many other information in com port input. I'm take two bytes from port, make word and only after this i can work with it
02-18-2013 04:53 AM - edited 02-18-2013 04:54 AM
Then whats a problem, Read required byte using array subset as you already doing. What more you are looking for ?
02-18-2013 04:55 AM
Can you give me example, please?
02-18-2013 04:57 AM
Tell me first ?
If the serial data is 25 bytes what operation you want to perform on that, I will post the example but first let me know the requirement ?
02-18-2013 05:06 AM
Ok.
I have info from gyros and accelerometers position sended in blocks by UART. 1st byte - LSB axis X, 2nd byte - MSB axis X, 3rd byte - LSB axis Y and so on.
All of this data will be processed in many different ways.
In my question i only want to now, how can i make array from periodic scalar data. All of the examples use random numbers generator INSIDE for loop, but i can't. My data comes from outside. When i connect it directly to "for loop" my array fills with same elements. For example, i have "254" on input of the for loop, and take 1D array with size of forloop count and all elements are "254". That is my problem )
Thank you
02-18-2013 05:16 AM
How are you reading data i.e. in each serial read how many bytes you are receving. If you are reading multiple times then you need to read inside for loop only ? Which data you want to make array
Let me know this.
02-18-2013 05:18 AM
See my last post in which i attached VI. Instead of random number you can use your serial read VISA function.
02-18-2013 05:22 AM
Now, with only one gyro, in each while loop i'm receive 6 bytes. 2 bytes - X, 2 bytes - Y, 2 bytes - Z.
I want to work with only one axis - X. I do not want to use PtbyPt filters, so i must have 1d array of U16 for filtering. Because this is experimental project, i want to manually adjust array size. Only thing that i need is make 1D array from scalar data.