29
ECT 464 ECT 464 Lecture 22 Lecture 22 Siemens Instructions 1 Siemens Instructions 1

ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Embed Size (px)

Citation preview

Page 1: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

ECT 464 ECT 464

Lecture 22Lecture 22

Siemens Instructions 1Siemens Instructions 1

Page 2: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Today’s Quote:Today’s Quote:

The best way to get the last word The best way to get the last word is to apologize.is to apologize.

If you have been trapped by what you said, If you have been trapped by what you said,        ensnared by the words of your mouth,       ensnared by the words of your mouth, then do this, my son, to free yourself, then do this, my son, to free yourself,        since you have fallen into your        since you have fallen into your neighbor's hands: neighbor's hands:        Go and humble yourself;        Go and humble yourself;        press your plea with your neighbor!        press your plea with your neighbor!

Proverbs 6:2,3Proverbs 6:2,3

Page 3: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Standard ContactsStandard Contacts

Page 4: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Standard ContactsStandard ContactsThe Normally Open contact instructions (LD, A, and O) and Normally Closed contact instructions (LDN, AN, ON) obtain the referenced value from the memory or from the process-image register. The standard contact instructions obtain the referenced value from the memory (or process-image register if the data type is I or Q). The Normally Open contact is closed (on) when the bit is equal to 1, and the Normally Closed contact is closed (on) when the bit is equal to 0. In FBD, inputs to both the And and Or boxes can be expanded to a maximum of 32 inputs. In STL, the Normally Open instructions Load, AND, or OR the bit value of the address bit to the top of the stack, and the Normally Closed instructions Load, AND, or OR the logical NOT of the bit value to the top of the stack.

Page 5: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Immediate ContactsImmediate ContactsAn immediate contact does not rely on the S7-224 scan cycle to update; it updates immediately. The Normally Open Immediate contact instructions (LDI, AI, and OI) and Normally Closed Immediate contact instructions (LDNI, ANI, and ONI) obtain the physical input value when the instruction is executed, but the process-image register is not updated. The Normally Open Immediate contact is closed (on) when the physical input point (bit) is 1, and the Normally Closed Immediate contact is closed (on) when the physical input point (bit) is 0. The Normally Open instructions immediately Load, AND, or OR the physical input value to the top of the stack, and the Normally Closed instructions immediately Load, AND, or OR the logical NOT of the value of the physical input point to the top of the stack.

Page 6: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Standard ContactsStandard Contacts

Page 7: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

NOT InstructionNOT InstructionThe Not instruction (NOT) changes the state of power flow input (that is, it changes the value on the top of the stack from 0 to 1 or from 1 to 0).

Page 8: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Positive and Negative Positive and Negative Transition InstructionsTransition Instructions

The Positive Transition contact instruction (EU) allows power to flow for one scan for each off-to-on transition. The Negative Transition contact instruction (ED) allows power to flow for one scan for each on-to-off transition. For the Positive Transition instruction, detection of a 0-to-1 transition in the value on the top of the stack sets the top of the stack value to 1; otherwise, it is set to 0. For a Negative Transition instruction, detection of a 1-to-0 transition in the value on the top of the stack sets the top of the stack value to 1; otherwise, it is set to 0.

Page 9: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Example 1Example 1

Page 10: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Example 2Example 2

Page 11: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Example 3Example 3

Page 12: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output InstructionsOutput Instructions

Page 13: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output InstructionsOutput InstructionsThe Output instruction (=) writes the new value for the output bit to the process-image register. When the Output instruction is executed, the S7-224 turns the output bit in the process-image register on or off. For LAD and FBD, the specified bit is set equal to power flow. For STL, the value on the top of the stack is copied to the specified bit.

Page 14: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output InstructionsOutput InstructionsThe Output Immediate instruction (=I) writes the new value to both the physical output and the corresponding process-image register location when the instruction is executed. When the Output Immediate instruction is executed, the physical output point (Bit) is immediately set equal to power flow. For STL, the instruction immediately copies the value on the top of the stack to the specified physical output bit (STL). The “I” indicates an immediate reference; the new value is written to both the physical output and the corresponding process-image register location when the instruction is executed. This differs from the non-immediate references, which write the new value to the process-image register only.

