Dayton ECT 464 - Lecture 26 Siemens Instructions 5

Unformatted text preview:

ECT 464Slide 2Jump InstructionsSlide 4Jump ExampleSequence Control RelaySlide 7Slide 8Shift and Rotate InstructionsSlide 10Slide 11Shift and Rotate ExampleShift Register BitSlide 14Slide 15Swap BytesSlide 17String InstructionsSlide 19String ExampleSubstringsSlide 22Slide 23Slide 24TablesSlide 26FIFO’s and LIFO’sSlide 28Memory FillTable FindTimer InstructionsTimer ResolutionsTimer ExamplesSlide 34Slide 35Slide 36IEC TimerSlide 38Interval TimerSlide 40Slide 41SubroutinesSlide 43ECT 464 ECT 464 Lecture 26Lecture 26Siemens Instructions 5Siemens Instructions 5Today’s Quote:Today’s Quote:In order to receive the direction In order to receive the direction from God you must be able to from God you must be able to receive the correction from God.receive the correction from God.And you have forgotten that word of And you have forgotten that word of encouragement that addresses you as sons: encouragement that addresses you as sons: "My son, do not make light of the Lord's "My son, do not make light of the Lord's discipline, discipline, and do not lose heart when he rebukes and do not lose heart when he rebukes you, you, because the Lord disciplines those he loves, because the Lord disciplines those he loves, and he punishes everyone he accepts as and he punishes everyone he accepts as a son."a son." Hebrews 12:5-6Hebrews 12:5-6Jump InstructionsJump InstructionsJump InstructionsJump InstructionsThe Jump to Label instruction (JMP) performs a branch to the specified label N within the program. The Label instruction (LBL) marks the location of the jump destination N. You can use the Jump instruction in the main program, in subroutines, or in interrupt routines. The Jump and its corresponding Label instruction must always be located within the same segment of code (either the main program, a subroutine, or an interrupt routine). You cannot jump from the main program to a label in either a subroutine or an interrupt routine. Likewise, you cannot jump from a subroutine or interrupt routine to a label outside that subroutine or interrupt routine. You can use a Jump instruction within an SCR segment, but the corresponding Label instruction must be located within the same SCR segment.Jump ExampleJump ExampleSequence Control Relay Sequence Control RelaySequence Control Relay Sequence Control Relay SCR instructions provide you with a simple yet powerful state control programming technique that fits naturally into a LAD, FBD, or STL program.Whenever your application consists of a sequence of operations that must be performed repetitively, SCRs can be used to structure your program so that it corresponds directly to your application. As a result, you can program and debug your application more quickly and easily. The Load SCR instruction (LSCR) loads the SCR and logic stacks with the value of the S bit referenced by the instruction N. The SCR segment is energized or de-energized by theresulting value of the SCR stack. The value of the SCR stack is copied to the top of the logic stack so that boxes or output coils can be tied directly to the left power rail without an intervening contact.Sequence Control Relay Sequence Control RelayShift and Rotate Instructions Shift and Rotate InstructionsShift and Rotate Instructions Shift and Rotate Instructions The Shift instructions shift the input value IN right or left by the shift count N and load the result in the output OUT. The Shift instructions fill with zeros as each bit is shifted out. If the shift count (N) is greater than or equal to the maximum allowed (8 for byte operations, 16 for word operations, and 32 for double word operations), the value is shifted the maximum number of times for the operation. If the shift count is greater than 0, the overflow memory bit (SM1.1) takes on the value of the last bit shifted out. The zero memory bit (SM1.0) is set if the result of the shift operation is zero. Byte operations are unsigned. For word and double word operations, the sign bit is shifted when you use signed data types.Shift and Rotate Instructions Shift and Rotate Instructions The Rotate instructions rotate the input value (IN) right or left by the shift count (N) and load the result in the memory location (OUT). The rotate is circular. If the shift count is greater than or equal to the maximum for the operation (8 for a byte operation, 16 for a word operation, or 32 for a double-word operation), the S7-200 performs a modulo operation on the shift count to obtain a valid shift count before the rotation is executed. This result is a shift count of 0 to 7 for byte operations, 0 to 15 for word operations, and 0 to 31 for double-word operations. If the shift count is 0, a rotate operation is not performed. If the rotate operation is performed, thevalue of the last bit rotated is copied to the overflow bit (SM1.1). If the shift count is not an integer multiple of 8 (for byte operations), 16 (for word operations), or 32 (for double-word operations), the last bit rotated out is copied to the overflow memory bit (SM1.1). The zero memory bit (SM1.0) is set when the value to be rotated is zero. Byte operations are unsigned. For word and double word operations, the sign bit is shifted when you use signed data types.Shift and Rotate Example Shift and Rotate ExampleShift Register Bit Shift Register BitShift Register Bit Shift Register Bit The Shift Register Bit instruction shifts a value into the Shift Register. This instruction provides an easy method for sequencing and controlling product flow or data. Use this instruction to shift the entire register one bit, once per scan. The Shift Register Bit instruction shifts the value of DATA into the Shift Register. S_BIT specifies the least significant bit of the Shift Register. N specifies the length of the Shift Register and the direction of the shift (Shift Plus = N, Shift Minus = --N). Each bit shifted out by the SHRB instruction is placed in the overflow memory bit (SM1.1). This instruction is defined by both the least significant bit (S_BIT) and the number of bits specified by the length (N).Shift Register Bit Shift Register BitSwap BytesSwap BytesThe Swap Bytes instruction exchanges the most significant byte with the least significant byte of the word IN.Swap BytesSwap BytesThe Swap Bytes instruction exchanges the most significant byte with the least significant byte of the word IN.String InstructionsString


View Full Document

Dayton ECT 464 - Lecture 26 Siemens Instructions 5

Download Lecture 26 Siemens Instructions 5
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 26 Siemens Instructions 5 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 26 Siemens Instructions 5 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?