State machines can go from any state to the other. Either in Murmex you send a Message to yourself to go from one state to the next. How to go to user-defined states, we will see in a tutorial later. For now, let us imagine we either receive from another component, either from ourself the StartMessage. This message calls the Start method. In here we want to start doing something. And perhaps we want to continue doing that, but check if we are done. And later we want to stop the component. In this tutorial we will discuss the methods Start, Proceed and Stop.

When a component is added to the configuration as observer, it can receive the start and stop message.

  1. In the Configure method, click on Configure Murmex. Configure Murmex
  2. Add a new observer. This observer can receive data (see other tutorials) and start and stop messages. The boolean flag “wait until done?” means it waits for a Proceed message from the observer before it is ready itself. Add observer
  3. Add to the main the accessor “Relay start/stop to observers?”. By setting this to TRUE your components receive both messages and when FALSE the observers won’t receive the message. Relay start and stop messages
Start
  1. If not existing in your project, add the virtual folder “action methods”.
  2. Add to the action methods folder the method Start. Use the Right-mouse click menu >> New >> VI for Override…
  3. In the Start method you might want to reset some parameters, like a counter, open a file to read from/write to, start a device etc. Start method
Stop
  1. Add to the action methods folder the method Stop. Use the Right-mouse click menu >> New >> VI for Override…
  2. In the Stop method you might want to stop a device, close a reference, write the last data to a file etc. Stop method
  3. More Murmex tools are available. For example you can find out if it has started. Stop method with is started
Proceed
  1. When you add a component as observer to the configuration of your component, this means it can receive data and it will receive the start and stop triggers. Also you can set the checkmark to wait for the component. This means that the component sends a Proceed trigger to the observee back once this component and its observers are ready, making thus a whole cascade. First send a Proceed message to yourself in the Start method. Proceed message after start method
  2. Add to the action methods folder the method Proceed. Use the Right-mouse click menu >> New >> VI for Override…
  3. Check if your component is ready in the Proceed method. Proceed method
  4. You can also do polling with a while loop and thus keep checking if a parameters gives a TRUE value as output. Also you can keep sending a Proceed message to itself, creating a while loop that can be stopped. You better also check if the program has already stopped. Proceed method polling for readiness