12-28-2023 09:03 AM
I made a state machine to cycle solenoids when activated. It works how I want with the exception of having to press the start button twice for follow-up cycles (not really a concern for me). I am posting to get any feedback or tips to improve future VIs that I make. I uploaded a 23Q1 and 18 file. Thanks in advance.
12-28-2023 09:20 AM
Hi Dfturner42,
Configure your buttons to have one of the "Latch" mechanical actions.
Typically the default action for monostable buttons is "Latch When Released":
The OK, Cancel and Stop buttons are configured like that by default.
The push buttons and switches on the other hand are more often used in "bistable" mode, so they are pre-configured with a "Switch" mechanical action, but this can be changed as you desire using the right-click menu.
Regards,
Raphaël.
12-28-2023 09:52 AM
A "memory trick" to remember which Boolean controls (by default) have "Latch until Released" mechanical actions (and are good for "Start" and "Stop" actions) is -- they are all rectangular (like a "Power On" button, or a "Abort" button. The other "switching" controls look like things you "switch" (a toggle) or have a "bistable" indicator (like a light which is either On or Off -- if it "blinked" momentarily because of a latching mechanism, you might not even see the (momentary) changed state.
Bob Schor
12-28-2023 10:20 AM - edited 12-28-2023 10:22 AM
@Dfturner42 wrote:
I am posting to get any feedback or tips to improve future VIs that I make.
A few more overall comments:
12-28-2023 11:22 AM
At this point, I would get rid of all the instrument IO and do a pure simulation until all the logic is worked out. Here's a very simple draft that is probably not operating correctly as needed (because I don't have all the requirements!!!), but should give you some ideas at simplifications. (It definitely need more stuff, e.g. decide what should happen to the count if start is pressed during a sequence or if that's even allowed. Make sure to reset all outputs when the program stops, etc. etc.)