08-22-2011 12:24 PM
Are the numbers of your controls significant? I see that you have 1234569 and 10.
Is this a vi that you want to execute once and leave and then execute again and leave?
08-22-2011 01:33 PM
Hey Tim,
What you did wiorks for sites #1 &2 the behaviour is the same for 3&4, 5-10 are one for one, so
if 1=on then 1&2 turn on
if 2=on then 1&2 turn on
if 1=off both 1&2 are off
if 2=off both 1&2 are off
exact same for 3&4
if 5=on then 5 on
if 5=off then 5 off
same for rest
Hopefully this helps you know what I am trying to do.
Thanks,
John
08-22-2011 01:42 PM
I just saw this post, yes the numbers are just labels for the reactor sites, note 8 is not used so there are six controls (note they are not indicators buttons on the reactor.
Regards,
John
08-22-2011 02:19 PM
@JTShaw wrote:
if 1=on then 1&2 turn on
if 2=on then 1&2 turn on
if 1=off both 1&2 are off
if 2=off both 1&2 are off
That is still not clear. Suppose 1=on and 2=off, then what do you want 1 and 2 to be?
Or 2=on and 1=off, then what?
You need to make a truth table for how you want the buttons to interact.
08-22-2011 02:32 PM
If you take the subvi that I created you should be able to do what you want to. I added an example of how to use it with the main vi.
08-22-2011 02:37 PM
Sorry that's my problem is coming up with a good truth table for when both are already ON. Your last program works perfect, I just need it to do the same for sites 3&4. The rest of them are by themselves, ie 5=on it goes on, 5 goes off it goes off.... My original delemia is when they are both on how to turn them both off when either button is pressed, your program accomplishes this. I have never used the Event structure so I need to read up on the old val/new val stuff.
Hopefully this helps you?
Thanks,
John
08-22-2011 02:42 PM
My last should be what you are looking for.
08-22-2011 08:01 PM
Hey Tim,
I tried your main with the subvi and it almost works but does funny things. Sometimes a button has to be pressed twice for anything to happen (only buttons 1,2,3,4 the rest seems to work fine. Sometimes only one of the lights goes off see attached. This happened when 3 was turned off, 4 indicator should have also went off. i will try to sort out. I have attached one of your earlier ones but it does not maintain different states and I am not sure why. Say 1 and 2 are on, when any others are pressed 1 and 2 go off. looks like when it goes to another state it turns off ones that were on??
Thanks again for your time,
John
08-22-2011 08:23 PM
Sorry try this one as I changed the top register to a tunnel. Try this one.
08-23-2011 06:34 AM
It looks like you got it working. Do you have any other questions?