06-26-2024 03:34 AM
Ok, thanks.
I will share an update.
Kind regards
Hasham
06-28-2024 12:38 AM
Hi,
Sorry to bother you again, but thanks to your guidance, the LV code is now saving data. However, it is saving all the data in one long column. I am receiving points from four channels and running 10 iterations, so the data should be organized into 4 columns (one for each input channel) and 10 rows (one for each iteration). Currently, it is saving everything in a single column.
Kind regards
Hasham
06-28-2024 03:13 AM
Hi Hasham,
@Hasham622x wrote:
However, it is saving all the data in one long column. I am receiving points from four channels and running 10 iterations, so the data should be organized into 4 columns (one for each input channel) and 10 rows (one for each iteration). Currently, it is saving everything in a single column
That's what you programmed to do!
You save the data as 1D array and you append to existing data in the CSV file.
When you need a 2D array of data in the end then you should write 2D data to your file!
06-28-2024 04:30 AM
Thanks for your reply and if you don't mind, please correct me. To convert data from 1D to 2D, I should connect sub VI "array to dynamic data" and then again dynamic data to a 2D array.
Kind regards
Hasham
06-28-2024 04:45 AM
Hi Hasham,
@Hasham622x wrote:
To convert data from 1D to 2D, I should connect sub VI "array to dynamic data" and then again dynamic data to a 2D array.
Why do you think you need two ExpressVIs and a DDT wire to build an array?
What about using simple functions like BuildArray???
06-29-2024 04:54 AM
Hi,
Thanks for your reply and I tried this first convert the 1D array to dynamic and then dynamic to 2D array, and then build the array. This is saving data in array form (.csv file), and I will also share the update that you suggested to me.
and if I want to save it in binary data format, then which VI I should choose? Could you please guide me.
Kind regards
Hasham
06-29-2024 03:58 PM
Hi Hasham,
you don't need two Express is and that huge IndexArray at all!
All you need is one Build array with just one input to create a 2D array from an 1D array...
For binary files you can use the WriteBinaryFile function, but you better clarify the expected file format before going this way!
06-30-2024 06:52 AM
Hi,
Thanks for your suggestion, I will share update asap.
Kind regards
Hasham
06-30-2024 10:37 PM
Hi,
I am sorry to disturb you as I prepared code in which I got stuck in showing the average values of individual channels on display. Please guide me in this situation.
Kind regards
Hasham
06-30-2024 11:32 PM
Only looking at your image, this needs some work. That constant dance to dynamic data and back is just not right. Your array operations are just silly and make no sense.
First let's get rid of all that extremely convoluted code!
How does the received string look like? Is there a termination character? What kind of "average" do you want? (Average of all points? Average of the last N points? Etc.)