From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-27-2009 12:26 PM
04-27-2009 12:28 PM
04-27-2009 12:28 PM
04-27-2009 12:35 PM - edited 04-27-2009 12:38 PM
Is the target array size going to be a pre-determined constant or a variable controll? Either way, use the Array Size function to return the size of your ever-growing array, then use the Greater? function to output a boolean true when the array size exceeds the value defined by your controll/constant. Connect this boolean output to the Stop If True of the loop (assuming you're using a While Loop to keep adding elements to the array).
Sorry i've not given you a block diagram, but i don't have LabVIEW on this computer. I hope you can still understand what i'm trying to say.
04-28-2009 10:31 AM
04-28-2009 10:38 AM
04-28-2009 10:42 AM
You aren't adding any elements to your array. You are taking the last string value located in "Read Buffer" then converting that to a 2-D array a single time, nothing ever gets added. Since we don't know what data is in that string, we can't determine what the 2-D array looks like.
Then you start a new loop where you index out row 0 and take the number of elements in that. Apparently there is only 1 element since that is all you say you are getting. Then you will continuously run that loop forever because there is no way for it to get to 1024 elements to stop the loop. You are working on the same data array over and over again.
I am not sure you completely understand how data flows in a LabVIEW program. I would recommend you learn more about LabVIEW from here. How to Learn LV
04-28-2009 11:45 AM - edited 04-28-2009 11:46 AM
You are going to want to build an array of the data you are reading in from the buffer.
The 'read' function assumes everything is of 'string' type, so convert as neccessary.
Then use an 'array size' to check how large the populated array is.
In my example, I chose to use 100 as the maximum array size.
04-28-2009 11:50 AM