Siemens S7-1200PLC realizes data stack processing function

When using Siemens S7-1200 PLC, I found that there is no built-in stack function block, and the data first-in-first-out-last-out function cannot be realized. So I developed an FB block in SCL language to realize this function. Contact me if you need source code, add qq584472557.

1. The inside of the block is as shown in the figure below. First define the variables

2. The specific SCL language is shown in the figure below

3. The call result of the actual project block is shown in the figure below

4. The block push pin receives a rising delay signal and transfers the push value to the top of the stack, and the pop pin receives a rising delay signal to delete the data at the bottom of the stack. At the same time, it can display the data in the stack. The amount of data, the stack can also be cleared.

 

 

Guess you like

Origin blog.csdn.net/u014780302/article/details/100099124