29 Temmuz 2025 Salı

Programming Logic Controllers (SPS)

 

Variables for Lab 1,2 and 3



 


 


 

 

 

 






 

LAB1

 





Configuration PLC

I utilized a PLC setup with 140 CPU 434 12A/U 03.20 to complete the aforementioned method. Figure 1 displays the arrangement.

Since I have two outputs and four inputs in my simulation, DDM390 00 fits my demands. The fact that these inputs are digital is crucial to understand. Additionally, I used CPS 211 00 as the power source.



Figure1: Configuration PLC

 

Inventory of Function Blocks and Used Variables, Together with Their Types

 

The variables that are used are listed in Figure 1.2. BOOLEAN type variables are all that I used in the application. EBOOLEAN-type program sections are used.

 

 

Algorithm

Initialization:

 

Set initial conditions, reset any memory bits.

Define variables for inputs (START button, STOP button, EMERGENCY button, FUSE) and outputs (Alarm, Contactor).


Figure2: PLC components

Main Program:

 

Step 1 (Alarm):

 

If the START button is pressed and the EMERGENCY button is not pressed:

Turn ON the Alarm output.

Set a timer for 10 seconds.

If the timer is done (10 seconds passed):

Turn OFF the Alarm output.

Move to the next step.

 

 

Step 2 (Delay):

 

If the START button is still pressed and the EMERGENCY button is not pressed:

Set a timer for the desired delay (if any).

If the timer is done:

Move to the next step.

Step 3 (Contactor/Motor Start):

 

If the START button is still pressed and the EMERGENCY button is not pressed:

Turn ON the Contactor/Motor output.

 

Step 4 (STOP Button):

 

If the STOP button is pressed:

Turn OFF the Contactor/Motor output.

 

Step 5 (EMERGENCY Button):

 

If the EMERGENCY button is pressed:

Turn OFF the Alarm output.

Turn OFF the Contactor/Motor output.

Reset all timers.

Go back to Step 1.

 

Step 6 (FUSE):

If the FUSE input is active (similar to EMERGENCY):

Turn OFF the Alarm output.

Turn OFF the Contactor/Motor output.

Reset all timers.

Go back to Step 1.

LAB1 LD

 

 



 

 


 

 

 

 LAB1 FBD

 



  

 

 

LAB1 ST                                                                          LAB1 IL

 


 


 

LAB2









Configuration PLC

I have two digital inputs and one output in this software. I thus utilized the PLC configuration 140 CPU 434 12A/U 03.20. The power and input/output combinations are chosen in accordance with Figure 3.



Figure3: Configuration PLC


Algorithm



Figure4: PLC Components

1. Understand the Motor Direction:

Imagine there are two special buttons called "x0" and "x1" that tell us about the motor direction. We want to check if both x0 and x1 are OFF (LOW) or both are ON (HIGH). I created two special signs, "DoubleDark" and "DoubleLight to remember these conditions.

2. Detect Motor Direction:

If both x0 and x1 are OFF (LOW), set " DoubleDark " to remember it's one way.

If both x0 and x1 are ON (HIGH), set " DoubleLight " to remember it's the other way.

The next time we check, we will know the motor's direction based on the remembered conditions.

3. Show Motor Direction with Lamp:

Imagine there's a lamp that shows if the motor is turning right or left.

If " DoubleDark " is remembered (meaning the motor is turning right), make the lamp blink.

If " DoubleLight " is remembered (meaning the motor is turning left), keep the lamp constantly ON.

Putting it Together:

Check x0 and x1 to see their values.

If both are OFF, set "DoubleDark." If both are ON, set " DoubleLight "

If " DoubleDark " is set, make the lamp blink (motor turning right). If " DoubleLight " is set, keep the lamp ON (motor turning left).

Repeat:

Keep checking x0 and x1 to see if the motor's direction changes.

If it changes, update " DoubleDark " or " DoubleLight " accordingly.

Adjust the lamp based on the updated condition.

LAB2 LD

 


 

LAB2 FBD

 

LAB2 ST 





LAB2 IL

 


 

LAB3




140 CPU 434 12A/U 03.20 is what I chose. I have two digital inputs (J1, J2) and one output (LAMP) in this application. As a result, Figure 2.1's input/output and power configurations are chosen. I am able to have 8 inputs and 4 outputs in this arrangement. Figure 5 displays the arrangement.



 

 

Algorithm



Figure6: PLC Algorithm

 

Initialize Variables:

Set counters for J1 and J2 to zero.

Create a variable to store the difference between J1 and J2 (diff).

 

Main Loop:

Enter a continuous loop to repeat the process.

 

Counting Pulses:

Increment counters for J1 and J2 every time a pulse is detected.

 

Compare Every 100 Pulses:

If the counters for J1 and J2 reach 100 pulses:

Calculate the difference: diff = |J1 - J2|.

Reset counters for J1 and J2 to zero.

 

Determine Operation Mode:

If diff is less than or equal to 2:

Set the mode to NO SLIP.

Set the status to TOGGLING.

If diff is greater than 2:

Set the mode to SLIP.

Set the status to ON.

 

Perform Operations Based on Mode:

If the mode is NO SLIP:

Execute operations as if the machine is toggling.

If the mode is SLIP:

Execute operations as if the machine is on.

Repeat the Process:

 

Go back to the main loop and keep counting pulses, comparing, and performing operations.


