In this post, we will write a PLC code to store data of various processes sequentially. We will use structured text language for this.
Sequential Process Data Storage
Let us understand the case scenario first. There are two sensors in the system – temperature and pressure. And in total, there are five processes. Process start and stop are not in our control, we will just get the status of the process (whether it is running or stopped).
When the five processes start in sequence, we get a complete signal from each process when over. With this signal, we must store the current value of temperature and pressure in different registers. The values of these registers will be updated after the corresponding process is over every time.
Following are the PLC IO’s:
- Digital inputs – Process complete signal
- Analog inputs – Temperature transmitter, pressure transmitter.
Structured Text PLC Code
Let us see the logic now. Refer to the below image. It is a very simple logic where we use a case statement. We first use a sequence counter to see in which the current step is running.
We increment the counter on every input signal of the process completely received. The set value of the counter will be five, as per the five processes running.
We will reset the counter when the counter is done.
In the next step, we use a case statement. We use five cases. As the counter increments on receiving the process complete signal, this means the current counter value is the current step running. So, we use the case number from 0 to 4, where 0 means step 1 and 4 means step-5.
In each case, we use two different registers of temperature storage and pressure storage. For incrementing the case, we use the counter current value as a case reference. This will ensure that in each step, only the corresponding registers will be written.
In this way, we saw how to write a PLC program to store data of various processes sequentially.
Read Next:
- PLC Program for Sequential Motor Control
- Run Motors Sequentially using PLC Program
- Sequential PLC Program Pneumatic Valve
- PLC Program for Water Level Control Logic
- Compare Combinational & Sequential Circuit