Making a counter that monitors input in the background of a MachineLogic app and preforms an action
This is presented solely as information. Use it at your own risk.
The visual references in this discussion are screenshots from Machine Logic (as of 8/28/20) inside the online environment of 3D Machine Builder and may display options that are not available or are named differently then what your current firmware / controller version has. This is reference to how a counter was made and not specifically a step by step guide as to how a counter should be made. A version of the counter has been run and proven on a Machine Motion controller version 1E running firmware V1.14 (hotfix) I can not attest to its viability on any other combination of hardware or software.
Go out and build cool shit!
The goal of this was to:
1- Monitor an input, parallel to the main operation
2- Count the amount of times the input was triggered to a set number
3- Once the set number was reached preform an operation to indicate to the operator that the correct number of cycles has been reached.
Create three child sequences:
1- "Count – Values": Allows the setup of times you want to count and the times to preform the output
2- "Count – Monitor": Sets what and how you want to look at to be counted
3- "Count - Complete - Action": Sets what you want to do to indicate that the count has reached its set point.
In the sequence "Count – Values".
1- Add two loops.
2- #1 will be your input counter. Set your desired # of counts. For "Do" select "Count - Monitor"
3- #2 set the # of times the operator indicator will happen. For "Do" select "Count - Complete - Action"
In the sequence " Count - Monitor ".
1- Add a wait instruction and select the input you would like to look for.
In the sequence "Count - Complete - Action" you are creating the operator indicator. For this example an on-wait-off sequence was created. For example this could be used to flash a tower light but could be any other operation you can program.
1- Add an output, select the one the want to use and its state
2- Add a wait and set
3- Add an output, select the same one and change the state back
In the main sequence
1- Add an execution, set it to parallel. Select "Count - Values" for the sequence