AB3 LD

 


 


 LAB3 FBD

 


 LAB3 ST

 


 

 LAB3 IL



 LAB6




PLC Configuration

In Figure 7, the setup is displayed.


Figure7: PLC Configuration


Algorithm



Figure8: PLC Algorithm

Initialize Variables:

Set variables to track conveyor status (moving or not moving).

Set variables to track the direction of conveyor movement (right, left, or none).



Start the System:

Upon starting the program, the conveyor is assumed to be not moving.

 

Place/Remove Items:

Items can be placed on or removed from the conveyor only when it's not moving.

Move Conveyor to the Right (Ein Rechts - E3/E4):

 

 

If Ein Rechts (E3 or E4) is pressed:

Check if the conveyor is not moving.

If true, activate A1 (right movement output) and set a timer for a 1.5-second delay.

Stop Conveyor (AUS - E1/E2):

 

If AUS (E1 or E2) is pressed:

Deactivate A1 and A2 (stop movement outputs).

Automatic Stop by Light Barriers (B1/B2):

 

If light barriers B1 or B2 detect an obstacle:

Deactivate A1 and A2 (stop movement outputs).

Move Conveyor to the Left (Ein Links - E5/E6):

 

If Ein Links (E5 or E6) is pressed:

Check if the conveyor is not moving.

If true, activate A2 (left movement output) and set a timer for a 1.5-second delay.

Start Continuous Right Movement (E7/E8):

 

If E7 or E8 is pressed:

Check if the conveyor is not moving.

If true, activate A1 and set the conveyor to continuously move to the right as long as E7 or E8 is pressed.

Automatic stop by B1 or B2.

 

Deactivate Manual Control (E7/E8):

If E7 or E8 is pressed:

Deactivate Ein Rechts (E3/E4) and Ein Links (E5/E6) buttons.

 

Enable E7/E8 Only at Conveyor Halt:

E7/E8 can only be activated if the conveyor is not moving.

 

Outputs A1 and A2:

A1 and A2 control the movements to the right and left, respectively.

 

Repeat the Process:

The system continuously repeats the conveyor control process based on user inputs and sensor feedback.

 

Putting it Together:

Users can place or remove items only when the conveyor is not moving.

Buttons control movements: E3/E4 for right, E5/E6 for left, and E7/E8 for continuous right.

Conveyor stops automatically if AUS is pressed or light barriers detect obstacles.

Manual control buttons (Ein Rechts, Ein Links) are deactivated when continuous right movement is initiated.

E7/E8 can only be pressed when the conveyor is at a halt.

 

LAB6 ST




 LAB7





Configuration PLC

In Figure 9, the setup is displayed.



Figure9: PLC Configuration

 

Algorithm



Figure10: PLC Algorithm

 

 

 

Initiation:

Press the "Freigabe" button to start the process.

 



 

Box Placement and Bottle Transportation:

Upon pressing "Freigabe," position the box and transport bottles to the filling location.

 

Filling Process:

If the bottle reaches the filling position:

Stop the conveyor immediately.

Lower the dosing head to the appropriate level.

 

Valve Activation:

Activate the filling valve for a specific duration (5 seconds) to fill the bottle.

 

Completion of Filling:

After the set time, the dosing head ascends, indicating the completion of the filling process.

 

Bottle Transfer to the Box:

Move the filled bottle to the designated box.

 

Cycle Reiteration:

Repeat the entire cycle with a 1-second delay before starting the next cycle.

Cycle Counting:

Keep track of the number of cycles.

If 12 cycles are completed (12 filled bottles), proceed to the box replacement step.

 

Box Replacement:

Press the "Freigabe" button again to initiate the box replacement process.

 

End of Algorithm:

The algorithm concludes, and the system is ready for the next set of cycles.

 

LAB7 FBD

 


LAB8

 





Configuration PLC

In Figure 11, the setup is displayed.



Figure11: PLC Configuration

 

Algorithm


Figure12: PLC Algorithm

 

Initialize Variables:

Set a variable to track the current mode (Manual or Semi-automatic).

Initialize variables for log sizes (small, medium, long).




Start the System:

Upon starting the program, logs begin to move through three light barriers.

 

Log Sorting Process:

Logs are transported through the light barriers for detection.

If a log is small, it goes to Box 1. If medium, it goes to Box 2. If long, it needs processing elsewhere.

 

 

 

Ensure Sequential Sorting:

The next log can only be taken if the current log is sorted. Detection is performed by the light barriers.

 

Manual Mode:

If the system is in Manual Mode:

Logs are sorted when the start button is manually pressed.

Long logs cannot be sorted even if the button is pressed.

 

Semi-automatic Mode:

If the system is in Semi-automatic Mode:

Short and medium logs are automatically sorted after the start button is pressed.

Long logs are automatically sorted.

 

Change Log Size Processing:

If a change is needed in log size processing (e.g., different processing for long logs), the system should be configured accordingly.

 

Repeat the Process:

The system continually repeats the log sorting process, ensuring sequential sorting and adherence to the selected mode.

 

Putting it Together:

Logs move through light barriers for detection.

Based on the mode (Manual or Semi-automatic), logs are sorted accordingly.

Long logs are processed elsewhere.

The system continuously repeats the sorting process based on the selected mode.

 LAB8 LD

 



 

Programming Logic Controllers (SPS)

  Variables for Lab 1,2 and 3               LAB1   Configuration PLC I utilized a PLC setup with 140 CPU 434 12A/U...