06-30-2016 03:56 PM
I'm trying to process some serial port incoming string data, for example, <time stamp><tab><sensor1><:><data1><tab><sensor2><:><data2>...<sensor n><data n><CR>, however, each time the sequence of sensor might be random.
it could be <time stamp><tab><sensor N><:><data N><tab>...<sensor random><data random><CR>
I want to generate a data array with a regular sensor sequence number. Something like,
time stamp | sensor1 | sensor2 | ... | sensor N |
time1 | data 1 | data2 | ... | data N |
so far, I parse the whole protocol into small pieces of strings, now how can I assemble them back into an array with the regular sequence I defined?
Thanks!
06-30-2016 06:39 PM
If you know how many sensors, use Initialize Array to make an array of 0s. Then when you parse your strings, you figure out the sensor index and use Replace Array Subset to update that sensor's data. Do this in a FOR loop.
07-01-2016 02:56 AM
First Frame the header (in the order as expected) and find the Number of sensors
Then find the values of appropriate header by string searching options and append them in the Column of corresponding Header
if possible share the code for Proper Solutions