December 25, 2024

#244 - Studying a PLC programme with the RSLogix Emulate500 emulator

In this post we will study the Simple Motor Control Building Block programme, downloaded from the Rockwell website and opened in RSLogix Micro Starter Lite and simulated with RSLogix Emulate500.
The CPU used in this example is from the MicroLogix family, model 1100. MicroLogix CPUs can be ideal for compact projects. Despite being competitively priced with CPUs from larger ranges such as CompactLogix, MicroLogix can be a great option from a software licence cost point of view. 
By opening the programme, configuring slot 2 for the emulator and clicking on Comms>System Comms you can go online in the emulator:
  • In the LAD2 routine, the other routines used in the programme are called with the JSR (Jump to sub-routine) function:
    • LAD100
    • LAD231
    • LAD232
    • LAD233
    • LAD234
  • The LAD100 routine checks: Operating mode, which in English is sometimes called HOA (Hands, Off, Auto) connected to a PLC digital input. BOOL data type.
    • Hands: Manual
    • Off: Off
    • Auto: Automatic
  • Status (Aux) contacts, physically wired from the Motor Starter and Motor Protection Circuit Breaker to the PLC's digital inputs and outputs. BOOL data type.
    • Motor Protection Circuit Braker (MPCB): 140M
    • Normally Open Contacts (N.O. Aux):
    • 13-14: Off/Tripped FALSE, On TRUE
    • 27-28: On/Off FALSE, Short-circuited/Overload TRUE
    • 77-78: On/Off FALSE, Short-circuited/Overload TRUE
  • Soft Starter: SMC-3
    • PLC digital input connected to a starter relay that indicates whether the speed has been reached: No FALSE, Yes TRUE
    • PLC digital input connected to a Starter relay that indicates if there are faults: No FALSE, Yes TRUE
    • PLC digital input connected to a starter relay that indicates if the motor is running: No FALSE, Yes TRUE
    • Digital output from the PLC that is used to drive the Soft Starter. A bit within the PLC logic switches this output on and after a logic check switches it off. We'll see how this logic is done in the LAD231 routine.
    • Example of the above states under operating conditions:
  • In the LAD231 routine, the logic is based on the input states from the LAD100 routine above:
    • The first two Rungs (0 and 1) check the conditions required to enable remote control of the HMI (Power button). In the programme comments, the HMI is called PV (PanelView), which is the name of Rockwell's HMI. 
    • The next three Rungs (2, 3, 4) check whether the motor has reached operating speed within the set time interval.
The example below shows a case where the T230:0/DN timer is activated and the status check results in no faults. In this case, bit B231:0/7 is activated to alert the system that even in fault-free conditions, the motor has not reached the expected speed within the set time interval.

The status check is done using the NEQ (Not Equal) instruction, i.e. different. The bit data can be seen in Data File 231:0 


In word B231:0 above, each TRUE bit indicates:
    0: MPCB is on
    6: Motor is switching on
    7: Motor has not been started, although the ON signal has been sent
    8: Motor Starter has been switched on
If the motor had reached speed within the time interval of timer T230:0 and the switch-on sequence had occurred correctly, the status would be:

In word B231:0 above, each TRUE bit indicates:
    0: MPCB is on
    3: Motor has reached the desired speed
    8: Motor Starter has been switched on
The next Rung (5) resets the bits in word B231:4 to zero when the operating mode changes from Auto to Manual or Off in order to force the outputs to zero.
Example in Auto:
Example in Manual or Off: All bits of B231:4 are written to zero.

In word B231:4 the following bits are written to zero:
    0: HMI Motor On signal
    1: HOA mode (TRUE: Auto, FALSE: Manual or Off)
    2: PLC digital output for Motor On (TRUE: On, FALSE: Off)
    3: Show On, Off buttons on HMI
    4: HMI Motor Off command
The last Rungs of this routine (6 to 10) are used to identify short circuit and overload faults. 
When the auxiliary contacts indicating a short or overload are activated, the MOV instructions are used to move INT values to the N229:0, N229:1 variables. When these same contacts are not activated, other INT values are written to the addresses mentioned above.
Then an addition is made with the ADD instruction, which writes the result to the INT N229:2 variable and an equality test is made with the EQU instruction. Depending on the result of this test, a bit will be activated or not. This bit will inform the HMI whether the motor is overloaded or short-circuited.
  • Comments:
    • This program is great in terms of documentation and comments, which help with program maintenance, debugging and will help colleagues who will be working on this program in the future.
    • A good programming practice, which is respected in this programme, is to use the PLC inputs at a single point in the programme. The logic associated with these inputs is managed with internal bit variables. This method also helps with maintenance and debugging. 

    • In this post we'll show you how to drive the first motor. In the programme there are three other motors that are driven, following a similar logic and structure. 
    • We've seen how simple it is to make a robust programme with a status check. In this case, the available information is electrically connected from the auxiliary contacts of the Starter and MPCB to the digital inputs of the PLC. 
    • Data from the PLC is used by the HMI to enable buttons, display status and send commands.

No comments:

Post a Comment