LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shift Registers and Boolean ctrls

Attached are 2 images of sub.vis buried deep within a program I am making - the goal was to make a giant "turn everything off" button that would work at any time during the main program's excecution.

 

The program shown in attachment "Block 2" is one section of what is basically the 'heartbeat' of my program, and it is called in the .vi shown in "Block 1" with the label "1 second read, hereby renamed to 2 second read".

 

The main program calls the front panel of the 2 second read program, so that the boolean button "Emergency Stop" (shown on "Block 2") can be pressed at any time.

 

When the 'Emergency Stop' is false, the case structure doesn't execute and the program continues on its merry way.  If 'Emergency Stop' is true, the case structure shown in "Block 2" should execute, shut off the power to my signal generators, and send itself into an infinite loop until someone tells it to stop.

 

The mechanical action is set to "switch when pressed" so it should not reset once the state is read, however, for some reason the state of the button just resets after pressing it (usually with a 1-2 second delay), the case structure to turn everything off is never executed, and the program just keeps on running.

 

I have tried both with and without the shift registers shown in "Block 1".

 

The only thing left I can see that I haven't tried is to move the button itself up a level so that it is the front panel of "Block 1" that is called, rather than "Block 2", that I use for the button.

 

Any advice would be greatly appreciated.  If something isn't clear, let me know and I will be happy to try and elaborate.

 

 

 

0 Kudos
Message 1 of 30
(3,456 Views)

Opps, here are the images.

Download All
0 Kudos
Message 2 of 30
(3,449 Views)

Hi Lars,

 

do you have that "Emergency" button connected to the connector pane? So it receives the "false" value from the shift register in "block 1" and get's reset each time the subVI is called? Controls connected to connector pane receive their values from the calling VI!

 

THINK DATAFLOW 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 30
(3,448 Views)

Hi Lars,

 

You didn't attach the images.

 

Edit - Got in too late, they are there now!

 

Regards,

 

Jeff Peacock 

 

Product Support Engineer | LabVIEW R&D | National Instruments 

Message 4 of 30
(3,444 Views)

Sorry about that, you should see them now!

0 Kudos
Message 5 of 30
(3,444 Views)

Hi Lars,

 

see edited message above!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 30
(3,429 Views)

"Emergency" button connected to the connector pane? So it receives the false value from the shift register in "block 1" and get's reset each time the subVI is called?"

 

In have tried the exact same setup, except I deleted the shift registers (and the false boolean constant) entirely, to no avail.

0 Kudos
Message 7 of 30
(3,426 Views)

However, the default value of the button itself is "false", so maybe it is resetting itself every time it is called even without the shift registers...

0 Kudos
Message 8 of 30
(3,421 Views)

Hi Lars,

 

did you set any default values for that button? It is set to default when the subVI is called...

 

AAhh, you already got that on your own! 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 30
(3,418 Views)

Lol, yeah I think that is my problem.

 

Not shown in block 2, there are (2) 1-second wait timers in there, maybe if I put the stop function after the wait timers, instead of before, it will give me time to press the button while the program is already called, so it won't just reset on me?  For future programs though, I would like to not have to rely on a delay like that... so another solution would be useful.

0 Kudos
Message 10 of 30
(3,410 Views)