This action might not be possible to undo. Are you sure you want to continue?
General information: A PLC can be divided into four main sections : Inputs Outputs The memory - where the user program instructions and data are stored The processor-which reads the input data and controls the outputs according to the user program instructions. The programming terminal is the tool used to : Create and transfer the user program to program memory Debug the user program and control system start-up Perform installation diagnostics.
INTRODUCTION MICRO TSX37 PLC
Function block bits : Function block bits correspond to the outputs of blocks.Addressable objects Definition of main Boolean objects Input/output bits These bits are the "logical images" of the electrical state of the I/O. These outputs can be either wired directly._ Addressing I/O module objects Addressing of the main word and bit objects in I/O modules is defined by the following characters : Type of object I and Q : the physical inputs and outputs of modules exchange this information implicitly on each scan of the task to which they are attached. . Note : Other types of data (status. The positions for each type of TSX37 PLC (base and extension) are shown in the diagram below. etc) can also be exchanged if requested by the application Format (Size) For objects in Boolean format. System bits System bits %S0 to %S127 monitor correct operation of the PLC as well as progression of the application program. Internal bits Internal bits %M0 to %M255 are used to store intermediate states during execution of the program. They are stored in the data memory and are updated on each scan of the task in which they are configured. the X can be omitted. command words. It is used in other types of format such as byte. or used as objects. Word extract bits : Using PL7 software it is possible to extract one of the 16 bits from a word object. word and double word Channel position and number The base modularity of the TSX 37 is 1/2 format.
Standard format modules are addressed as two superposed 1/2 format modules .
Addressing words Words in PL7 language are addressed in the following way : Type of object :internal words which store values during execution of the program. They can therefore use the EPROM memory as their support. D double length : these 32 bit words can contain an algebraic value between . . W single length : these 16 bit words can contain an algebraic value between -32 768 and 32 767. K :constant words which store constant values or alphanumeric messages.others are used to perform operations on the application (operating mode. They are stored in the same place as the program. M Format Objects words can be addressed by PL7 software in four different formats : B byte : this format is used exclusively for operations on character strings. These words are stored in the memory on two consecutive single length words. Their content can only be written or modified by the terminal. etc).2 147 483 648 and 2 147 483 647. They are stored in the data zone within a single memory zone. S :system words. These words perform several functions : . .some provide information on the status of the system by reading %SWi words (system and application operating time. etc).
Each rung consists of a maximum of 7 lines and 11 columns. %MW3 corresponds to %MB7 and %MB6. The graphic elements are interconnected by horizontal and vertical links. Words are 32 bits long. . A rung consists of a set of graphic elements bounded on the left and right by power rails.8528E2 Overlay between objects : Bytes. relays. counters. Presentation of Ladder language Principle Programs written in Ladder language consist of a series of rungs which are executed sequentially by the PLC. double length and floating point words are stored within the data zone in a single memory zone. Examples : %MD0 corresponds to %MW0 and %MW1. The action zone which contains the actions to be executed according to the results of the test zone.F floating point (1) : the floating point format used is that of the IEEE standard. The internal variables of the PLC. there is overlay between : double length word %MDi and single length words %MWi and %MWi+1 (word %MWi containing the least significant bits and word %MWi+1 containing the most significant bits of word %MDi). Arithmetic. which are divided into 2 zones : The test zone which contains the logic conditions necessary to execute the actions. which corresponds to single length floating point numbers. indicator lamps. They represent : The PLC I/O (pushbuttons. Standard control system functions (timers. %KD543 corresponds to %KW543 and %KW544. single. Example of floating point values : 1285. sensors. Thus. etc). logic and specific operations.i). etc).28 12. single length word %MWi and bytes %MBj and %MBj +1 (with j=2.
MAIN A .
0 The Boolean result of test elements is applied to the action element.2 The associated bit object takes the logical value of the logical result of the test element. N/C contact %I1. Example of load instruction In Ladder language : %I1. Basic instructions include : • Boolean instructions (processing bits). • Boolean equation : %I1. %M0 This instruction is equivalent to a open contact when the internal bit M0 is at state 1.1 %Q2.B Presentation of basic instructions General The instructions described in this section comply with the main basic instructions defined in IEC standard 1131. • Test elements. .0 This instruction is equivalent to a closed contact when the respective input is at state 1.0 %I1. • Numerical instructions on integers (processing words and double words). • Action elements. These instructions always produce the same effect. example : direct coil.3. Ie. • Predefined control system timer and counter function blocks.0 This instruction is equivalent to a closed contact when the respective input is at state 1. If %I1. internal bits etc). • Program instructions. Boolean instructions Presentation of Boolean instructions Boolean instructions act on all bit type data (I/O bits. irrespective of the language used.0 will be at state 1.1 are at state 1 then %Q2. Only their presentation in the program changes.0 AND %I1. example : N/O contact. %Q2.
%Q.%•:Xk.i PLC output %Qx. Load instructions Boolean instructions are described in the following way : These instructions correspond to : • N/O contacts : contact closed when the bit object which controls it is at state 1. (1) P N List of operands 0/1 %I %Q %M %S %BLK %•:Xk %I.• Rising and falling edges %I1. eg : %MWi:Xk Assignment instructions These instructions correspond to : • Direct coils : the associated bit object takes the value of the result of the equation.%•:Xk. eg : %TMi. • Rising edge contacts : detects a change of the controlling bit from 0 to 1.0 P Rising edge detection contact N Falling edge detection contact This test instructions can be used to detect rising or falling edges on PLC I/O bits or on internal bits.%M %I. • Falling edge contacts : detects a change of the controlling bit from 1 to 0.%M Immediate value 0 (false) or 1 (true) PLC input %Ix. (1) %I.%Q.%M. .%BLK.%Q.%BLK.i Internal bit %Mi System bit %Si Function block bit.%Q. • Set coils : the associated bit object is set to 1 when the result of the equation is at 1. • Inverse coils : the associated bit object takes the inverse value of the result of the equation. Authorized operands Code Operand %I.Q Word extract bit.%S. • Reset coils : the associated bit object is set to 0 when the result of the equation is at 1.0 %I1. • N/C contacts : contact open when the bit object which controls it is at state 1.%S.%M.
%I1.0 S R Authorized operands Code Operand %I.%•:Xk R Predefined function blocks Programming principles for predefined function blocks The function blocks use bit objects and specific words. In order to optimize memory occupation.%S.%Q.3 %Q2.%M.2 %Q2.%Q.%Q.%M. the type and number of function blocks used must be defined at the outset. within the limits imposed by the system (via the Configuration and Data editors).%•:Xk %I.%M.%S. . Control system function blocks are preprogrammed in the PLC and therefore occupy a particular zone of the user memory. There are six types of control system function block : Type of block Maximum number See section Timer %TMi 64* Up/down counter %Ci 32 Monostable %MNi 8 Register %Ri 4 Drum controller %DRi 8 Timer (Series 7) %Ti 64* (1) the total number of %TMi + %Ti timers must be less than or equal to 64.%•:Xk S S %I.%•:Xk %I.%S.%Q.4 S %Q2.%S.%M.0 %Q2.4 %I1.
This delay is programmable and can be modified via the terminal. Characteristics Timer number Mode %TMi TON TOF TP TB %TMi. This duration is programmable and can be modified via the terminal. tested and written by the program. N : no access in the adjustment mode.Q is set to 1 depending on the function performed TON. 1s.P:9999 MODIF:Y Q Timers have three operating modes : TON : This mode is used to control on-delay actions.P Edit via the terminal (MODIF) Setting input (or instruction) Timer output Y/N IN Q . TOF or TP.P≤9999. 100ms. The timer starts on a rising edge (TON or TP mode) or a falling edge (TOF mode). The time period or delay generated is equal to %TMi.Timer function block %TMi IN MODE:TON TB: 1mn TM. Word which can be read. The smaller the time base. Can be read and tested but not written by the program (1). Word which increments from 0 to %TMi.P when the timer is running.P x TB. TOF : This mode is used to control off-delay actions. 0<=%TMi. TP : This mode is used to create a pulse of an exact duration.P in the adjustment mode. 10ms (max of 16 timers when 10ms). the greater the accuracy of the timer. Associated bit %TMi. It is set to 9999 by default. Y : possibility of changing the preset value %TMi.V 0 to 63 On-delay (default) Off-delay Monostable 1min (default). This delay is programmable and can be modified via the terminal. Time base Current value Preset value %TMi.
P and then remains at 1 as long as input IN is at 1. The current value increases to %TMi.V is set to 0 on a rising edge at input IN (even if the timer is still running).V increases from 0 to %TMi. The timer is started on a falling edge at input IN. .P by one unit on each pulse of the time base TB.P by one unit on each pulse of the time base TB. Using as an off-delay timer : TOF mode The current value %TMi.P. When input IN is at 0.V takes the value 0. Output bit %TMi. the timer is stopped. Output bit %TMi.Q changes to 1 when the current value reaches %TMi.Using as an on-delay timer : TON mode The timer is started on a rising edge at input IN : its current value %TMi. even if its value is still changing : %TMi.Q changes to 1 when a rising edge is detected on input IN and the timer returns to 0 when the current value reaches %TMi.
TMi.V takes the value 0. Programming and configuration Timer function blocks are programmed in the same way.Q changes to 1 when the timer is started and returns to 0 when the current value reaches %TMi.V increases from 0 to %TMi. irrespective of the mode of use selected. .Using as a monostable : TP mode The timer is started on a rising edge at input IN : (if the timer has not already started) its current value %TMi. Output bit %TMi. TOF or TP mode can be chosen in the variables editor. This monostable cannot be reset. 1s. Programming . Configuration The following parameters must be entered in the variables editor : .P.Mode : TON.%TMi. 100ms or 10ms.P by one unit on each pulse of the time base TB. When input IN and output %TMi are at 0. TON. TOF or TP. .TB : 1min. .MODIF : Y or N.P : 0 to 9999.
Up/down counter function block %Ci The up/down counter function block is used to up/down count events. These two operations can be simultaneous. .
E (downcount underflow) changes to state 1 when %Ci. the current value %Ci. If they are both at 1 simultaneously.V is forced to 0.D=1).2 (when internal bit %M0 is at 1) increments the upcounter %C8 up to its final preset value (bit %C8. Programming .P. the "preset reached" output bit %Ci. Configuration and programming Counting of a number of items = 5000. the current value remains unchanged.D assigned to output D changes to state 1.%Ci.V changes from 9999 to 0. the two corresponding inputs CU and CD must be controlled. set to 5000 in this example. Reset : when input R is set to state 1.P. Output bit %Ci. Up/down count : to use both the upcount and the downcount functions simulta-neously. Downcount : when a rising edge appears at the downcounting input CD. %Ci. the current value %Ci. and output %Ci.E. and is reset to 0 if the counter continues to downcount. and outputs %Ci.D and %Ci. The counter is reset by input %I1.F are at 0.V is decremented by one unit.V takes the value %Ci. Output bit %Ci. Preset : if preset input S is at state 1 and the reset input R is at state 0. the current value is incremented by one unit. Each pulse on input %I1.Operation Upcount : when a rising edge appears at the upcounting input CU.F (upcount overflow) changes to state 1 when %Ci. the current value %Ci.V changes from 0 to 9999. Configuration The following parameters must be entered via the variables editor : .1. .MODIF : Y. These two inputs are then scanned in succession.P. The reset input has priority. When this value is equal to the preset value %Ci. and is reset to 0 if the counter continues to upcount.D is set to 1.
. located in the action zone for operation blocks. < : Test if operand 1 is less than operand 2. eg : OP3:=OP1+OP2. Comparison instructions Comparison instructions are used to compare two operands. <= : Test if operand 1 is less than or equal to operand 2. a complex expression. > : Test if operand 1 is greater than operand 2. = : Test if operand 1 is equal to operand 2.B Numerical processing on integers General The numerical instructions described in this section apply to objects of the following type : bit tables. eg : OP5:=(OP1+OP2)*OP3-OP4. >= : Test if operand 1 is greater than or equal to operand 2. The result is 1 when the comparison requested is true. double words. words. These blocks can contain : a simple expression. Numerical instructions are entered in blocks : located in the test zone for comparison blocks. <> : Test if operand 1 is different from operand 2.
>=. Several assignment instructions can be linked within the same block : Op1:=Op2:=Op3:=Op4:=. Syntax : The following assignment operations can be performed : On bit tables On words or double words. Syntax Operators : >. Assignment of bit The following operations on bit tables can be performed : Bit table -> bit table Bit table -> word or double word (indexed) Word or double word (indexed) -> bit table ..<=..<> Assignment instructions These are used to load operand Op2 into operand Op1.Structure Comparison blocks are programmed in the test zone.=.<.
Assignment of words The following assignment operations onto words can be performed : word -> word word -> double word double word -> double word double word -> word immediate value -> word immediate value -> double word .
ABS INC. DEC Op1:=Op2 Operator Op3 Op1:=Operator(Op2) Operator Op1 .*./ SQRT.Arithmetic instructions on integers These instructions are used to perform arithmetic operations between two operands or on one operand.-. + * / : add two operands : subtract two operands : multiply two operands : divide two operands SQRT : square root of an operand INC : increment of an operand DEC : decrement of an operand ABS : absolute value of an operand Syntax Operators +.
Logic instructions The associated instructions are used to perform a logic operation between two operands or on one operand. AND OR XOR NOT : AND (bit-wise) between two operands : Logic OR (bit-wise) between two operands : Exclusive OR (bit-wise) between two operands : Logic complement (bit-wise) of an operand .
Program jumps Jump instructions allow connection to a line of programming identified by a label %Li : JMP JMPC JMPCN : unconditional program jump. Subroutine return Subroutine return instructions are reserved for subroutine modules and are used to return to the calling module. if the Boolean result of the preceding test instruction is 1. SRi represents the subroutine module called : i (number from 0 to 253). : program jump if the Boolean result of the preceding test instruction is 1.Program instructions Subroutine call Subroutine call instructions are used to call a subroutine module located in the same task. %Li represents the label of the line to which the connection is made (i number from 1 to 999 with up to 256 labels). : program jump if the Boolean result of the preceding test instruction is 0. .
NOP instruction The NOP instruction does not perform any operation. . Any instructions following the instruction HALT will therefore not be executed. This freezes the variable objects in this program.Stop program Execution of an application program can be stopped using the instruction HALT (stops all tasks). A program stopped in this way must be initialized to restart it (using the PL7 Micro command INIT). It is used for "reserving" lines in a program which allow the user to insert instructions later without modifying the line numbers.
Advanced predefined function blocks Monostable function block %MNi The monostable function block is used to create a pulse of an exact duration. . This duration is programmable and can be modified via the terminal.
first out) known as FIFO stack (First In.Register function block %Ri A register is a memory block which is used to store up to 255 words of 16 bits in two different ways : Queue (first in. first out) known as LIFO stack (Last In. First Out). First Out). . Stack (last in.
known as control bits. The retrieval request is made by input %I1. Mode : FIFO or LIFO.E=0).O is loaded into %MW20 if the register is not empty (%R2.2.3 and %R2. these high points are symbolized by state 1 for each step and are assigned to output bits %Qi. The storage request in the register is made by %M1. Length : 1 to 255. Drum controller function block %DRi The drum controller operates on a similar principle to an electromechanical drum controller.j or internal bits %Mi.The programming example shows word %MW34 being loaded into %R2. Drum controller block .I at the storage request %I1. if register R2 is not full (%R2. In the case of a drum controller. Configuration The following parameters must be entered in the variables editor of the register block : Numbers : 1 to 4. the high point of a cam gives an order which is executed by the control system. which changes step according to external events. On each step.F=0).
4 Bit .0 resets the outputs to step 0.4 are activated in succession each time input %I1. Configuration The following information is defined in the variables editor : Step number : 5. Assignment of control bits %Q2.0 to %Q2.0 %Q2.1 %Q2. Step 01234 0:10000 1:01000 2:00100 3:00010 4:00001 Time base. The state of the outputs (control bits) for each step of the drum controller.1 is set to 1.2 %Q2.3 %Q2. Input I1. the first 5 outputs %Q2.Programming and configuration In this example.
which is compatible with Series 7 PL7-2/3 blocks is used to provide control for time-delayed actions.Timer function block %Ti (Series 7) This timer function block. . The value of this delay is programmable and can be modified via the terminal.
Standard operations The Timer function block can be pro-grammed to perform the following func-tions : .
These two operands are either 16-bit words (possibly indexed) or immediate values. . Example of use The program below shows the comparison of word %MW2 indexed by word %MW40 with the immediate value 150. If the contents of %MW2[%MW40] are greater than 150 and %I1.Vertical comparison blocks Vertical comparison blocks are used to compare two operands (OP). coil %MW10:X4 is activated. coil %Q2.7 is activated. Operation When the command input is set to 1.3 = 1. the two operands are compared and the four outputs are activated according to the result of the comparison. If the contents are equal to 150. Setting the command input to 0 resets the activated outputs. Coil %M5 is only controlled if the contents are different from 150 (< or >).
SHR(op2.SHL(op2. Rotate shift : . .i) rotate shift of i positions to the left.i) rotate shift of i positions to the right.i) logic shift of i positions to the right.i) logic shift of i positions to the left.ROR(op2.ROL(op2. . . Logic shift : .Shift instructions Shift instructions consist of moving bits of a word or double word operand a certain number of positions to the right or to the left.
The floating point object format used is that of the IEEE standard. no more than six digits can be displayed after the comma.28 1.175494E-38 and 3. . which corresponds to single length floating point numbers.Floating point instructions General PL7 Micro software is used to perform operations on floating point objects. floating point word %MFi corresponds to single length words %MWi and %MWi+1 (word %MWi containing the least significant bits and word %MWi+1 containing the most significant bits of word %MFi). Words are 32 bits long.0". Notes The value "1285" is interpreted as an integer value.402824E+38 and -1.175494E-38. Examples of floating point values : 1285.28528E3 Floating point values are between -3. Thus. Representation is accurate to 2 -24 . The conversion instructions Integer <--> Floating Point are used to change from one format to the other. To be considered as a floating point value it must be written : "1285. Possibility of overlap between objects : The single and double length and floating point words are stored within the data area in a single memory zone. When viewing floating point numbers. and 1.402824E+38.
INT_TO_BCD : Binary --> BCD conversion. . REAL_TO_DINT : floating point word --> integer double word conversion (the result is the next lowest integer value).Numeric conversion instructions BCD <--> Binary conversion instructions There are two types of conversion instruction : BCD_TO_INT : BCD --> Binary conversion. DINT_TO_REAL : integer double word --> floating point word conversion. Integer <--> Floating point conversion instructions There are four conversion instructions : INT_TO_REAL : integer word --> floating point conversion. REAL_TO_INT : floating point word --> integer word conversion (the result is the next lowest integer value).
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.