Page 15: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output InstructionsOutput InstructionsThe Set (S) and Reset (R) instructions set (turn on) or reset (turn off) the specified number of points (N), starting at the specified address (Bit). You can set or reset from 1 to 255 points. If the Reset instruction specifies either a timer bit (T) or counter bit (C), the instruction resets the timer or counter bit and clears the current value of the timer or counter.

Page 16: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output InstructionsOutput InstructionsThe Set Immediate and Reset Immediate instructions immediately set (turn on) or immediately reset (turn off) the number of points (N), starting at specified address (Bit). You can set or reset from 1 to 128 points immediately. The “I” indicates an immediate reference; when the instruction is executed, the new value is written to both the physical output point and the corresponding process-image register location. This differs from the non-immediate references, which write the new value to the process-image register only.

Page 17: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output Example 1Output Example 1

Page 18: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output Example 2Output Example 2

Page 19: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Output Example 3Output Example 3

Page 20: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack InstructionsLogic Stack InstructionsAND Load - The AND Load instruction (ALD) combines the values in the first and second levels of the stack using a logical AND operation. The result is loaded in the top of stack. After the ALD is executed, the stack depth is decreased by one.

OR Load - The OR Load instruction (OLD) combines the values in the first and second levels of the stack, using a logical ORoperation. The result is loaded in the top of the stack. After the OLD is executed, the stack depth is decreased by one.

Page 21: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack InstructionsLogic Stack InstructionsLogic Push - The Logic Push instruction (LPS) duplicates the top value on the stack and pushes this value onto the stack. The bottom of the stack is pushed off and lost.

Logic Read - The Logic Read instruction (LRD) copies the second stack value to the top of stack. The stack is not pushed or popped, but the old top-of-stack value is destroyed by the copy.

Logic Pop - The Logic Pop instruction (LPP) pops one value off of the stack. The second stack value becomes the new top of stack value.

Page 22: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack InstructionsLogic Stack InstructionsAND ENO - The AND ENO instruction (AENO) performs a logical AND of the ENO bit with the top of the stack to generate the same effect as the ENO bit of a box in LAD or FBD. The result of the AND operation is the new top of stack. ENO is a Boolean output for boxes in LAD and FBD. If a box has power flow at the EN input and is executed without error, the ENO output passes power flow to the next element. You can use the ENO as an enable bit that indicates the successful completion of an instruction. The ENO bit is used with the top of stack to affect power flow for execution of subsequent instructions. STL instructions do not have an EN input. The top of the stack must be a logic 1 for conditional instructions to be executed. In STL there is also no ENO output. However, the STL instructions that correspond to LAD and FBD instructions with ENO outputs set a special ENO bit. This bit is accessible with the AENO instruction.

Page 23: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack InstructionsLogic Stack InstructionsLoad Stack - The Load Stack instruction (LDS) duplicates the stack bit (N) on the stack and places this value on top of the stack. The bottom of the stack is pushed off and lost.

N is a byte from 0-8.

Page 24: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack InstructionsLogic Stack Instructions

Page 25: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack Example 1Logic Stack Example 1

Page 26: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Logic Stack Example 2Logic Stack Example 2

Page 27: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Set and Reset Dominant Bistable Instructions

The Set Dominant Bistable is a latch where the set dominates. If the set (S1) and reset (R) signals are both true, the output (OUT) is true. The Reset Dominant Bistable is a latch where the resetdominates. If the set (S) and reset (R1) signals are both true, the output (OUT) is false. The Bit parameter specifies the Boolean parameter that is set or reset. The optional output reflects the signal state of the Bit parameter.

Page 28: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Set and Reset Dominant Bistable Instructions

Page 29: ECT 464 Lecture 22 Siemens Instructions 1. Today’s Quote: The best way to get the last word is to apologize. If you have been trapped by what you said,

Set and Reset Dominant Bistable Instructions