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.
06-26-2017 04:32 AM
Hello everyone, I have designed a simulation loop and I want to display a message when I take my arrays last element. For example if we have 60 elements, after taking the element num.60 I want to show a message. I attach my try so you can see where I have a problem.
Please respond as fast as possible. It is urgent !
Thank you all
06-26-2017 04:48 AM - edited 06-26-2017 04:49 AM
Hi Loukask,
use an autoindexing FOR loop to index each element in your array. As the loop will automatically finish you can display a message after the loop has finished…
Other solution if you insist of using a while loop and IndexArray in the loop:
IF iteration count >= arraysize THEN display message
Please respond as fast as possible. It is urgent !
Keep in mind: It's maybe urgent for you, but not for us! Maybe you should learn better planning of your tasks?
I also recommend to take the basic LabVIEW lessons offered for free by NI. It will surely help you to create better LabVIEW VIs…
06-26-2017 05:16 AM
I don't know if you checked my file, but the problem is that the "array size" generates a 1D array output and when I make a comparison with iteration loop the boolean output can't be given as input to message (enabling). check screenshot.
06-26-2017 05:45 AM - edited 06-26-2017 05:47 AM
Hi Loukask,
I don't know if you checked my file,
Yes, I did!
the problem is that the "array size" generates a 1D array output
The problem is you seem to be unable to read the two elements from this 1D array.
Did you heard of the IndexArray function before? Did I mention the LabVIEW basics courses before?
(Other solution: use the MatrixSize function on your 2D array…)
Btw. is there a special reason to make your index counter a DBL? IndexArray expects I32 values for indices…
06-26-2017 07:48 AM - edited 06-26-2017 07:49 AM
06-26-2017 09:39 AM
You are only reading the first element of each row, so instead of working with a 2D array, slice out the first column (using index array) right after reading the file. Now you have a 1D array and the size is a scalar, not an array.