02-24-2022 08:47 AM
I tried replacing the buttons with DAQ assistant ( and configured my DAQ device with 5 buttons) but when I wire the Data output of the DAQ assistant to the cluster to array function, I get errors.
02-24-2022 08:50 AM
nevermind, I figured that part out,
Sorry
02-24-2022 10:24 AM
Since you mentioned that there will be several more queues, each with different sizes and expiration, the next step would be to make it scalable. I suggest a reentrant subvi that internally maintains the timing and size enforcement, with in-/outputs for array 1&2, inputs for size, and ttl, and an output for array 2. You could even make it type agnostic by turning it into a vim.
02-24-2022 11:43 AM
I tried to add to this VI ( i attached my modified code). I added to my code so that the elements go from queue 3 to queue 4 and then queue 4 can only hold 4 elements. And till this point it worked fine, but then i tried to add code to keep the elements in queue 4 for a specific amount of time then move to queue 5, but then when i tried to run it, the elements were not moving to the 5th queue after the time has passed.
02-24-2022 12:24 PM
Never ever attach a modified (by you!) VI that has the same name as what I attached earlier! you need to give a new unique name to avoid confusion!
Obviously, each array with limited size/ttl needs it's own shift register for timing. You cannot put it all in one pot! Right?
02-24-2022 12:40 PM
sorry about that,
I did add a shift register for the 4th array, and before I added the code to keep the elements for a specific amount of time then move them to the 5th queue, everything seemed to work fine (id only get 4 elements in the 4th queue and if there's more they wait in the 3rd queue), so I don't understand what's wrong with my code now.
02-24-2022 12:45 PM - edited 02-24-2022 12:46 PM
Well, if you made corrections and everything works fine why do you say something is wrong??? Sounds contradictory!
Please attach your latest version (with a unique file name!). I would be happy to look it over. Explain exactly how you use it, what you expect to see, and what you see instead.
02-24-2022 07:34 PM
Ok so what i need it to do is after it goes to queue 3 the elements move directly to queue 4, But queue 4 can only take a max of 4 elements at once, and each element should stay in queue 4 for a random time then move to queue 5.
I tried to code this, and the elements do move to queue 4 and it only takes a max of 4 elements, but after the time runs out, instead of moving to queue 5, the elements stay in queue 4 and the values in the cluster change to 0. So what did i do wrong, that prevents the elements from going from queue 4 to queue 5.
02-24-2022 07:43 PM
As I said, each time limited array needs its own orange array in its own shift register.
It is a glaring error to only have one array of ticks snaking through all the various case structures. I don't think you fully understand my code yet.
02-25-2022 09:24 AM
I tried adding a shift register and an initialize array for queue 4, and now it does take only a max of 4 elements and the elements dont go to zero, once the timer finishes, but the elements still dont go to queue 5, So can i just get help with why arent the elements moving to the 5th queue