07-01-2015 12:04 PM
Hi everyone. I am new and I have been inable to grasp the concept of the event structure and subvi's. I'm trying to click a button on a mainvi, test monitor.vi, that in turns changes the value of a button on the subvi, daenetip4.vi. The cluster of buttons seems to be setting those just fine, I just cannot get the play button to change the setdo button on the subvi. Any help would be greatly appriceated.
Jon
07-01-2015 12:42 PM
Hello Jon, if I understand the code you want controlling relays, maybe a best architecture would be a Producer Consumer where you send dato to the consumer when you change the Front Panel and the event structure detects an event.
If you explain more about your program people in the forum can help you more.
07-01-2015 01:50 PM
Yes, I am trying to control a relay card that has a Labview driver already written and working. I am trying to create a new front panel that would control this subvi, working Labview driver. I want to control the relays in a sequence for a certain amount of time and have the ability to stop that sequence and manually control the relays. I am really just getting started on this and want to make sure I can control the relays before I create a whole routine. The subvi, Labview driver for the relay card, works perfectly fine on its own, I just cannot set the SetDo button form the mainvi I started. Does this help?
07-01-2015 03:23 PM
Hi Jon, ok, I think a good way to achieve your purpose is with a State Machine boult inside the Timeout of the event structure.
Your state machine would be in the Timeout Case, with a shift register you can change the time for the timeout event, put -1 if you want to stop the Timeout and another value in milliseconds to run continuously the state machine.
With the Sub VIs of the driver you can manage the relays put the Open session in a Startup state, the close session in the Cleanup state, etc.
I attached a VI with the things I said, I hope this help you.