08-04-2023 07:24 AM
Hello,
I I'm currently modifying the software.
What you have suggested is an excellent idea. Why we put so much event functions is a good question. One is enough.
Could you share an example of an event structure with a shift register as said Bob_Schor. It could help me a lot
Best regards
08-04-2023 09:59 PM
Well, maybe Bob Schor could post an example. I'm designing a stimulus pattern that generates a train of current pulses of a certain width and a certain Frequency. Each is controlled by a different Front Panel control, so for any test, we might change each of these parameters, or maybe none, or one, of them. As any of them are changed, the new value is used to update that component of the Cluster (called "Stimulus Parameters", see the Icon made for the cluster's TypeDef). As altering any of these four parameters also changes the Energy in the Stimulus Train, I do a computation as I alter the Cluster and save it on the Front Panel for reference.
So how to I use this Cluster? There's another button on the Front Panel, called "Enable", that means "Enable the Pulse Train", or "Send the Cluster to the State Machine" (which I'm running using a Channel Message Handler). Shown below is the Event generated when I push "Enable" -- it takes the data saved in the Stimulus Parameters Cluster (which might or might not have been changed since the last time Enable was pressed) and sends it to two Message Handler States called "Prepare Stim". [Why two? This is a LabVIEW Real-Time Project, with both Host and RT Target running CMH-based code, each having a state called "Prepare Stim" that want a copy of the Stimulus Parameters.
And there you have it. Event Loops to handle Front Panel Events (which happen "momentarily" and generally involve changing a Control and maybe sending a Message somewhere) and While Loops around Case Statements acting as Message Handler Loops which can be used as a State Machine (not illustrated here -- use your imagination).
Bob Schor