Activity Programs are a diagrammatic approach to programming, this is very similar to creating logic diagrams.
Start Block: This is the entry point for the program.
Decision Block: This is a branch function and operates similar to a if/else statements. If the expression evaluates true then branch to the true connector else branch to the false connector.
Multi-Decision Block: This is similar to a case statement, each condition is evaluated and program flow will branch to the first one to evaluate true.
Fire Action Block: When the program flow enters this block the listed actions will be fired.
Set Variable Block: When the program flow enters this block the variables listed will be set to the values in the expression.
Activity Block: If the program flow becomes too complicated a section can be moved to its own activity program much like you would treat a subroutine.
Internal Message: This is simplified method of generating a internal DM1 message, when this block is loaded with data a message is passed to the DM1 app that a new fault is available for handling. If using the DM1 message handler found in the templates this message will appear as a pop-up fault message.
Add List Item: This is a convenient way to add items to a existing custom list without having to use scripting.
Stop Block: All program branches must terminate in the stop block.
The following Activity Program example is a continuation of our engine temperature control system. We have previously demonstrated how to implement this same logic using State Machines and Scripting this example shows how to perform the same functions using and Activity Program.
In this video we will show how to use a Activity Program to monitor an engines coolant temperature and determine if it is too cold or too hot and either turn on a heater or fan cooling. There are three states the engine can exist in, nominal, under temp, and over temp. The activity program uses a multi decision block to determine which state it is in then branch to control the fan and heater.
Comments
0 comments
Please sign in to leave a comment.