12-07-2014 03:02 PM
I have thought from the start shift register was the way to go, but, the proposed solution provides a similar response to my previous attempts. See below.
Initial Run
Selection of Ch2
Selection of Ch3
Re-Select Ch1
Re-Select Ch2
12-07-2014 03:34 PM
Ok, so I found one mistake I made; insert into array vs replace element into array. Next step is to figure out why array is not initialized when .vi is first started and get the .vi to continually monitor the selected channel.
12-07-2014 03:36 PM - edited 12-07-2014 03:39 PM
What other events to you have? Your event structure tunnel shows it is set for "Use Default if Unwired". That means you have some unwired cases. If one of those other event cases runs, the default value of an empty array is put out of the tunnel.
Make sure you wire you array through all of your event cases.
Another problem is that you used Insert into Array, while Blokks snippet used Replace Array Subset.
Also, the way your are unbundling your cluster just looks wrong. But it is hard to say because you didn't post your VI, I can't see how you have that cluster set up. You want to see which of those buttons became true since the last time, and use that as the index to the Replace Array Subset.
12-07-2014 03:38 PM - edited 12-07-2014 03:40 PM
It is only the "Stop" case so didn't think it much matter becuase the array should be re-initialized when started again.
12-08-2014 02:30 AM
RavensFan explained why you see what you see. Try to use the replace array subset, and post your VI. Otherwise it is difficult to help.
12-08-2014 10:11 AM
Thanks for the response Blokk, please see previous posts. There is nothing new to post; screenshots of .vi is posted in previous posts. I did find an issue with it when I originally posted it. I had been using the "Insert into Array" when I should have been using the "Replace Array".
What I am trying to work out now is how to continually monitor the channel selected and still be able to change channels.
12-08-2014 10:26 AM
@jeb3078 wrote:
Thanks for the response Blokk, please see previous posts. There is nothing new to post; screenshots of .vi is posted in previous posts. I did find an issue with it when I originally posted it. I had been using the "Insert into Array" when I should have been using the "Replace Array".
What I am trying to work out now is how to continually monitor the channel selected and still be able to change channels.
Set a timeout case for your event loop. Set an appropriate timeout value. Use an additional shift register where you store the info about which is the current selected channel. And put a data read into this timeout case of your Event structure.
Try to make your VI, if you get difficulties, please post your VI (not screenshot) so we can help you faster.
Regards,