LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait on Front Panel Activity crashes labview?

Solved!
Go to solution

A couple of other quick suggestions. First, you don't need the stop local variable in your event structure. You have an event for the stop button. Just wire a False value in all other cases (or use default values) and it will still work perfectly. Probably not a big problem here, but often there is a need to perform specific actions on shutdown. 

 

Next, why do you convert to I32 between your constant and the timeout on the event structure? If your constant is not I32 then just right click on it and choose I32 as the representation.

0 Kudos
Message 51 of 53
(304 Views)

hey john.

The I32 conversion is a relic from when i was using 'Wait on FP', which takes it's timeout as an I32 rather than U32; you're right I can remove it.

Including the stops in all the cases is also probably redundant but I'd like the loop to terminate whenever Stop is true, so why not check it in any case. It'll probably be false in all events other than the stop Event structure case, but there's no real drawback to checking just in case.

0 Kudos
Message 52 of 53
(290 Views)

The I32 conversion is a relic from when i was using 'Wait on FP', which takes it's timeout as an I32 rather than U32; you're right I can remove it.


You shouldn't need the conversion in either case - just make the constant into what you want. The conversion is used when you have, for instance, and output from a function that is a U32 that needs to go to an input to another function that is an I32. 

 


Including the stops in all the cases is also probably redundant but I'd like the loop to terminate whenever Stop is true, so why not check it in any case. It'll probably be false in all events other than the stop Event structure case, but there's no real drawback to checking just in case.


It just adds a bit of unnecessary overhead, and could lead to bad practice when you want to have a controlled shutdown in future projects. 

 

I rarely even use a stop button, preferring to use the Panel Close? event.

 

Hopefully the rest of your code looks as good as the bits that you've shown. 🙂

0 Kudos
Message 53 of 53
(282 Views)