PLC state machine programming Article 5-state machine automatic generation PLC program, plc Article 5
This article is relatively simple, so I am just getting started, and there is not much nonsense.
1. When selecting the solver, You must select a fixed step.
2. Right-click the Chart state machine and the menu on the Chart appears.
3. Select the red check box on the left, select the menu on the right, and click Generate Code. This button is overwritten by the menu.
4. The optimize. scl file will appear in the red directory.
5. Double-click [add external file] In the TIA Portal. See the figure. In the displayed dialog box, select the file above.
6. Right-click the optimize. scl file you just added and select [generate block from source 〕
7. Select the generated Chart block and drag it to the program segment.
The program generated here has an additional pin (ssMethodType), which is used for initialization. It is set to 0 first to complete initialization, and then set to 1. Then it can be used normally.
How about it, isn't it very simple, from Matlab experts to PLC control experts. Next we will discuss stateflow program optimization and How to Make Matlab generate the optimal program.