Micro1 07E Bin Operat
Micro1 07E Bin Operat
Micro1 07E Bin Operat
Contents 7
7. Binary Operations .................................................................................................. 7-2
7.1. Task Description: The Conveyor Model as Distribution Conveyor ....................................... 7-3
7.2. Sensors and Check Symbols ................................................................................................ 7-4
7.3. Binary Logic Operations: AND, OR....................................................................................... 7-5
7.3.1. Binary Logic Operations: Exclusive OR (XOR)..................................................................... 7-6
7.3.2. Theory Exercise 1: Sensor and Check Symbols .................................................................. 7-7
7.4. Assignment, Set, Reset, NOT ............................................................................................... 7-8
7.4.1. Flip Flops............................................................................................................................... 7-9
7.5. Task Description: "FC_Mode" (FC15)................................................................................. 7-10
7.5.1. Exercise 2: Programming the "FC_Mode" (FC15) Block .................................................... 7-11
7.5.2. Task Description: Parts Transportation when "P_Operation" (Q4.0) is Switched On ........ 7-12
7.5.3. Exercise 3: Expanding "FC_ConvMotor" (FC16) ................................................................ 7-13
7.6. Task Description: Parts Transportation THROUGH the Light Barrier ................................ 7-14
7.6.1. Operand Edge Evaluations ................................................................................................. 7-15
7.6.2. RLO Edge Evaluation ......................................................................................................... 7-16
7.6.3. Exercise 4: Integrating an Edge Evaluation in "FC_ConvMotor" (FC16)............................ 7-17
7.7. Task Description: Controlling the Indicator Lights .............................................................. 7-18
7.7.1. Exercise 5: Commissioning "FC_Indicate" (FC14) ............................................................. 7-19
7.8. Additional Information ......................................................................................................... 7-20
7.8.1. Additional Exercise 6: Optimizing "FC_Mode" (FC15)........................................................ 7-21
7.8.2. Setting / Resetting Bit Fields ............................................................................................... 7-22
7.8.3. Jump Instructions JMP, JMPN, RET................................................................................... 7-23
7. Binary Operations
4711
DI 0V
I 0.0 S_OperationON
S_OperationOFF
"B_Bay1" "B_Bay2" "B_LB"
I 0.1 (NC) -10V +10V (I 8.5) (I 8.6) (I8.0)
Poti
I 0.2 S_Right
I 0.3 S_Left
DO
P_Operation Q 4.0 "K_Left"
"K_Right"
(Q 8.6)
(Q 8.5)
"S_Bay1" "S_Bay2"
(I 8.1) (I 8.2)
"P_Bay1" "P_Bay2"
(Q 8.1) (Q 8.2)
NO activated
contact yes 1 “Yes” “No”
1 0
LAD: LAD:
not
activated yes 1 “Yes” “No”
1 0
AND FBD
LAD
Change the
operation
Change the
operation FBD
OR LAD
OR Logic Operation
For an OR logic operation, the result of logic operation (RLO) = '1', when at least one input signal
has Status '1'.
FBD
LAD
• For an XOR logic operation with 2 inputs, the result of logic operation (RLO) = '1', when one
and only one of the two input signals has Status '1'.
• For an XOR logic operation with more than 2 operands, the RLO ...
− = '1', when an uneven number of checked operands has Status '1'
− = '0', when an even number of checked operands has Status '1'.
Task: In all three examples, the light should be on when S1 is activated and S2 is not activated!
Hardware
S1 S2 S1 S2 S1 S2
E 1.0
I 1.0 EI 1.1
1.1 E 1.0
I 1.0 E 1.1
I 1.1 EI 1.0
1.0 E I1.1
1.1
Automation system Automation system Automation system
Q 4.0 Q 4.0 Q 4.0
Software
I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0
LAD
Task
Complete the programs in the picture above so that the following functionality is fulfilled: When
the switch S1 is activated and the switch S2 is not activated, the light should be on in all three
examples.
Note
The terms - "NO contact" and "NC contact" - have different meanings depending on whether they
are used in the process-hardware-context or as check symbols in the software.
FBD LAD
NOT
Change the
operation
Change the
operation
Assignment
With an assignment, the specified operand is always assigned the current RLO as status. The
assigned RLO remains available after the assignment and can be assigned to a further operand
or it can be further logically linked.
Set
If RLO = "1", the specified operand is assigned Status '1'; if RLO = "0", the status of the operand
remains unchanged.
Reset
If RLO = "1", the specified operand is assigned Status ' 0'; if RLO = "0", the status of the operand
remains unchanged.
NOT
The NOT instruction inverts the result of logic operation (RLO).
If, in the example shown, the RLO of the AND logic operation = '1', the NOT instruction inverts it
to RLO '0' and the Set instruction is not executed (the status of "Tag_3" (Q20.0) then remains
unchanged).
If the RLO of the AND logic operation = '0', the NOT instruction inverts it to RLO '1' and the Set
instruction is executed ("Tag_3" (Q20.0) is assigned Status '1').
FBD
LAD
Priority (Dominancy)
If there is a signal state or RLO = "1" at both inputs at the same time, the priority of the operation
decides whether the operand is set or reset. For that reason, there are different symbols for the
Dominant Set and Dominant Reset memory functions in LAD and FBD.
Note
With a CPU restart, all outputs are reset. That is, they are overwritten with Status '0'.
4711
DI 0V
I 0.0 S_OperationON
S_OperationOFF
I 0.1 (NC) -10V +10V
Poti
I 0.2 S_Right
I 0.3 S_Left
DO
P_Operation Q 4.0
Task Description
A mode section for the system is to be programmed in "FC_Mode" (FC15), which controls the
indicator light "P_Operation" (Q4.0). This is then to be linked in "FC_ConvMotor" (FC16) as a
further condition for jogging the conveyor motor.
Task
In "FC_Mode" (FC15) which is now to be created, program a mode section for the distribution
conveyor:
The operation or the indicator light "P_Operation" (Simulator LED Q4.0) is switched on via the
simulator switch "S_OperationON" (I 0.0) and is switched off via the simulator switch
"S_OperationOFF" (I 0.1, NC).
What to Do
1. Create the new block "FC_Mode" (FC15).
2. Open the "Instructions" Task Card, program the instructions shown in the picture using drag &
drop and use the absolute addresses shown.
3. Rename the tags used as shown in the picture.
4. In "FC_ConvMotor" (FC16), link the simulator LED "P_Operation" (Q4.0) logically in such a
way that the conveyor motor can only be jogged when this is switched off.
5. Download the modified blocks into the CPU and check the program function.
"B_Bay1"
(I 8.5)
"S_Bay1"
(I 8.1)
"B_Bay2"
(I 8.6)
"S_Bay2"
(I 8.2)
"B_LB"
(I 8.0)
"K_Right"
(Q8.5)
Task Description:
When "P_Operation" (Q4.0) is switched ON, parts are to be transported from Bay 1 or Bay 2 to
the light barrier "B_LB" (I 8.0). The precondition is that a part is only placed on the conveyor at
one of the two bays. If parts are placed on the conveyor at both bays, no transport sequence can
be started.
• The conveyor motor "K_Right" (Q8.5) is started when
− on Bay 1 the proximity sensor "B_Bay1" (I 8.5) is occupied AND on Bay 2 the proximity
sensor "B_Bay2" (I 8.6) is NOT occupied AND the pushbutton at Bay 1 "S_Bay1" (I 8.1) is
pressed
OR
− on Bay 2 the proximity sensor "B_Bay2" (I 8.6) is occupied AND on Bay 1 the proximity
sensor "B_Bay1" (I 8.5) is NOT occupied AND the pushbutton at Bay 2 "S_Bay2" (I 8.2) is
pressed.
• The conveyor motor "K_Right" (Q8.5) is stopped when
− the part has reached the light barrier "B_LB" (I 8.0)
OR
− "P_Operation" (Q4.0) is switched off.
"M_Jog_Right"
Conditions for (M16.2) Memory bit for
jogging RIGHT jogging RIGHT
= when "P_Operation" OFF
"M_Auto_Right" =
(M16.4)
Task
Expand the "FC_ConvMotor" (FC16) block with the previously described functions.
Solution Notes
The conveyor motor "K_Right" (Q8.5) must now be controlled under two conditions:
when "P_Operation" (Q4.0) is switched off while jogging RIGHT (in the picture Network x). OR,
when "P_Operation" (Q4.0) is switched on, under the conditions described in the task (in the
picture Network y).
If, in both Network x and y, the result of logic operation of the conditions were each assigned to
the output "K_Right" (Q 8.5), an error in the form of a double assignment would occur. Jogging
the motor RIGHT in manual mode (Network x) would no longer function, since the state assigned
to the output here would then be overwritten in Network y.
The problem can be solved by programming a memory bit for each condition or by first assigning
the results of the logic operations to a memory bit in both Network x and y. These are then used
in the Network to control the conveyor motor.
What to Do
1. Open the "FC_ConvMotor" (FC16) block.
2. Program the required functions in new networks (see picture). Use the memory bits shown in
the picture and provide them with the symbols shown.
3. Modify the already existing network "Jog Right" as described in the solution notes.
4. Download the expanded block into the CPU and check the program function.
Part within
light barrier
Start condition
for transports
"B_LB"
(I 8.0)
"K_Right"
(Q8.5)
Up to now NEW
Task Description:
The function of the "FC_ConvMotor" (FC16) to control the conveyor motor when "P_Operation"
(Q4.0) is switched on is to remain fundamentally unchanged. However, the conveyor motor is
only to stop when the part has passed through the light barrier.
"Scan operand for positive "Set operand on positive "Set tag on positive
signal edge" signal edge" signal edge"
(FB Evaluation)
"B_LB"
Note:
The instructions compare the current signal state of the input "B_LB" with the signal state in the
previous cycle which is stored in an edge memory bit "M_aux_LB" or in the instance DB
"DB_R_TRIG". When the instruction detects a change from "0" to "1", a positive signal edge
exists. Subsequently, the current signal state is stored in the edge memory bit or in the instance
DB. The status of the edge memory bit and the contents of the IDB must not be overwritten at
another location in the program.
FBD LAD
"B_LB"
"K_Right"
& RLO
Part within
light barrier
Start condition
for transports
"B_LB"
(I 8.0)
"K_Right"
(Q8.5)
Up to now NEW
Task:
When "P_Operation" (Q4.0 = '1') is switched on, the parts are to be transported from Bay 1 or 2
THROUGH the light barrier.
What to Do:
1. Program the necessary changes in "FC_ConvMotor" (FC16), by now linking the result of the
edge evaluation as the reset condition for M16.4 (bit memory for conveyor motor RIGHT)
instead of the light barrier signal "B_LB" (I 8.0) itself. For the necessary edge evaluation of the
light barrier signal use the bit memory "M_aux_LB" (M16.0) as an edge memory bit.
2. Download the modified "FC_ConvMotor (FC16) block into the CPU and check the program
function.
"B_Bay1" "B_Bay2"
(I 8.5) (I 8.6)
Task Description
When "P_Operation" (Q4.0) is switched on, the indicators lights are to be controlled as follows:
• The indicator lights "P_Bay1" (Q8.1) and "P_Bay2" (Q8.2) show
− a constant light when a new part can be placed on the conveyor (conveyor motor is
stopped and both proximity sensors are free)
− 1Hz flashing light at the bay where the associated proximity sensor detects a part, but only
as long as the conveyor has not yet been started (if parts are placed on the conveyor at
both proximity sensors, neither indicator light must light up)
− 2Hz flashing light as long as the conveyor motor is running
• The indicator light at the light barrier bay "P_Bay_LB" (Q8.4) shows 2Hz flashing light as long
as the conveyor motor is running.
The described functions are already programmed in the "FC_Indicate" (FC14) block, which is
stored in the "Micro1_Lib" global library. The block still contains errors and is to be commissioned
by you in the next exercise.
Task
The "FC_Indicate" block is to be copied from the "Micro1_Lib" global library into the project and
commissioned.
What to Do
1. Using drag & drop, copy the "FC_Indicate" (FC14) block into the "Program blocks" container
from the "Micro1_Lib" global library (as shown in the picture).
2. Program the call of "FC_Indicate" (FC14) in "OB_Cycle" (OB1)
3. Download all modified blocks into the CPU.
4. Test the program function and correct the block in such a way that the indicator lights are
controlled as required. To do so, use the test function "Monitor block", even if you have
already recognized the error!
"S_OperationOFF"
(I 0.1, NC)
"P_Operation"
(Q4.0)
"S_OperationOFF"
(I 0.1, NC)
"P_Operation"
(Q4.0)
Task:
Expand the functionality of "FC_Mode" (FC15) using edge evaluation so that the ON switch must
be activated every time the operation is switched on (see picture, lower function diagram "NEW:
with edge evaluation"). The criteria for switching on the system is no longer to be the activated
ON switch or its "1" signal, but the function of activating or the "positive edge" of the ON switch
signal.
What to Do:
1. In the set condition for "P_Operation" (Q4.0), insert an edge evaluation of the switch
"S_OperationON" (I 0.0). For the edge evaluation, use the bit memory "M_aux_Op_on"
(M15.0) as edge memory bit.
2. Download the modified "FC_Mode" (FC15) block into the CPU and check whether it fulfils the
desired functions!
7 6 54 3 21 0
MB10 0000 0000
MB11 0000 0000
• JMP:
If RLO ='1', the jump into the target network is executed; if RLO ='0', the jump is not executed
and the linear program execution continues.
• JMPN:
If RLO ='0', the jump into the target network is executed; if RLO ='1', the jump is not executed
and the linear program execution continues.