01-09-2019 08:10 AM
I am trying to build an array in a case structure that's nested in a while loop to enable shift registers. The false condition of the case selector reads from a configuration file and makes 1. a displayed array of NAMES 2. a display array of DESCRIPTIONS 3. an array of min values and 4. an array of max values.
These min and max values will be passed onto the next case and checked with the voltages the user inputs in set voltages. After the voltages are checked in range I would like an array to be made so that I can send it off to an NI Voltage Out DAQ.
The problem is on the indicator for the array of in range voltages, it appears flickering constantly once I click the OK button to check the values. I cannot find a way to move it out of the loops and get it to just give me a made array without constantly updating and flickering the values.
Please help!!!!
01-09-2019 08:47 AM
If you attach the text file as well, we'd be able to run your code to see it in action.
A few things I noticed:
01-09-2019 08:54 AM
Here is the text configuration file. I also attached an updated version. It seems when I make the array a shift register I can pull it all the way out of the while loop and it will display without the constant flickering updating from the loop. However, I am not sure if this will be a solution as a whole because I want to add more cases. As a whole I am making a test setup that uses both the NI Voltage IN and Out DAQs. I am not sure whether I can break these down into different files but have them all on one VI. Any other ideas or suggestions for making a big test setup?
01-09-2019 09:11 AM - edited 01-09-2019 09:16 AM
First take care of the 3 things I told you about in my previous post.
I think the flicker is being caused because of the Transpose Arrays you have in there that are constantly taking it from a 1 x 16 array to a 16 x 1 array and back again every other iteration of the while loop. That along with the array manipulation in the inner For Loop where you index on 1 dimension of the 2D array and then take that back to a 2D array. When you auto-index on a 1 x 16 array and a 16 x 1 array in the same For Loop, you'll wind up with a 1 x 1 array. In the next iteration when you change the one back to a 1 x 16, you now auto-index on two 1 x 16 arrays, you can now get a 1 x 16 array again. You flicker between a full array and a nearly empty single element array.
When you move the indicator out of the loop, you don't see the "flicker", but it is still happening. But depending on exactly when you hit the stop button, your final result will either be 1 x 16 or a 1 x 1 array in that indicator.
01-09-2019 10:45 AM
I took a look the the probe at before and after the MAX array. It seems like data comes out of the for loop in the false case value as an array, but I am putting this array into a Build Array Block, thus making it 2d. I am going to try to keep everything one dimensional and see what that does.
01-09-2019 11:05 AM
I also took away the for loop that does the In Range and Coerce checking. With this the array is not constantly looping and the flickering stopped.
01-09-2019 12:47 PM
That's good to hear.
You still need to fix two of the other issues I brought up like the missing wait function and the mechanical action of the button should be Latched when Released and not Switch when Pressed.