Download Print this page

MIKRODEV MP110 Series Manual

Hide thumbs Also See for MP110 Series:

Advertisement

Quick Links

Programming
Manual
• MP110 and MP211 PLC Series
DOCUMENT NAME
MIKRODEV_SM_PLC_PM_EN
1
DATE
12 / 2024
MP110 and MP211 PLC SERIES/ Programming Manual
VERSION
Mikrodiagram 19.0.0
(Official Build)

Advertisement

loading
Need help?

Need help?

Do you have a question about the MP110 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for MIKRODEV MP110 Series

  • Page 1 Programming Manual • MP110 and MP211 PLC Series DOCUMENT NAME DATE VERSION 12 / 2024 Mikrodiagram 19.0.0 MIKRODEV_SM_PLC_PM_EN (Official Build) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 2 CONTENTS Preface ............................ 8 About Mikrodev ........................9 WARNING! ..........................10 LOGIC GATE BLOCKS ......................11 EDGE GATE ......................... 11 NOT GATE ........................14 OR GATE ........................16 NOR GATE ........................19 NAND GATE ........................ 22 AND GATE ........................25 XOR GATE ........................
  • Page 3 2.12 LOCKED RELAY OUTPUT BLOCK ..................84 CALIBRATION BLOCKS ...................... 88 SLOPE CALIBRATOR ..................... 88 POINT CALIBRATOR ..................... 91 DELAY/PULSE TIMERS ....................... 94 ON DELAY ........................94 OFF DELAY ........................97 ON/OFF DELAY ......................100 RETENTIVE ON DELAY ....................103 TIMER OUTPUT RELAY ....................
  • Page 4 LOGGER ........................198 REGISTER/VARIABLE BLOCKS ................... 200 WORD REGISTER ....................... 200 ANALOG REGISTER ....................203 LONG REGISTER ......................206 BINARY REGISTERS ....................210 BINARY FLAG ......................212 WORD FLAG ......................214 ANALOG FLAG ......................216 LONG FLAG ....................... 218 MODBUS PROTOCOL BLOCKS ..................220 10.1 MODBUS RTU MASTER ....................
  • Page 5 12.1 SERIAL PORT BLOCK ....................287 12.2 TCP SOCKET BLOCK ....................289 12.3 DNS BLOCK ......................294 TABLE BLOCKS ......................298 13.1 WORD TABLE ......................298 13.2 ANALOG TABLE ......................301 13.3 LONG TABLE ......................304 13.4 BIT TABLE ........................ 307 13.5 WORD TABLE OPERATION ...................
  • Page 6 17.2 WORD DUAL MULTIPLEXER ..................385 17.3 LONG DUAL MULTIPLEXER ..................387 17.4 ANALOG Dual Multiplexer .................... 389 MOTION CONTROL BLOCKS ................... 391 18.1 FAST COUNTER INPUT ....................391 18.2 PULSE WIDTH MODULATION (PWM) ................394 18.3 PULSE TRAIN OUTPUT ....................397 18.4 AXIS DEFINITON .......................
  • Page 7 21.12 NTP SYNCRONISE BLOCK ................... 443 21.13 SAVE TIME ........................ 446 21.14 TIME PLAN PICKER ....................448 MACRO BLOCKS ......................451 22.1 MACRO ........................451 MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 8 Preface Mikrodev MP110 and MP211 PLC series are programmable control devices used in a wide range of areas from process automation to building automation, from machine automation to telemetry applications. The Function Block Diagram – FBD language defined in the IEC 61131-3 standard is used for programming PLC devices.
  • Page 9 MIKRODEV is one of the few companies in the world that has its own designed IEC 61131-3 compliant library for its programmable logic control devices. In addition, the open, flexible, programmable SCADA solution developed by MIKRODEV is also available to customers.
  • Page 10 WARNING! Use the programming editor only for Mikrodev Certified devices ✓ When you change your physical hardware configuration, update your development to ✓ the appropriate version. The developed program should be tested separately before taking to field service and ✓...
  • Page 11 LOGIC GATE BLOCKS 1.1 EDGE GATE 1.1.1 Connections I: Signal input R/F: Rising or falling edge selection #EDG0: Output of the block O/F: One/Full cycle selection Res: Reset pin 1.1.2 Connection Explanations I: Signal input It is the input that detects edge state. R/F: Rising or/and falling edge selection It is used for choosing rising or falling edge detection from outside of the block.
  • Page 12 1.1.3 Block Settings Signal Edge: R/F: It has the same purpose with rising or/and falling edge selection pin. Rising, Falling or Rising/Falling options are available. Cycle Type: O/F: It has the same purpose with one/full cycle selection pin. One cycle or full cycle options are available. 1.1.4 Block Explanation Edge Gate block is used for edge triggering purposes.
  • Page 13 1.1.4.1 Truth Table Previous I Current I Previous Current #EDG0 #EDG0 1.1.4.2 Signal Flow Diagram MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 14 NOT GATE 1.2.1 Connections I1: Signal input #NOT0: Output of the block 1.2.2 Connection Explanations I1: Signal input It is the input of the NOT gate. #NOT0: Output of the block It is the output of the NOT gate. 1.2.3 Block Settings There are no block settings.
  • Page 15 1.2.4.2 Signal Flow Diagram 1.2.5 Sample Application In the example, HIGH and LOW signals are inverted using NOT Gate. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 16 OR GATE 1.3.1 Connections I1: Signal input I2: Signal input #OR0: Output of the block I3: Signal input I4: Signal input 1.3.2 Connection Explanations I1: Signal input It is the input of the OR gate. I2: Signal input It is the input of the OR gate. I3: Signal input It is the input of the OR gate.
  • Page 17 1.3.4.1 Truth Table for Two Inputs Input 1 Input 2 Output 1 1.3.4.2 Truth Table for Three Inputs Input 1 Input 2 Input 3 Output 1 MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 18 1.3.4.3 Truth Table for Four Inputs Input 1 Input 2 Input 3 Input 4 Output 1 MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 19 NOR GATE 1.4.1 Connections I1: Signal input I2: Signal input #NOR0: Output of the block I3: Signal input I4: Signal input 1.4.2 Connection Explanations I1: Signal input It is the input of the NOR gate. I2: Signal input It is the input of the NOR gate. I3: Signal input It is the input of the NOR gate.
  • Page 20 1.4.4.1 Truth Table for Two Inputs Input 1 Input 2 Output 1 1.4.4.2 Truth Table for Three Inputs Input 1 Input 2 Input 3 Output 1 MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 21 1.4.4.3 Truth Table for Four Inputs Input 1 Input 2 Input 3 Input 4 Output 1 1.4.5 Sample Application 1.4.5.1 High Output MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 22 1.4.5.2 Low Output NAND GATE 1.5.1 Connections I1: Signal input I2: Signal input #NAND0: Output of the block I3: Signal input I4: Signal input 1.5.2 Connection Explanations I1: Signal input It is the input of the NAND gate. I2: Signal input It is the input of the NAND gate.
  • Page 23 I3: Signal input It is the input of the NAND gate. I4: Signal input It is the input of the NAND gate. #NAND0: Output of the block It is the output of the NAND gate. 1.5.3 Block Settings There are no block settings. 1.5.4 Block Explanation Performs the logic NAND operation to the input signals.
  • Page 24 1.5.4.3 Truth Table for Four Inputs Input 1 Input 2 Input 3 Input 4 Output 1 1.5.5 Sample Application 1.5.5.1 HIGH Output MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 25 1.5.5.2 LOW Output AND GATE 1.6.1 Connections I1: Signal input I2: Signal input #AND0: Output of the block I3: Signal input I4: Signal input 1.6.2 Connection Explanations I1: Signal input It is the input of the AND gate. I2: Signal input It is the input of the AND gate.
  • Page 26 I4: Signal input It is the input of the AND gate. #AND0: Output of the block It is the output of the AND gate. 1.6.3 Block Settings There are no block settings. 1.6.4 Block Explanation Performs the logic AND operation to the input signals. To use this block, at least two inputs must be connected.
  • Page 27 1.6.4.3 Truth Table for Four Inputs Input 1 Input 2 Input 3 Input 4 Output 1 1.6.5 Sample Application 1.6.5.1 HIGH Output MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 28 1.6.5.2 LOW Output XOR GATE 1.7.1 Connections I1: Signal input I2: Signal input #XOR0: Output of the block I3: Signal input I4: Signal input 1.7.2 Connection Explanations I1: Signal input It is the input of the XOR gate. I2: Signal input It is the input of the XOR gate.
  • Page 29 It is the input of the XOR gate. I4: Signal input It is the input of the XOR gate. #XOR0: Output of the block It is the output of the XOR gate. 1.7.3 Block Settings There are no block settings. 1.7.4 Block Explanation Performs the logic XOR operation to the input signals.
  • Page 30 1.7.4.3 Truth Table for Four Inputs Input 1 Input 2 Input 3 Input 4 Output 1 1.7.5 Sample Application 1.7.5.1 HIGH Output MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 31 The output of the High Gate block is connected to the input of the Relay Output block. If Mikrodev PLC system is ON, the output value of the Relay Output block will be high(1), otherwise, the output of the Relay Output block will be low(0).
  • Page 32 The output of the Gate Low block is connected to the input of the Not Gate block. The output of the Not Gate block is also connected to the input of the Digital Output block. If Mikrodev PLC system is on, the Digital Output block output will be high (1), otherwise the Digital Output block output will be low (0).
  • Page 33 1.10 IMPULSE RELAY 1.10.1 Connections Trg: Trigger input Set: Block set input #IRLY0: Output of the block Res: Block reset input 1.10.2 Connection Explanations Trg: Trigger input Retrieves not the current state of the block output when a rising edge trigger is sent to the “Trg” input.
  • Page 34 block, the block output “#IRLY0” goes high (1). While the block output is high (1), the block output “#IRLY0” goes low (0) when a rising edge trigger (1) signal is applied to the “Trg” block input. When the “Set” block input is high (1), the block output “#IRLY0” always goes high (1) if the “Sif” input of the block is not high (1).
  • Page 35 1.10.4.2 Signal Flow Diagram Block Output with Trg Input (#IRLY0) Block Output with Set and Res Input (#IRLY0) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 36 1.10.5 Sample Application 1.10.5.1 Trg Input The “#IRLY0” position of the block output is observed in the example, depending on the rising edge trigger coming to the “Trg” block input. Initially, the “Trg” block input and the block output “#IRLY0” are low (0), while the “Trg” input of the block is high (1), the block output “#IRLY0” is also high (1).
  • Page 37 1.10.5.2 Set Input In the example, with the rising edge trigger coming to the “Set” input of the block, the block output “#IRLY0” has moved to the high (1) position. Although the “Set” block input went low (0), the block output “#IRLY0” kept its high (1) position. When a high (1) signal is applied to the “Res”...
  • Page 38 1.11 SHIFT BLOCK 1.11.2 Connections In: Value input to shift Loa: Value loading input #Shft0: Output of the block Dir: Direction input Clk: Start shifting input 1.11.3 Connection Explanations In: Value input to shift The “In” block input is the value input to be shifted. Loa: Value loading input In order for the value of the "In"...
  • Page 39 1.11.4 Block Settings Write On Input: If selected, the shifted value overwrites the value in the "In" input of the block. Direction: Right: If when selected, shifting is done to the right. (divide by two.) Left: If when selected, shifting is done to the left. (divide by two) 1.11.5 Block Explanation The Shift block is used when a value is shifted to the right or left.
  • Page 40 The working logic of the shift block, the register data at the input of the "In" block, when a high level signal is applied to the "Loa" input of the block, the data to be shifted is taken into the block.
  • Page 41 In the example, the right shift is done. The value in the "In" block input is included in the Shift block and divided by 2. After the value to be shifted is written to the “In” input of the block, the “Loa”...
  • Page 42 block input is reset and in picture (4), the value in the block is shifted to the left in each rising edge trigger that comes to the "Clk" block input. (Multiplied by 2.) 1.12 BİT MERGE BLOCK 1.12.7 Connections Bin: 0. Bit input İki: 1.
  • Page 43 5. Bit identification input İki: 6. Bit input 6. Bit identification input İki: 7. Bit input 7. Bit identification block #BMB0: Output of the block Output where bits are combined and written in decimal 1.12.9 Block Settings There are no block settings. 1.12.10 Block Explanations It is used to combine a maximum of 8 bits in binary and transfer them to the block output as 1 byte.
  • Page 44 1.12.11 Sample Application 1.12.11.1 8 Bit Merge In the example, if the 0, 3 and 7 bits of the bit Bit Merge block are high (1) and the other bits are low (0), the decimal values of the bits are seen at the output of the block. In the 1st picture;...
  • Page 45 In the 3rd picture; Since the 0th, 3rd, and 7th bit inputs are in the high (1) position; The decimal equivalent of the 0th, 3rd, and 7th bits is written to the block output as (1+8+128) =137. 1.12.11.2 16 Bit Merge 16 bits can be combined using 2 Bit Merge blocks.
  • Page 46 In the example, bit 0 of the Bit Merge block connected to the “InA” input of the Word Math block is high (1) and the decimal number value is 2⁰=1. Bit 0 of the Bit Merge block connected to the “InB” input of the Word Math block is high (1) and 2⁰*256=256 since this value will be transferred to the Word Math block output by multiplying by 256.
  • Page 47 1.13.2 Connection Explanations I1: Signal input It is the 1st input of the Custom Gate block. I2: Signal input It is the 2nd input of the Custom Gate block. I3: Signal input It is the 3rd input of the Custom Gate block. I4: Signal input It is the 4th input of the Custom Gate block.
  • Page 48 1.13.4 Block Explanation It allows the user to design a desired type of logic gate with the selections made from the Block Settings. According to the position of the inputs from the Block Settings, the user can choose which value to be displayed in the output. 1.13.5 Sample Application In the example, in the selections made from the block properties, if the “I1”...
  • Page 49 INPUT-OUTPUT BLOCKS 2.1 DIGITAL INPUT BLOCK 2.1.1 Connections #DI0: Output of the block 2.1.2 Connection Explanations #DI0: Output of the block Output of the block which represents the digital input 2.1.3 Block Settings Reserved Digital Input No: Digital input index no can be assigned in Block Settings.
  • Page 50 2.1.4 Block Explanation It is used to read the physical digital input on the device. Used for the inputs on the main unit and expansion units. Digital Input block is an input which takes binary (0,1) values. Some examples are optical sensors and switches.
  • Page 51 DIGITAL OUTPUT BLOCK 2.2.1 Connections I1: I nput of the block #DQ0: Output of the block 2.2.2 Connection Explanations I1: Input of the block Input of the block for the value which will be written to the digital output #DQ0: Output of the block Output of the block which represents the value of the digital output.
  • Page 52 2.2.4 Block Explanation It is used to write values to the physical digital outputs on the device. Used for the outputs on the main unit and the expansion units. Digital Output block is an output which takes binary (0,1) values. Available outputs are listed while selecting the digital output in block settings menu.
  • Page 53 ANALOG INPUT BLOCK 2.3.1 Connections #AI0: Output of the block 2.3.2 Connection Explanations #AI0: Output of the block Output of the block which represents the analog input. 2.3.3 Block Setings Reserved Analog Input No: Analog input index can be selected within the block. 2.3.4 Block Explanation It is used to read physical analog input on the device.
  • Page 54 Range of the input is also determined by the hardware.(i.e. 0-10mV, 0, 20mA…) It is assumed that the developer has that information. The value read on the output of the block is floating point value. For example, if 12.48 mA current is applied to the analog input, the output of the block will have the value 12.48.
  • Page 55 ANALOG OUTPUT BLOCK 2.4.1 Connections I1: Input of the block #AQ0: Output of the block 2.4.2 Connection Explanations I1: Input of the block Input of the block for the value that will be written to the analog output. #AQ0: Output of the block Output of the block which represents the value of the analog output.
  • Page 56 2.4.4 Block Explanation It is used to write values to the physical analog outputs on the device. Used for the outputs on the main unit and the expansion units. It is decided by the hardware that the output is a voltage output or current output. Range of the output is also decided by the hardware.(i.e.
  • Page 57 RELAY OUTPUT BLOCK 2.5.1 Connections I1: Input of the block #RQ0: Output of the block 2.5.2 Connection Explanations I1: Input of the block Input of the block for the value which will be written to the relay output. #RQ0: Output of the block Output of the block which represents the value of the relay output.
  • Page 58 2.5.4 Block Explanation It is used to write values to the physical relay outputs on the device. Used for the outputs on the main unit and expansion units. Relay Output block is an output which takes binary values.(0,1). Available relay outputs are listed while selecting the relay output in block settings menu. Relay outputs, which are used before, will not be listed.
  • Page 59 RTD INPUT BLOCK 2.6.1 Connections #RTD0: Output of the block 2.6.2 Connection Explanations #RTD0: Output of the block Output of the block, which represents the RTD input. 2.6.3 Block Settings Reserved RTD Input Number: RTD input number can be assigned in Block Settings. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 60 2.6.4 Block Explanation It is used to read physical RTD inputs on the device. It is used for the inputs on the main unit and expansion units. RTD Input block corresponds to one of the resistance thermometers, PT100, PT1000 or NTC. Type of the thermometer is determined by the hardware and it is assumed that the developer has the required information.
  • Page 61 The temperature sensor was connected to the RTD input and the air conditioning heating temperature control was performed with the hysteresis block. With the hysteresis block, the low limit and high limit are selected with as minimum temperature of 21 degrees and as maximum of 23 degrees.
  • Page 62 LOCKED DIGITAL INPUT BLOCK 2.7.1 Connections #LDI0: Real binary input LSt: Lock state LVa: Lock value 2.7.2 Connection Explanations #LDI0: Real binary input Locked digital input block value. LSt: Lock state Indicates whether the block is locked or not. LVa: Lock value Indicates the value which will be written to the output when locked.
  • Page 63 2.7.3 Block Settings Reserved Digital Input Number: Digital input index number can be assigned in Block Settings. Locked: Locking settings of the block. Activates or deactivates locking. Lock / Offset: Lock: Writes the value at the lock or shift box to the output.
  • Page 64 LSt (the second output of the block): Indicates the state of the block. If locking is active, it is high(1), otherwise it is low(0). This output is mapped into Modbus addresses and can be read and written remotely. The Modbus address of this value is “block output’s modbus address plus 1”.
  • Page 65 The example is designed to accept a value of 0 in the digital input when the actual signal value to the digital input is not desired. (sensor failure, etc.). The block "Bin" output has the actual value read from the digital input according to the picture(1).
  • Page 66 2.7.5.2 Locking to One (1) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 67 The example is designed to accept a value of 1 in the digital input when the actual signal value to the digital input is not desired. (sensor failure, etc.). The block "Bin" output has the actual value read from the digital input according to the picture(1).
  • Page 68 2.8.3 Block Settings Reserved Analog Input Number: Analog input index number can be assigned in Block Settings. Locked: Locking settings of the block. Activates or deactivates locking Lock / Offset: Lock: Write the value at the lock or shift box to the output.
  • Page 69 LSt (the second input of the block): Indicates the state of the block. If the block is locked(active) and the specified value will be written to the output it is 1.0; if the block is locked(active) and an offset value will be added to the real value it is 2.0; if the block is not locked(passive) it is 0.0.
  • Page 70 In the example, the actual signal value for the device analog input is 5.95. When the block “LSt” output is 0, the actual value of the analog input is written to the “Ana” output. (Picture1) In the case where the analog input actual value is not desired to be used, LSt output is set to 1 and the locking value at the LVa output is written to the block "Ana"...
  • Page 71 In the example, when the output LSt is 0, the analog input actual signal value is written to the block output. On Figure 2, 2 is written on LSt Output. To add the value at the LVa output to the actual signal value, a value of 2 is written to the LSt output.
  • Page 72 LVa: Lock value Indicates the value which will be written/added to the output when locked. 2.9.3 Block Settings Reserved RTD Input Number: RTD input number can be assigned in Block Settings. Locked: Locking settings of the block. Activates or deactivates locking Lock / Offset: Lock: Write the value at the lock or shift box to the output.
  • Page 73 Offset property of the Locked RTD Input blocks, being different from the other locked blocks, is used to correct the cable resistance error between the RTD and the device. For example, a PT1000 sensor which is 300 meters away from the unit has a cable resistance around 35 Ohms.
  • Page 74 2.9.5 Sample Applications 2.9.5.1 Locking a Value In the example, the device shows the actual signal value -200 from the RTD temperature input. This value means that the sensor is not connected to the RTD input or there is a problem with the connected sensor or cable line.
  • Page 75 2.9.5.2 Adding Offset Value to Actual Value In this example, there is a problem with the sensor or sensor connection in Figure 1. In Figure 2, it is written to LSt output 2 and the offset is added. The process of adding offset is in Ohms.
  • Page 76 2.10 LOCKED DIGITAL OUTPUT BLOCK 2.10.1 Connections #LDO0: Real binary output I1: Block input LSt: Lock state LVa: Lock value 2.10.2 Connection Explanations I1: Block input Indicates the value which will be written to the output when unlocked. #LDO0: Real binary output Locked digital output block value.
  • Page 77 2.10.3 Block Settings Reserved Digital Output Number: Digital output number can be assigned in Block Settings. Locked: Locking settings of the block. Activates or deactivates locking Lock / Offset: Lock: Write the value at the lock or shift box to the output.
  • Page 78 read and written remotely. The Modbus address of the output is “the block output’s modbus address plus 1”. LVa (the third output of the block): Indicates the value, which will be written to the output when the block is locked. This output is mapped into Modbus addresses and can be read and written remotely.
  • Page 79 In this project, the output of the Digital Input (DI0) block is connected to the Locked Digital Output block input. Locking is not active in LDO block; The LDO block 'Bin' output will be 1 when the DI0 block is 1. The LDO block 'Bin' output will be 0 when the DI0 block is 0.
  • Page 80 Locked analog output block value. LSt: Lock state Indicates whether the block is locked or not. LVa: Lock value Indicates the value which will be written to the output when locked. 2.11.3 Block Settings Reserved Analog Output Number: Analog output number can be assigned in Block Settings.
  • Page 81 In order for the logic project to run properly, until the error is fixed, erroneous value should be ignored and some proper value must be forced onto input. Locked blocks are used to treat situations like this. #LAO0 (the first output of the block): If the block is locked, the value at the first output of the block is equal to the locked value in the block settings.
  • Page 82 2.11.5 Sample Applications 2.11.5.1 Locking a Value In the sample project, the output of the Analog Input block is connected to the Locked Analog Output (LOA) block input. When locking is not active in LOA block; The LOA block “Ana” output will be 4.92 when the AI0 block is 4.92.
  • Page 83 2.11.5.2 Adding Offset Value to Actual Value Locking active: Locking is active because LSt output is 1 in Figure1 and 8.2 value on LVa output is written to the "Ana" output of the block. Shift active: The shift is active in Figure 2 because LSt output is 2, the value of 8.2 in the LVa output and the value of AI0 signal in the LOA block input have been collected and written to the block "Ana"...
  • Page 84 2.12 LOCKED RELAY OUTPUT BLOCK 2.12.1 Connections #LRO0: Relay lock output I1: Block input LSt: Lock state LVa: Lock value 2.12.2 Connection Explanations I1: Block input Indicates the value which will be written to the output when unlocked. #LRO0: Relay lock output Locked relay output block value.
  • Page 85 2.12.3 Block Settings Reserved Relay Output Number: Relay output index number can be selected here Locked: Locking settings of the block. Activates or deactivates locking Lock / Offset: Lock: Write the value at the lock or shift box to the output.
  • Page 86 LSt (the second output of the block): Indicates the state of the block. It is 1 if the block is locked(active), 0 otherwise(passive). This output is mapped into Modbus addresses and can be read and written remotely. The Modbus address of the output is “the block output’s Modbus address plus 1”.
  • Page 87 2.12.5 Sample Applications In the Mikrodiagram example, the output of the Digital Input block is connected to the Locked Relay input (LRO). When Locking is not active in the LRO block; The LRO block "Ana" output will also be 1 when the DI0 block is 1.
  • Page 88 Locking active: Locking is active because LSt output 1 is shown in figure2. 0 at the LVa output is written to the block output. Locking active: Locking is active because LSt output 1 is shown in figure3. 1 at the LVa output is written to the block output.
  • Page 89 3.1.3 Block Settings Y: Q1 is the calibrated block output value. X: I1 is the uncalibrated block input value. m: The value of m in the equation Y = mX + c is the non-calibrated I1 input multiplier coefficient. c: The value “c” in the equation Y = mX + c is the uncorrelated total coefficient for I1 input.
  • Page 90 3.1.4 Block Explanation The slope calibrator block means that an analogue value is processed as "Y = mX + c". The m and c values are coefficient values set from the block options. The “X“ value is the input (I1) of the block and the value of Y is the output (Q1) of the operation. 3.1.5 Sample Applications This is an example of connection of slope calibrator.
  • Page 91 POINT CALIBRATOR 3.2.1 Connections In: Signal input X1: Signal input low limit Y1: Signal output low limit #PCa0: Block output X2: Signal input upper limit Y2: Signal output upper limit Trg: Trigger input 3.2.2 Connection Explanations In: Signal input The signal input to be calibrated. X1: Signal input low limit The X value of the first point of calibration.
  • Page 92 3.2.3 Block Settings First point (X): The value of the signal at the input of First point (Y): The value of the signal at the output of Out. Second point (X): The value of the signal at the input of In. Second point (Y): The value of the signal at the output of Out.
  • Page 93 3.2.5 Sample Application The minimum value that can be input to the In input is "X1 = 4" and the maximum value is entered as "X2 = 20". The minimum value that can be read from the Out’s output is entered as "Y1 = 0", "Y2 = 100". Out is "0"...
  • Page 94 DELAY/PULSE TIMERS 4.1 ON DELAY 4.1.1 Connections Trg: The input of block trigger #OnD0: Block output T: The time of on delay 4.1.2 Connection Explanations Trg: The input of block trigger It is the block signal input. T: The time of on delay This is the input is used to set the delay time if you require to change delay time using the block input connection #OnD0: Block output...
  • Page 95 4.1.3 Block Settings Initial Value (T): The on delay can be set in the block. Unit: Unit of time is selected. This selection has following options: milliseconds, seconds, minutes, hours. 4.1.4 Block Explanation If TRG input change its state to Logic(1) and stay in this state during the determined delay time interval, Q1 output signal change its state from logic(0) to logic(1) after end of the delay time period.
  • Page 96 4.1.4.1 Signal Flow Diagram 4.1.5 Sample Application When DI0 goes to logic(1) ,after 3 seconds the DQ0 goes to logic(1).When DI0 goes to logic(0), DQ0 goes to logic(0), immediately. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 97 4.2 OFF DELAY 4.2.1 Connections Trg: The input of block trigger #OfD0: Block output T: The time of off delay 4.2.2 Connection Explanations Trg: The input of block trigger It is the block signal input. T: The time of off delay This is the input is used to set the delay time if you require to change delay time using the block input connection #OfD0: Block output...
  • Page 98 4.2.3 Block Settings Initial Value (T): The off delay can be set in the block Unit: Unit of time is selected. This selection has following options: milliseconds, seconds, minutes, hours. 4.2.4 Block Explanation If TRG input change its state to Logic(0) and stay in this state during the determined off delay time interval, Q1 output signal change its state from logic(1) to logic(0) after end of the delay time period.
  • Page 99 4.2.4.1 Signal Flow Diagram 4.2.5 Sample Application When DI0 goes to logic(0) ,after 3 seconds the DQ0 goes to logic(0).When DI0 goes to logic(1), DQ0 goes to logic(1), immediately. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 100 4.3 ON/OFF DELAY 4.3.1 Connections Trg: The input of block trigger tH: The input of time of on delay #OnfD0: Block output tL: The input of time of off delay 4.3.2 Connection Explanations Trg: The input of block trigger It is the block signal input. tH: The input of time of on delay This is the input is used to set the ON delay time if you require to change ON delay time using the block input connection...
  • Page 101 4.3.3 Block Settings On Time Initial Value (tH): The on delay can be set in the block Off Time Initial Value (tL): The of off delay can be set in the block Unit of time is selected. This selection has following options: milliseconds, seconds, minutes, hours.
  • Page 102 4.3.4.1 Signal Flow Diagram 4.3.5 Sample Application The on / off delay timing scale "seconds" is selected and the tH and tL values are entered from outside the block. DQ0 becomes logic (1) 3 seconds after the DI0 logic (1) becomes logic (0). DQ0 is logic (0) after 10 seconds from the logic (1) to the logic (0).
  • Page 103 4.4 RETENTIVE ON DELAY 4.4.1 Connections Trg: The input of block trigger Rst: The input of reset #RoD0: Block output T: The input of on delay time 4.4.2 Connection Explanations Trg: The input of block trigger It is the block signal input. Rst: The input of reset Raising edge at RST input signal resets permanent Logic (1) state and re-initiate the block.
  • Page 104 4.4.3 Block Settings İnitial Value (T): The time of on delay is set in the block Unit: Unit of time is selected. This selection has following options: milliseconds, seconds, minutes, hours. 4.4.4 Block Explanation If TRG input change its state to Logic(1) and stay in this state during the determined delay time interval, Q1 output signal change its state from logic(0) to logic(1) after end of the delay time period.
  • Page 105 4.4.4.1 Signal Flow Diagram 4.4.5 Sample Application Retentive on delay block timing scale "seconds" is selected and T value is entered from outside the block. After 5 seconds from DI1 logic (1) to logic (0), DQ1 becomes logic (1). When DQ1 is logic (1), DQ1 maintains the logic (1) position even if DI1 is logic (0). At the rising edge of the logic (1) signal, called Rst input DI2, DQ1 goes to logic (0) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 106 4.5 TIMER OUTPUT RELAY 4.5.1 Connections Trg: The input of block trigger #TOR0: Block output T: The input of timer parameter 4.5.2 Connection Explanations Trg: The input of block trigger It is the block signal input. T: The input of timer parameter This is the input is used to set the delay time if you require to change delay time using the block input connection #TOR0: Block output...
  • Page 107 4.5.4 Block Explanation When the Trg input change its state from Logic(0) to Logic(1), Q1 output changes its state immediately to Logic(1). Block keep its Q1 Logic(1) state only user defined duration of time and after that time period expire, Q1 state goes to Logic(0) state automatically. As soon as received Logic(0) signal at Trg input, Q1 output state is changed to Logic(0) T value can be written in block Block Settings.
  • Page 108 Timer output relay timer period is choosen as seconds from the blocks, T value is entered from the out of block. When DI0 is logic(1), DQ0 will be logic(1).When DI0 is logic(1), after 5 seconds DQ0 will be logic(0). 4.6 SYMETRIC PULSE GENERATOR 4.6.1 Connections Ena: The input of block activation #SPG0: Block output...
  • Page 109 4.6.3 Block Settings Initial Value (T): Timer parameter is set from in the block. Unit: Unit of time is selected. This selection has following options: milliseconds, seconds, minutes, hours. 4.6.4 Block Explanation When Enb input is logic(1), Q1 block output produces periodic symetric pulses in 2*T time period as Logic(0) for T period of time and Logic(1) for T period of time.
  • Page 110 4.6.4.1 Signal Flow Diagram 4.6.5 Sample Application When DI0 is logic(1), DQ0 will be 5 seconds logic(0), 5 seconds logic(1) periodically. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 111 4.7 REAL TIME PULSE GENERATOR 4.7.1 Connections #RTPG0: Block output 4.7.2 Connection Explanations #RTPG0: Block output It is the block output which produce the logic(1) pulse in is described from in the block in the timer period. 4.7.3 Block Settings Timing : Pulse period choice can be done from in the block.
  • Page 112 Output of the block is a single cycle time pulse that is generated every specified time events. 4.7.4.1 Signal Flow Diagram In the example timer parameter is choosen in every minutes in the real time pulse generator And the device is started at time 15:27:12. So, In real time events of minutes was gained logic pulse output.
  • Page 113 4.7.5 Sample Application In the example, the Real-Time Pulse Generator (GZDU) block is programmed to generate a pulse every 10 seconds. With the GZDU block connected to the “Trg” input of the Word Math block, the values in the block inputs were collected every 10 seconds and written to the block output.
  • Page 114 MATHEMATICAL OPERATION BLOCKS WORD COMPARATOR 5.1.1 Connections inA: 1. Word input inB: 2. Word input #WKrş0: Output of the block inC: 3. Word input Ena: Enable Input 5.1.2 Connection Explanations inA: 1. Word input Word value to be compared. inB: 2. Word input Word value to be compared.
  • Page 115 5.1.3 Block Settings Compare Type: Comparison type is specified here. INB: Bottom threshold value is entered here in Block Settings. INC: Upper threshold value is entered here in Block Settings. 5.1.4 Block Explanation It is used for comparing 16-bit WORD numbers. (0-65535) The value at the “inA” input of theblock is compared to the values at the “inB”...
  • Page 116 For the operations “in range” and “out of range”; the value at the inA input of the block is compared to the values at the “inB” and “inC” inputs of the block. If “in range” or “out of range” operations are going to be used, the value at the “inB” input of the block should be smaller than the value at the “inC”...
  • Page 117 5.1.5 Sample Application In this example, comparison type is selected as “In Range”. The block is enabled with the HIGH signal at the “Enb” input of the block, while the value at the “inA” input of the block has a value between the value at the “inB” input of the block (bottom threshold) and the value at the “inC”...
  • Page 118 ANALOG COMPARATOR 5.2.1 Connections inA: 1. Analog Input inB: 2. Analog Input #AComp0: Output of the block inC: 3. Analog Input Ena: Enable input 5.2.2 Connection Explanations inA: 1. Analog input Analog value to be compared. inB: 2. Analog input Lower analog threshold value to be compared.
  • Page 119 5.2.3 Block Settings Compare Type: Comparison type is specified here. INB: Bottom threshold value is entered here in Block Settings. INC: Upper threshold value is entered here in Block Settings. 5.2.4 Block Explanation It is used for comparing 32-bit floating point numbers. The value at the “inA” input of the block is compared to the values at the “inB”...
  • Page 120 For the operations “greater than”, “smaller than”, “greater than or equal to”, “smaller than or equal to”, “not equal to”; the value at the “inA” input of the block is compared to the value at the “inB” input of the block. For the operations “in range”...
  • Page 121 5.2.5 Sample Application In this example, comparison type is selected as “Out of Range”. The block is enabled with the HIGH signal at the Enb input of the block, while the value at the inAinput of the block does not have a value between the value at the inB input of the block (bottom threshold) and the value at the inC input of the block (upper threshold), the output is HIGH or “1”, therefore the Relay Output takes the “1”...
  • Page 122 LONG COMPARATOR 5.3.1 Connections InA: 1. Long input InB: 2. Long input #LCmp0: Output of the block InC: 3. Long input Ena: Enable input 5.3.2 Connection Explanations InA: 1. Long input Long value to be compared. InB: 2. Long input Bottom long threshold value to be compared.
  • Page 123 5.3.3 Block Settings Compare Type: Comparison type is specified here. INB: Bottom threshold value is entered here in Block Settings. INC: Upper threshold value is entered here in Block Settings. 5.3.4 Block Explanation It is used for comparing 32-bit signed numbers. The value at the “inA” input of the block is compared to the values at the “inB”...
  • Page 124 For the operations “greater than”, “smaller than”, “greater than or equal to”, “smaller than or equal to”, “not equal to”; the value at the “inA” input of the block is compared to the value at the “inB” input of the block. For the operations “in range”...
  • Page 125 5.3.5 Sample Application In this example, comparison type is selected as “Greater”. The block is enabled with the HIGH signal at the Enb input of the block, while the value at the inA input of the block has a value equal to the value at the inB input of the block(lower threshold), so the output is LOW or “0”, therefore the Relay Output takes the “0”...
  • Page 126 WORD MATH 5.4.1 Connections inA: WORD data input inB : WORD data input #WMat0: WORD output Trg: Trigger input 5.4.2 Connection Explanations inA: WORD input WORD value to be processed. inB: WORD input WORD value to be processed. Trg: Trigger input If the “On When Trig is Active”...
  • Page 127 5.4.3 Block Settings Math Type: Mathematical operation is specifed here. INB: WORD input to be processed. On When Trig is Active: If selected, block is activated at each rising edge detected at the Trg input of the block Write On Input: If this option is selected, the value at the inA input of the block and the value at the inB input of the block is processed.
  • Page 128 Write on Input: If this option is selected, the value at the “inA” input of the block and the value at the “inB” input of the block is processed. Result of the operation is written on the “inA” input of the block.
  • Page 129 The bits of the value at the “inA” input are shifted right by the value at the “inB” and the result is written to the “#WMat0” output of the inA, inB SHIFT RIGHT block. If “Write on Input” is selected, the result is written to the “WMat0”...
  • Page 130 It is used to set the index of the “inA” block input value bits in the “INB” value in the block options section to 0 or 1. The bit value to be written is determined by the “inB” block input value. The result of the inA, inB, INB BIT REPLACE operation is written to the “#WMat0”...
  • Page 131 5.4.4.1 GET Operation Special Commands When performing GET operation, if some special values are entered to the “inB” input of the block then some special operations are performed by the block. Diagram below shows the commands and the related operations to the commands. inB Value Function Explanation 20000...
  • Page 132 Subtraction examples: In sub_1 example, the value at the “inA” of the block is subtracted from the “inB” input of the block and the result is written to the “O1” output of the block. In sub_2 example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the “inA”...
  • Page 133 Multiplication examples; In Multiplication1 example, the value at the “inA” input of the block is multiplied by the “inB” input of the block and the result is written to the “O1” output of the block. In Multiplication2 example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the “inA”...
  • Page 134 Division examples; In Division1 example, the value at the “inA” input of the block is divided by the “inB” input of the block and the result is written to the “O1” output of the block. In Division2 example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the “inA”...
  • Page 135 AND and OR examples: Corresponding binary value of the decimal value at the inA: (10) =(01010) Corresponding binary value of the decimal value at the inB: (24) (11000) The result of bitwise AND operation between inA and inB is: (8) =(01000) The result of bitwise OR operation between inA and inB is: (26) =(11010)
  • Page 136 Exclusive OR(XOR) and Mod examples; Corresponding binary value of the decimal value at the inA: (13) =(01101) Corresponding binary value of the decimal value at the inB: (20) (10100) The result of bitwise XOR operation between inA and inB is: (25) =(11001) In Mod example, the value at the “inA”...
  • Page 137 Shift Left and Shift Right examples: Corresponding binary value of the decimal value at the inA: (8) =(01000) The value at the “inB” input specifies the number of bits which “inA” is going to be shifted by. After the shifting operation, result is written to the “O1” output of the block. Shift Left: When 8 is shifted left by 1: (16) =(10000) is obtained.
  • Page 138 Check Bit examples; Corresponding binary value of the decimal value at the inA: (21) =(10101) The value at the “inB” input specifies the index of the bit which is going to be checked. After the checking process, checked bit is written to the “O1” output of the block. In Check Bit 1 example, the value of the checked bit is (10101) In Check Bit 2 example, the value of the checked bit is (10101) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 139 Absolute value examples: Distance of the value at the inA to the origin is written to the O1 output. In “AbsoluteValue1” example, distance of 5 to the origin is 5. In “AbsoluteValue2” example, distance of -5’ to the origin is 5. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 140 Low Limit examples: Low limit value is connected to the “inA” input of the block using a WORD register. In Low Limit 1 example, low limit is not activated. Since the value at the “inB” input is greater than the low limit, the value at the “inB” is written to the “O1” output of the block. In Low Limit 2 example, low limit is activated.
  • Page 141 High limit examples: High limit value is connected to the “inA” input of the block using a WORD register. In High Limit 1 example, high limit is not activated. Since the value at the “inB” input is smaller than the low limit, the value at the “inB” is written to the “O1” output of the block. In High Limit 2 example, high limit is activated.
  • Page 142 Merge A-B example: An 8 bit merge block is connected to “inA” input of the block and an other 8 bit merge block is connected to “inB” input of the block. The value at the “inB” block is shifted left by 8 bits and added to the value at the “inA”...
  • Page 143 Set example; The value to be set is connected to the “inA” input of the block. Number of the target block is connected to the “inB” input of the block. The value at the “inA” input, 55, is set to the block with number 4010. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 144 ANALOG MATH 5.5.1 Connections inA: Analog data input inB : Analog data input #AMat0: Output of the Block Trg: Trigger input 5.5.2 Connection Explanations inA: Analog data input Analog value to be processed. inB: Analog data input Analog value to be processed. Trg: Trigger input If the “On When Trig is Active”...
  • Page 145 5.5.3 Block Settings Analog Math Type: Mathematical operation is specifed here INB: Analog input to be processed. On When Trig is Active: If selected, block is activated at each rising edge detected at the Trg input of the block Write On Input: If this option is selected, the value at the inA input of the block and the value at the inB input of the block is processed.
  • Page 146 Math Types and Explanations: Math Used Inputs Explanation The values at the “inA” and the “inB” input are added and the result is written to the “#AMat0” output of the block. If “Write on Input” is ADDITION (+) inA, inB selected, the result is written to the “#AMat0”...
  • Page 147 the result is written to the “#AMat0” output of the block and the “inA” input. It is used for reading a Word Register block’s or a block’s value present in the logic project. The block number to be read is specified with “inB” input of the block.
  • Page 148 5.5.4.1 GET Operation Special Commands When performing GET operation, if some special values are entered to the “inB” input of the block then some special operations are performed by the block. Diagram below shows the commands and the related operations to the commands inB Value Function Explanation 10000...
  • Page 149 5.5.5 Sample Application Addition examples: In “Addition1” example, the values at the inA and inB input of the block are added and the result is written to the O1 output of the block. In “Addition2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the values at the inA and the inB are added and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 150 Subtraction examples: In “Subtraction1” example, the value at the inA of the block is subtracted from the inB input of the block and the result is written to the O1 output of the block. In “Subtraction2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is subtracted from the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 151 Multiplication examples: In “Multiplication1” example, the value at the inA input of the block is multiplied by the inB input of the block and the result is written to the O1 output of the block. In “Multiplication2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is multiplied by the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 152 Division examples: In “Division1” example, the value at the inA input of the block is divided by the inB input of the block and the result is written to the O1 output of the block. In “Division2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is divided by the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 153 Absolute value examples: Distance of the value at the inA to the origin is written to the O1 output. “AbsoluteValue1” example, distance 25.6 origin 25.6. In “AbsoluteValue2” example, distance of -32.6 to the origin is 32.6. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 154 Low limit examples: Low limit value is connected to the inA input of the block using a WORD register. In “Low Limit 1” example, low limit is not activated. Since the value at the inB input is greater than the low limit, the value at the inB is written to the O1 output of the block. In “Low Limit 2”...
  • Page 155 High limit examples: High limit value is connected to the inA input of the block using a WORD register. In “High Limit 1” example, high limit is not activated. Since the value at the inB input is smaller than the low limit, the value at the inB is written to the O1 output of the block. In “High Limit 2”...
  • Page 156 Set example: The value to be set is connected to the inA input of the block. Number of the target block is connected to the inB input of the block. The value at the inA input, -123.5, is set to the block with number 6020. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 157 LONG MATH 5.6.1 Connections InA: Long data input InB : Long data input #LMat0: Output of the Block Trg: Trigger input 5.6.2 Connection Explanations InA: Long data input Long value to be processed. InB : Long data input Long value to be processed. Trg: Trigger input If the “On When Trig is Active”...
  • Page 158 5.6.3 Block Settings Math Type: Mathematical operation is specifed here INB: Second long input to be processed can be entered in Block Settings menu. On When Trig is Active: If selected, block is activated at each rising edge detected at the Trg input of the block Write On Input: If this option is selected, the value at the inA input of the block and the value...
  • Page 159 Write on Input: If this option is selected, the value at the “inA” input of the block and the value at the “inB” input of the block is processed. Result of the operation is written on the “inA” input of the block.
  • Page 160 “Write on Input” is selected, the result is written to the inA input. (Ex: inA =1110b, inB=1 then; OUT=1100b) The bits of the value at the inA input are shifted right by the value at the inB and the result is written to the OUT output of the block. . SHIFT RIGHT InA, InB If “Write on Input”...
  • Page 161 is written to the OUT output of the block. If all the bits are the same, 0 is written to the OUT output. One more of the value of the different bit’s index is written to the OUT. (Ex: If 0th bit is different, 1 is written to the OUT.) Modular arithmetic operation.
  • Page 162 5.6.4.1 GET Operation Special Commands When performing GET operation, if some special values are entered to the inB input of the block then some special operations are performed by the block. Diagram below shows the commands and the related operations to the commands. inB Value Function Explanation 10000...
  • Page 163 5.6.5 Sample Application Addition examples: In “Addition1” example, the values at the inA and inB input of the block are added and the result is written to the OUT output of the block. In “Addition2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the values at the inA and the inB are added and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 164 Subtraction examples: In “Subtraction1” example, the value at the inA of the block is subtracted from the inB input of the block and the result is written to the OUT output of the block. In “Subtraction2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is subtracted from the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 165 Multiplication examples: In “Multiplication1” example, the value at the inA input of the block is multiplied by the inB input of the block and the result is written to the OUT output of the block. In “Multiplication2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is multiplied by the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 166 Division examples: In “Division1” example, the value at the inA input of the block is divided by the inB input of the block and the result is written to the OUT output of the block. In “Division2” example, “On When Trig is Active” and “Write on Input” is selected. Hence, the value at the inA of the block is divided by the inB input of the block and the result is written to the inA input at each detected rising edge on the Trig input of the block.
  • Page 167 AND and OR examples: Corresponding binary value of the decimal value at the inA: ; (21) =(10101) Corresponding binary value of the decimal value at the inB: (11) (01011) The result of bitwise AND operation between inA and inB is: (1) =(00001) The result of bitwise OR operation between inA and inB is: (31) =(11111)
  • Page 168 Exclusive OR(XOR) and MOD example: Corresponding binary value of the decimal value at the inA: (27) =(11011) Corresponding binary value of the decimal value at the inB: (20) (01011) The result of bitwise XOR operation between inA and inB is: (16) =(10000) In Mod example, the value at the inA is divided by the value at inB and the remainder of the operation is written to the OUT output of the block.
  • Page 169 Shift Left and Shift Right examples: InA’daki değerin bitlerine ayrılmış hali; (4) ’dir. =(00100) InB’deki değer kaç bit kaydırma yapılacağını gösterir. Out çıkışına InA’daki değerin bitleri kaydırıldıktan sonraki long değeri yazılır. Sola Kaydır; 4 değeri 2 bit sola kaydırıldığında; (16) değeri elde edilir.
  • Page 170 Check Bit examples: Corresponding binary value of the decimal value at the inA: (21) =(10101) The value at the inB input specifies the index of the bit which is going to be checked. After the checking process, checked bit is written to the OUT output of the block. In “Check Bit 1”...
  • Page 171 Absolute Value examples: Distance of the value at the inA to the origin is written to the OUT output. In “AbsoluteValue1” example, distance of 445 to the origin is 445. In “AbsoluteValue2” example, distance of -412 to the origin is 412. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 172 Low Limit examples: Low limit value is connected to the inA input of the block using a long register. In “Low Limit 1” example, low limit is not activated. Since the value at the inB input is greater than the low limit, the value at the inB is written to the OUT output of the block. In “Low Limit 2”...
  • Page 173 High Limit examples: High limit value is connected to the inA input of the block using a WORD register. In “High Limit 1” example, high limit is not activated. Since the value at the inB input is smaller than the low limit, the value at the inB is written to the OUT output of the block. In “High Limit 2”...
  • Page 174 Merge A-B example: The value at the inB block is shifted left by 8bits and added to the value at the inA input of the block.The result is written to the Out output of the block. Two 16-bit word register’s bits are concetanated with Long Math block.
  • Page 175 COUNTER BLOCKS 6.1 UP/DOWN COUNTER 1 6.1.1 Connections Trg: Trigger input #U/D10: Block output Res: Reset input Dir: Direction input 6.1.2 Connection Explanations Trg: Trigger input It is the trigger input. Res: Reset input The counter’s reset input. Dir: Direction input Counter direction binary input.
  • Page 176 6.1.3 Block Settings Up: If selected; Counter increases in the positive (+) direction. If it is desired to select from outside the block, Logic high(1) should be applied to "Dir" input. Down: If selected; Counter increases in the negative (-) direction. If you want to select from outside the block, logic low(0) should be applied to "Dir"...
  • Page 177 6.1.5 Sample Application In the example, on the rising edge of each logic high(1) signal coming from DI0; If the DI2 input is logic high(1), it performs counting upwards, else if the DI2 input is logic low(0), it performs counting downwards. Logic high(1) from DI1 input is used for resetting the counter.
  • Page 178 6.2 UP/DOWN COUNTER 2 6.2.1 Connections Up: Up input #U/D20: Block output Dow: Down input Res: Reset input 6.2.2 Connection Explanations Up: Up input The counter value increases by 1, when “Up” input triggered. Dow: Down input The counter value decreases by 1, when “Dow” input triggered. Res: Reset input It is counter’s reset input.
  • Page 179 6.2.3 Block Settings Retentive (Persistence): If selected; the counter keeps the last value when the power of the device is interrupted or reset. 6.2.4 Block Explanation It is used when positive (+) direction and negative (-) direction counting is done from two different inputs on the block.
  • Page 180 6.2.5 Sample Application In the example; At the rising edge of each logic high(1) signal DI1, the counter value is incremented by 1. At the rising edge of each logic high(1) signal DI2, the counter value is decremented by 1. DI3 input logic high(1) is used to reset the counter.
  • Page 181 6.3 RUN TIME 6.3.1 Connections Act: Activation input #RTB0: Block output Res: Reset input 6.3.2 Connection Explanations Act: Activation input Block enable input. Res: Reset Run-time counter’s reset input. #RTB0: Block output Runtime value. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 182 6.3.3 Block Settings Time Scale: “Seconds, minutes, hours" can be selected from the time scales. 6.3.4 Block Explanation Run Time block is used to save the runtime. When the "Act" input is logic(1), it counts the time in selected time scale (seconds, minutes, hours and writes to the output.
  • Page 183 6.3.5 Sample Application In the example, RQ0 is started from DI0 input and stopped from DI1 input. With the RTB block, the duration when the RQ0 is logic high(1) will be monitored. DI2 input will reset the run time. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 184 GSM BLOCKS In the group of GSM blocks; There are blocks for receiving SMS, sending SMS, starting DTMF call, receiving DTMF call and GSM signal quality. SMS contents and GSM numbers are written in the "String Table" in GSM blocks. Picture (1) SMS contents and phone numbers written in the text table are selected with the "String Reference Block".
  • Page 185 SMS RECEIVER 7.1.1 Connections No: Phone Number input #SMSRc0: Block output Msg: Message input Fla: Flag output 7.1.2 Connection Explanations No: Phone Number input It is for SMS filtering by sender phone number. Only SMS messages send by this phone number is accepted.
  • Page 186 7.1.3 Block Settings Parse Method: There are four methods; “String Compare”, “Ascii to Integer”, “Text=:Value” and ”Write Into Device”. Text Offset: In the string table, determines the offset which the received SMS will be saved into. Note: Text offset should be selected from unused string offset.
  • Page 187 Parse Method: If the “String Compare” option is selected in the “Parse Method” combobox in the SMS Receiver block settings, the text of the received SMS is compared with the text in the “Msg” input. If the text compared with the received SMS is same, the block output becomes high(1) and continuously remains in high(1) state.
  • Page 188 7.1.5 Sample Applications SMS Receiver blocks are used to turn the system on and off. The system works according to the information from the number indicated in the SMS Receiver block. When the "open_role" SMS is received from the number specified in the string table, the pulse relay output and the RQ0 will become logical high(1) and the system will start to operate.
  • Page 189 SMS SEND 7.2.1 Connections IN: Value input Trg: Block trigger input No: Number input Msg: Message input 7.2.2 Connection Explanations IN: Value input Block input used in sending SMS Text Trg: Block trigger input Rising edge at this input sends the SMS. No: Number input Destination phone number of sending SMS Msg: Message input...
  • Page 190 No and Msg inputs must be connected to string type blocks. When the rising edge of the logical high(1) signal is input to the “Trg” input, the SMS is sent. The string reference blocks are connected to the input “No” and the number to which the SMS will be sent is selected from string table.
  • Page 191 7.2.5 Sample Applications In the example; The SMS trigger is provided on rising edge trigger from DI0 input. The string table contains the number and SMS content to be sent. The SMS content is "temperature =%s,_flow=$5001". Here, the RTD temperature value of the SMS Send block’s “IN”...
  • Page 192 INCOMING DTMF CALL 7.3.1 Connections #InCall0: DTMF code output No: Incoming call number input Cal: Call accepted output 7.3.2 Connection Explanations No: Incoming call number input It is for filtering by caller phone number. Only incoming calls from this phone number is accepted.
  • Page 193 7.3.3 Block Settings Telephone number to be accepted: The phone number to be accepted can be entered inside the block. Auto Suspend Call: This option can be clicked if the incoming call is requested to be busy. 7.3.4 Block Explanation Thanks to the DTMF blocks, Remote projects via Phone DTMF codes can be easily done.
  • Page 194 As an example, when "* 1234 #" is entered, the value of "1234" is read out from DTM output. This value can be used as a word value as desired. The same operation is repeated to transfer the DTMF code again. That is, DTMF code input is started with "*"...
  • Page 195 OUTGOING DTMF CALL 7.4.1 Connections No: Dialing Number #OutCall0: Block output Ori: Start to dialing 7.4.2 Connection Explanations No: Dialing Number Phone number to dial Ori: Start to Dial The block input that must be changed to logical high(1) to start a call. #OutCall0: Block output It is the block output that indicates whether the call has been accepted or not.
  • Page 196 7.4.3 Block Settings Telephone number to be called: The phone number to be called can be entered in the block. Auto Suspend Call: This option can be clicked if the incoming call is requested to be busy. 7.4.4 Block Explanation Applying the logical high (1) signal to the “Ori”...
  • Page 197 Note: The DTMF Originate Call block is available on devices with the GSM feature and the device is available on the SIM card when the call feature is turned on. 7.4.5 Sample Applications The telephone number to call is determined by text reference. The number specified by the rising edge trigger signal coming to the input "Ori"...
  • Page 198 7.5.4 Block Explanation This is a block that can be used to monitor GSM signal quality. It gives a value between -1 and 31. Values -1 and 0 indicate that there is no GSM connection, and values 1 and 31 indicate the signal quality of the device.
  • Page 199 8.1.3 Block Settings Log Record Frequency(Minutes): How often the data can be logged is set in minutes from within the block. 8.1.4 Block Explanation In control devices to do LOG record operation is used. LOG record operation on the devices which support the SD card is made on SD card, if there is no SD card in the device it is done on the flash memory.
  • Page 200 8.1.5 Sample Application In the sample; A logging process is performed periodically using a symmetric pulse generator for 5 minutes. The values of all blocks with the add to log record option checked are added to the log record memory every 5 minutes. REGISTER/VARIABLE BLOCKS 9.1 WORD REGISTER 9.1.1 Connections...
  • Page 201 #WReg0 is Block output. It reflects the internal 16 bit Word Register value. 9.1.3 Block Settings Register Initial Value: The initial value which will be written in the register memory at startup. Edge Type: Latching of I1 value into Register Memory is controlled by Lat Signal.
  • Page 202 High Only if the Lat Signal is Logic(1), Value at I1 input is saved into Register Memory Only if the Lat Signal is Logic(0), Value at I1 input is saved into Register Memory Note: if Lat signal is not connected, it means to Low – Logic(0) Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat Signal Fall...
  • Page 203 9.1.5 Sample Application In samples 1- Word register which is 4000 block round, counter value which is in the I1 input to “Lat” input with the logic(1) signal which is comes from DI1 is taken to in the 4000 round block. (Edge type is selected as “High”) 2- The value is written as offline and online to in the 4001 block number word register.
  • Page 204 9.2.2 Connection Explanations I1: Data Input Data input which is latched into register. Lat: Latch Signal Data is latched into the register memory within control of Lat signal.. #AReg0: Analog output #AReg0 is Block output. It reflects the internal 32 bit Floating Point Analog Register value. 9.2.3 Block Settings Register Initial Value: The initial value which will be written in the register memory at startup.
  • Page 205 9.2.4 Block Explanations Analog Register Block is used as a 32 bit Floating Point type value holder. It is used as variable in PLC projects. Using the Lat Signal, the block can be used like a D-Type Latch. Latching of I1 value into Register Memory is controlled by Lat Signal. The edge selection type determines how the Lat signal will control the Latching process.
  • Page 206 9.2.5 Sample Application In the sample; “-5.612 “ value was written as offline or online in to the analog register which is 5001 block number by the user. The output of block which is 6002 due to connected the 6000 block number “–5.612”...
  • Page 207 9.3.3 Block Settings Register Initial Value: The initial value which will be written in the register memory at startup. Edge Type: Latching of I1 value into Register Memory is controlled by Lat Signal. The edge selection type determines how the Lat signal will control the Latching process.
  • Page 208 High Only if the Lat Signal is Logic(1), Value at I1 input is saved into Register Memory Only if the Lat Signal is Logic(0), Value at I1 input is saved into Register Memory Note: if Lat signal is not connected, it means to Low – Logic(0) Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat Signal Fall...
  • Page 209 9.3.5 Sample Application In the example: Because of "Edge Type" of the "Long Register" is "Raise" selected , in each rising edge trigger to the Lat input, the value of the "Analog Ramp" is recorded in the "Long Register". (filtered after the comma) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 210 9.4 BINARY REGISTERS 9.4.1 Connections I1: Data Input #BReg0: Binary output Ena: Latch Signal 9.4.2 Connection Explanations I1: Data Input Data input which is latched into register. Lat: Latch Signal Data is latched into the register memory within control of Lat signal. #BReg0: Binary output #BReg0 is block output.
  • Page 211 9.4.4 Block Explanation Binary Register Block is used as a 1 bit Boolean type value holder. It is used as variable in PLC projects. Using the Lat Signal, the block can be used like a D-Type Latch. Latching of I1 value into Register Memory is controlled by Lat Signal. The edge selection type determines how the Lat signal will control the Latching process.
  • Page 212 9.4.5 Sample Application In the example; Because of the name of binary register as “fall” is selected, every low edge trigger comes to Ena input, word register which ıts value is 10 was written to binary register as 1. 9.5 BINARY FLAG 9.5.1 Connections In: Block input #BFlg0: Block output...
  • Page 213 9.5.3 Block Settings There are no block settings. 9.5.4 Block Explanation The value in input signal is transmitted to the block output with one PLC cycle delay. Flag register may be used to prevent logic operations from infinite logic loops when feedback is applied.
  • Page 214 9.6 WORD FLAG 9.6.1 Connections In: Block input #WFlg0: Block output 9.6.2 Connection Explanations In: Block input It is the block input. #WFlg0: Block output It is block output. 9.6.3 Block Settings There are no block settings. 9.6.4 Block Explanation The value in input signal is transmitted to the block output with one PLC cycle delay.
  • Page 215 9.6.5 Sample Application In the example; A 16-bit counter is designed. As soon as the binary register has value 1, the counter starts to increase. The GZDU block is programmed to produce 1 trigger per second. The output of the Word Math block is linked back to the Word Math block I1 entry with Word Flag.
  • Page 216 9.7 ANALOG FLAG 9.7.1 Connections In: Block input #AFlg0: Block output 9.7.2 Connection Explanations In: Block input It is block input. #AFlg0: Block output It is block output. 9.7.3 Block Settings There are no block settings. 9.7.4 Block Explanation The value in input signal is transmitted to the block output with one PLC cycle delay. Flag register may be used to prevent logic operations from infinite logic loops when feedback is applied.
  • Page 217 9.7.5 Sample Application In the example; “Stop Value” of the Analog Ramp is updated with Analog Flag 5006. Analog Ramp is reset after the value of the output of the Analaog Comparator with Analog Flag 5000 has passed the threshold value. The ramping process has been restarted by the new Stop Value.
  • Page 218 9.8 LONG FLAG 9.8.1 Connections I1: Block input #LFlg0: Block output 9.8.2 Connection Explanations I1: Block input It is block input #LFlg0: Block output It is block output 9.8.3 Block Settings There are no block settings 9.8.4 Block Explanation The value in input signal is transmitted to the block output with one PLC cycle delay. Flag register may be used to prevent logic operations from infinite logic loops when feedback is applied.
  • Page 219 9.8.5 Sample Application In the example; The value of Up / Down Counter is reset, when it reaches a certain value that is written on InB input of the Long Comparator. When the value of the "Long Comparator" InB input is exceeded, the block output is set to 1.
  • Page 220 10 MODBUS PROTOCOL BLOCKS 10.1 MODBUS RTU MASTER 10.1.1 Connections #MRM0: Block output Tx: Tx Value output Ser: Serial port block input Err: Number of errors in submitted requests Sta: Connection state output 10.1.2 Connection Explanations Ser: Serial port block input It is the block input which will be connected to the communication port.
  • Page 221 10.1.3 Block Settings Request Timeout: Determines the reply’s timeout duration 10.1.4 Block Explanation Modbus RTU Master block activates the Modbus RTU Master protocol on physical interface connected over communication port input. Standart Modbus RTU Master block operates on RS485 or RS232 serial port. Since only one Modbus RTU Master block is possible on a RS485 bus, only one Modbus RTU Master block can be opened on each serial channel.
  • Page 222 Modbus messages are instantenous reading/writing requests and they do not contain any time tag information. Therefore, request queue on master block has smart mechanisms that provides only keeping the latest request on queue regarding to a point. 10.1.5 Sample Application On the serial port Modbus RTU Master protocol is actived.
  • Page 223 10.2 MODBUS TCP MASTER 10.2.1 Connections #MTM0: Block output Tx: Tx value output TCP: Block input Err: Error value output Sta: Connectıon status output 10.2.2 Connection Explanations TCP: Block input The block input connection to which the communication port is connected. #MTM0: Block output The block output connection.
  • Page 224 10.2.3 Block Settings Request Timeout: This is the value which determines the response time. 10.2.4 Block Explanation The Modbus TCP Master block activates the Modbus TCP Master protocol on physical interface connected over communication port input. After the protocol is actived with Modbus TCP Master block; as a final step you need to connect “request send blocks”...
  • Page 225 10.2.5 Sample Application Modbus TCP Master protocol is actived on TCP socket. The device as an TCP Master sends reading and writing requests to slave devices. It is necessary to connect the Modbus TCP Master block Out output to the corresponding “Mas” inputs of the Modbus Reader / Writer blocks.
  • Page 226 10.3 MODBUS TCP SLAVE 10.3.1 Connections Out: Block output TCP: Block Input Rx: Rx value output Err: Error value output Add: Modbus ID input Sta: Connection status output 10.3.2 Connection Explanations TCP: Block input The block input connection to which communication port is connected Add: Modbus ID input Used to identify the Modbus ID address externally Out: Block output...
  • Page 227 10.3.3 Block Settings Modbus RTU Slave: The ID of the slave device to be connected. 10.3.4 Block Explanation The Modbus TCP Slave block activates the Modbus TCP Slave protocol on physical interface connected over communication port input. The device activated as a Modbus TCP Slave responds to requests with its own Modbus Id from the defined communication port.
  • Page 228 All blocks in the logic project and the Modbus addresses defined in the variable address table will now be accessible with these channel and protocol settings Block Name Register Adress Function Code Binary - Binary Blocks 1000 (0x01) Read Coils (0x02) Read Discrete Inputs (0x05) Write Single Coil (0x0F) Write Multiple Coils...
  • Page 229 10.3.5 Sample Application TCP Socket Block is selected as Server, Modbus TCP Slave block is connected to the block output and in this way the device is programmed in Server mode. (Connection type is selected as Ethernet.) A device that is programmed in this way can be connected by another Modbus TCP Client. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 230 10.4 MODBUS RTU SLAVE 10.4.1 Connections Out: Block output Ser: Block input Rx: Rx value output Err: Error value output Add: Modbus ID input Sta: Connection status output 10.4.2 Connection Explanations Ser: Block input The block input to which the communication port is connected. Add: Modbus ID input Used to identify the Modbus ID address externally Out: Block output...
  • Page 231 10.4.3 Block Settings Modbus Slave Adress: The ID of the slave device to be connected. 10.4.4 Block Explanation The MODBUS RTU Slave block activates the MODBUS RTU Slave protocol on physical interface connected over communication port input. The device activated as a MODBUS RTU Slave responds to requests with its own MODBUS Id from the defined communication port.
  • Page 232 Analog Blocks 6000 (0x03) Read Holding Registers (0x04) Read Input Registers (0x06) Write Single Register (0x10) Write Multiple registers Long Blocks 8000 (0x03) Read Holding Registers (0x04) Read Input Registers (0x06) Write Single Register (0x10) Write Multiple registers 10.4.5 Sample Application MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 233 TCP network. On the MODBUS TCP side, the number of requests and replies in the TRANSACTION must be the same. This is again the responsibility of the GATEWAY device. Mikrodev Control Devices can be programmed as a GATEWAY between supported protocols. MODBUS GATEWAY block is one of the blocks used for this purpose.
  • Page 234 Connecting Master and Slave blocks is enough to operate as GATEWAY. If a request for a different ID is received from the slave block, the corresponding request will be read via the master block. 10.5.5 Sample Application MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 235 10.6 MODBUS WORD READER 10.6.1 Connections Mas: Master input Val: Block output Trg: Trigger input 10.6.2 Connection Explanations Mas: Master input It is master input connection. Trg: Trigger input Trigger input connection. Val: Block output It is block output. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 236 10.6.3 Block Settings Modbus RTU ID: Determines the ID, the data to be retrieved. Register Address: Register addresses to be read from slave IDs. Register Count: The number of registers to be read after the entered register address Function Code: The function code which will be selected to read the data.
  • Page 237 10.6.5 Sample Application The MODBUS TCP Master protocol is used to read data from a MODBUS slave device. The MODBUS master protocol is activated on the device by connecting TCP socket block to the Modbus Master. The reference connection from the MODBUS master block is connected to the reader blocks, and so the MODBUS master channel is selected to direct the reading requests.
  • Page 238 10.7 MODBUS FLOAT READER 10.7.1 Connections Mas: Master input Val: Block output Trg: Trigger input 10.7.2 Connection Explanations Mas: Master input Master input connection. Trg: Trigger input Trigger input connection. Val: Block output Block output connection. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 239 10.7.3 Block Settings Modbus RTU Id: The value from which the data is to be retrieved Register Adress: Register addresses to be read from slave Ids Register Count: The number of registers to be read after the entered register address Function Code: The function code which will be selected to read the data Byte Order: The byte order of the data...
  • Page 240 10.7.5 Sample Application In the sample; The values of 2 Float variables on another Modbus Server were read. Float Reader block Object Addresses are 0 and 2. Two byte data is kept at 1 address. Since the float addresses are 2 bytes, 1 float data is read from 2 addresses (1 float data is read from the address 0 and 1, and 1 float is read from the 2nd and 3rd address.) Because of the float variables can carry signed and decimal numbers, negative decimal (-x, yz)
  • Page 241 1- TCP socket block client must be selected. 2- The Server IP and Port to be connected in the TCP socket block must be the same as the server. 3- TCP socket block “Ena” input must be set to logic1. 4- Float Reader block Trigger input signal must be given to the trailing edge trigger signal.
  • Page 242 10.8.3 Block Settings Modbus RTU Id: The id of the device from which the data is to be retrieved Register Adress: Register address to be read from slave Ids Register Count: The number of registers to be read after the entered register address Function Code: Function code which will be selected to read the data.
  • Page 243 10.8.4 Block Explanation The long of 32 byte which keep two numbers from long type fort to read the register adress. Reading request is created on Trg signal’s high edge and added to Master block’s request queue. In cases where the master block communication channel is available and is not in a waiting state for the previous request, the requests in the queue will run sequentially.
  • Page 244 1 byte data is kept at 1 address. Since the Long addresses are 2 bytes, 1 Long data is read from 2 addresses (1 Long data is read from the address 8000 and 8001, and 1 Long data is read from the 8010. and 8011. addresses.) Because of the Long variables can carry signed numbers, negative (-) and positive (+) 32 bit values can be read.
  • Page 245 In order to make the reading process; 1- TCP socket block client must be selected. 2- The Server IP and Port to be connected in the TCP socket block must be the same as the server. 3- TCP socket block “Ena” input must be set to logic1. 4- Long Reader block Trigger input signal must be given to the trailing edge trigger signal.
  • Page 246 10.9.3 Block Settings Modbus RTU ID: The ID of the device from which the data is to be retrieved. Register Adress: Register address to be read from slave IDs. Register Count: The number of registers to be read after the entered register address Function Code: Function code which will be selected to write the data.
  • Page 247 10.9.5 Sample Application The MODBUS TCP Master protocol is used to read data from a MODBUS slave device. MODBUS master protocol is activated on the device by connecting the TCP socket block to Modbus Master block. The reference connection from the MODBUS master block is connected to the reader blocks, and so the MODBUS master channel is selected to direct the reading requests.
  • Page 248 10.10 MODBUS FLOAT WRITER 10.10.1 Connections Mst: Master input Trg: Trigger input In: Block input 10.10.2 Connection Explanations Mas: Master input Master input connection Trg: Trigger input The trigger input connection In: Block input Block input connection MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 249 10.10.3 Block Settings Modbus RTU ID: The ID of the device from which the data is to be retrieved Register Adress: Register address to be read from slave IDs. Register Count: The number of registers to be read after the entered register address Function Code: Function code which will be selected to write the data.
  • Page 250 10.10.5 Sample Application The MODBUS TCP Master protocol is used to read data from a MODBUS slave device. MODBUS master protocol is activated on the device by connecting the TCP socket block to Modbus Master block. The reference connection from the MODBUS master block is connected to the reader blocks, and so the MODBUS master channel is selected to direct the reading requests.
  • Page 251 10.11 MODBUS LONG WRITER 10.11.1 Connections Mas: Master input Ttk: Trigger input Asd: Asdu address input 10.11.2 Connection Explanations Mas: Master input Master is the entrance. Trg: Trigger input The trigger is the input connection. Asd: Asdu address input Asdu address entry for connection. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 252 10.11.3 Block Settings Modbus RTU ID: The value from which the data is to be retrieved Register Adress: Register addresses to be read from slave IDs Register Count: The number of registers to be read after the entered register address Function Code: The function code which will be selected to read the data Byte Order: The byte order of the data...
  • Page 253 10.11.5 Sample Application The MODBUS TCP Master protocol is used to read data from a MODBUS slave device. MODBUS master protocol is activated on the device by connecting the TCP socket block to Modbus Master block. The reference connection from the MODBUS master block is connected to the reader blocks, and so the MODBUS master channel is selected to direct the reading requests.
  • Page 254 10.12 MODBUS READ/WRITE TABLE 10.12.1 Connections Mas: Master input Tab: Table input Trg: Trigger input 10.12.2 Connection Explanations Mas: Master input Master input connection Tab: Table input It is the reference input connection for the table or target/source block’s start Trg: Trigger input The trigger input connection MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 255 10.12.3 Block Settings Modbus RTU Id: The value from which the data is to be retrieved Register Adress: Register addresses to be read from slave Ids Register Counter: The number of registers to be read after the entered register address Function Code: The function code which will be selected to read the data Byte Order: The byte order of the data...
  • Page 256 If the table is used as a data source; the memory area occupied by the table block is used as the source. The table size must be 2 times the number of registers defined by the block as BYTE, because each MODBUS writer is 2 bytes in size. 10.12.5 Sample Application 10.12.5.1...
  • Page 257 The data read with the MRWT block is written to the Modbus Table block. To do this, open the 6 Byte area in the Modbus table block. (Each Word variable is 2 Bytes.) The datas saved on Word Table Block, is written on Word Table Operation (WTop) block with the property of Read Offset on WTop block.
  • Page 258 The Line Label is defined in the Word Table block. This defined Line Label is selected from the Line Label section of the Variable Address Table. The Modbus Word Addresses is automatically defined as the size of the Word Table block from the start address. Thus, other Modbus TCP Clients can read the addresses of these PLC defined on the Variable Address Table.
  • Page 259 10.12.5.2 Reading to Consecutive Addresses Another method of reading the variables of another Modbus RTU / TCP Slave with Modbus Read / Write Table (MRWT); read the values on sequential address registers. In the above example, it is aimed to read 3 Word variables with MRWT block. For this reason, 3 registers have been opened in the MRWT block.
  • Page 260 With Register Count of MRWT block is defined that how many addresses from Modbus RTU / TCP Slave's address is selected in the Register Address are selected. (In the above example, it is selected to read 3 addresses as from the 0th address.) From the Word Register connected to the Tab input of the MRWT block, the data in the Modbus RTU / TCP Slave will be read on 3 Word Registers (4008, 4009., and 4010.
  • Page 261 10.12.5.3 Writing to Consecutive Addresses With Modbus Read / Write Table (MRWT) can be written to another Modbus RTU / TCP Slave's consecutive sequential writeable (W or R/W) variables. In the above example, the value of 3 analog variables with MRWT block is written to Modbus RTU / TCP Slave.
  • Page 262 Register Count in the MRWT block is defined for how many addresses would be written by MRWT block to Slave. (In the above example, it is selected to write 3 Analog addresses from the 0. address. 0., 2. and 4. Addresses) From the analog input block connected to the tab input of the MRWT block, data on 3 analog blocks with sequential sequential address will be written to Modbus RTU / TCP Slave.
  • Page 263 10.12.5.4 Writing to Successive Addresses from a Table With Modbus Read / Write Table (MRWT) can be written to another Modbus RTU / TCP Slave's consecutive sequential writeable (W or R/W) variables. In the above example, the area for 3 long variables is opened in the Long Table block that connects to the Tab input of the MRWT block.
  • Page 264 Register Count in the MRWT block is defined for how many addresses would be written by MRWT block to Slave. (In the above example, it can be written from 0. to 5. Addresses. 0, 1, 2, 3, 4, 5. Addresses) In every minute a sample is taken from the Analog Input (AI0) block connected to the In input of the Long Table block connected to the “Tab”...
  • Page 265 10.13.3 Block Settings Modbus Slave Address: The ID of the device in which status information is to be received can also be selected from the block. 10.13.4 Block Explanation The status information of slave devices that read and write via Modbus Master blocks is read by this block.
  • Page 266 10.13.5 Sample Application In the sample; communication connection is inquired by Modbus Status block to Modbus TCP/RTU Slaves'. When there is a communication connection, the block output is set to 1. The block output is 0 when there is no communication connection. 11 MQTT 11.1 MQTT CONFIG BLOCK 11.1.1...
  • Page 267 11.1.2 Connection Explanations Soc: TCP Socket entry It is used for TCP Socket block connection. Mqtt Config block cannot be used without TCP Socket block. Trg: Block trigger input When periodic data transfer is desired, a trigger should be given to the mqtt config block from this input.
  • Page 268 11.1.3 Block Settings Client Id: The field where the device is manually given an ID for the broker connection. User Name: The field where the device is named for the broker connection. Password: Password field entered in the device for the broker connection.
  • Page 269 11.2 MQTT TABLE The table where all MQTT-related adjustments are made can be accessed from the Projects/MQTT Table tab. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 270 11.2.1 Topics to Publish In this table, the Publish topic is entered to publish the data to the broker. The topic name is entered on the screen that appears by pressing the Add Topic button in the table. Block definitions where you can enable/disable Qos, Retain, Last Will, Payload settings, send on exchange and periodically send options are also made on this page.
  • Page 271 • Is Last Will Topic: Last will topic. If a topic is created and this option is checked, the message under this topic will be forwarded to the subscribers when the device is disconnected from the broker. • Payload Type: It is determined in which format the message content will be sent. Subscriber interprets incoming messages with this information.
  • Page 272 11.2.2 Publish Blocks for Topic In this table, the blocks to be published for the relevant Topic are selected. After clicking the topic in the Publish to topic table, the Add Entry button becomes active and by pressing this button, the block to be published in the project is selected. How to transmit the data can also be selected from the screen Definitions;...
  • Page 273 Note: Blocks used in messages; It can be sent and received with the block number (B:3006) under the block, or it can be added to the messages with line tags (word_publish_ch). This selection is made under the Mqtt Format tab in the block properties. •...
  • Page 274 11.2.2.1 Identifying Labels from String Table If long expressions are to be used in MQTT format for the selected label definitions, a text table can be used. This helps to avoid confusion in PLC projects. For example, if you want to send the expression "A_region_fault_resolved"...
  • Page 275 11.2.3 Subscribe to Topic In this table, the relevant subscribe topic is entered to send data from the broker to the device Definitions; • Subscribe Topic Name: Enter the name of the topic to be subscribed to. • QoS: Service quality level is selected. •...
  • Page 276 11.2.4 Subscribed Block Values for Topic From this screen, the blocks to be associated for the subscribe topic are added. To use line tags, mqtt format should be selected as view and set from the special settings of the relevant block.
  • Page 277 Send On Change; Follow Projects > MQTT Table >Topics to Publish > Add Topic. Select the Topic name, enter the High gate we have prepared in the diagram for the OnChange Send Enable Block, and click add. Then, from the Publish Blocks for Topic section in a subtable, click to the Add Entry. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 278 Select the block in the diagram that you want to broadcast as a message to the Select Block for Subscribe on Topic section. In the SendOn Change section, On Level Change is selected and Change Value is set to 0 so that it can send a message every time the value changes.
  • Page 279 Periodic Send; In addition to the configuration sent in the change, a real time pulse generator is added to the trg input of the mqtt config block, MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 280 Real time pulse generator is set for 5 seconds to broadcast a message periodically every 5 seconds and the created topic is changed as follows. OnChange Enable Block= NULL and Set the High gate in the Periodic Send Enable Block diagram, In the Select Block for Subscribe on Topic section, select SendOn Change= None and click Send Periodically.
  • Page 281 The project is loaded back to the device and incoming messages are observed. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 282 11.3.2 Subscribe Topic General Configuration; After the project is created, the diagram is designed as in the figure, the mqtt formats of the word analog registers relay output selected view MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 283 Follow Projects > MQTT Table >Topics to Subscribe > Add Topic. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 284 Enter the topic name and click Add. Then, the add entry is clicked from the Publish Blocks for Topic section in a subtable. Here, the block to which the subscribed value will be transferred is selected. After all blocks to be subscribed are determined, the project is loaded into the device. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 285 When the message is published to the test2 topic with the above format, the final state of the variables is as follows; 11.4 SETTING UP MQTT CONNECTION WITH SSL Secure Sockets Layer (SSL) and Transport Layer security (TLS) are protocols that provide secure communications over a computer network or link.
  • Page 286 11.4.1.1 Uploading SSL Certificate File to Device The SSL Certificate file can be uploaded on the device in two ways. • SSL Certificate file can be uploaded via Web Server. For this, the following instructions are followed. Login to the Web Server interface as an admin. Go to the Upload tab in the Web Server left sidebar.
  • Page 287 12 COMMUNICATION BLOCKS 12.1 SERIAL PORT BLOCK 12.1.1 Connections #SPB0: Serial connection output 12.1.2 Connection Explanations Out: Serial Connection Output Output of the block which is connected to the protocol blocks. 12.1.3 Block Settings Serial Port No: Port number is entered here. Port Type: Communication type is selected here.
  • Page 288 12.1.4 Block Explanation Any protocol supported by Mikrodev PLC can be configured to communicate over serial port. For this purpose, Serial Port block must be connected to related protocol block in PLC project. Serial Port Block can be used with following protocols of Mikrodev PLC/RTU:...
  • Page 289 12.1.5 Sample Application RTU Master block and serial port block is connected to use the device in Master mode serial communication 12.2 TCP SOCKET BLOCK 12.2.1 Connections Ip: IP is entered here. #TSB0: Output of the block Por: Port is entered here. Con: State of the connection Ena: Enable pin.
  • Page 290 #TSB0: Output of the block Block output which is connected to the protocol blocks which perform TCP communication. Con: Connection Indicates are there any established socket connection provided by the block. If there is active socket, it is high(1) and if there is no, it is low(0). 12.2.3 Block Settings Socket Type: One of the TCP Client or TCP Server options can be selected in Block Settings.
  • Page 291 12.2.4 Block Explanation TCP Socket Block is used to provide the communications with Ethernet, GSM or Wi-Fi, with supported protocols. “#TSB0” output of the block can be connected to the TCP Communication Protocol Blocks such Modbus TCP Slave, Modbus TCP Master, DNP3 Slave, IEC101 Slave and IEC104 Slave. “Con”...
  • Page 292 Thus, only filtered IP can connect to this device. 12.2.5 Sample Application TCP Server Mode MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 293 TCP Socket block is connected to the Modbus TCP slave block, so Modbus communication will be performed. For this, the TCP server is selected from the block options, the listening port (502) is also defined. IP filter is enabled and 2 different IPs are allowed to connect. (192.168.2.100 and 192.168.2.101) In this case, the device can be connected to the Modbus TCP Client with one of the IPs in the IP filter.
  • Page 294 When TCP is programmed as Client, a TCP Master block must be connected to the block output. Modbus TCP Master block is connected in the example. The Port of the Server to which the device will establish a communication connection is defined. The IP of the Server to which the device will establish a communication connection is defined.
  • Page 295 12.3.3 Block Settings Primary DNS Server: The Primary DNS server is entered in this section. Secondary DNS Server: Secondary DNS Server is entered to this section. URL: The URL to use is entered in the string table. The ID of the URL entered in the string table is selected here.
  • Page 296 12.3.4 Block Explanation Click the Projects tab on the left of the Mikrodiagram software. String Table is selected from the top menu. You can enter a URL under the String Text heading. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 297 12.3.5 Sample Application The DNS Block output is connected to the ip pin of the TCP Socket block. The DNS block will convert the URL to IP, Fou. pin is active. The TCP block uses the IP address from the DNS block.
  • Page 298 13 TABLE BLOCKS 13.1 WORD TABLE 13.1.1 Connections In: Word input value to add #WTab0: Block output Clk: Clock signal input 13.1.2 Connection Explanations In: Word value input to add It is Word input value to add to the table. Clk: Clock signal input When “Clk”...
  • Page 299 13.1.3 Block Settings Type Table: It can be selected as “CIRCULAR” or “FIFO”. Table Size: Table size can be determined with this option. The unit of the table size is “Byte”. 13.1.4 Block Explanation Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO (First In Last Out)”...
  • Page 300 In applications where the order of addition of the data on the table is important, a FILO type table is required. On large tables, adding data to FILO type table takes more processing time. Therefore, FILO type table should be used just if necessary. For a table which has 4 word data, adding data in Circular mode works like below: Table Size is the total byte size that the datas of the table cover in memory.
  • Page 301 13.2 ANALOG TABLE 13.2.1 Connections In: Analog input value to add #ATab0: Block output Clk: Clock signal input 13.2.2 Connection Explanations In: Analog input value to add It is the analog input value to is added into the table. Clk: Clock signal input In the rising edge of “Clk”...
  • Page 302 13.2.3 Block Settings Table Type: Table type can be determined as “CIRCULAR” or “FILO”. Table Size: The value of table size can be determined here. Its unit is “Bytes”. 13.2.4 Block Explanation Table size and table type can be chosen like below by user. Here, “Circular or FILO (First In Last Out)”...
  • Page 303 In applications where the order of addition of the data into the table is important, a FILO type table is required. On large tables, adding data to FILO type table takes more processing time. Therefore, FILO type table should be used just if necessary. For a table which have 4 analog data, adding data in Circular mode works like below: Table Size is the total byte size that the datas of the table cover in memory.
  • Page 304 13.3 LONG TABLE 13.3.1 Connections In: Long input value to add #LTB0: Block output Clk: Clock signal input 13.3.2 Connection Explanations In: Long input value to add It’s the long input value to be added to table. Clk: Clock signal input In the rising edge of “Clk”...
  • Page 305 13.3.3 Block Settings Table Type: Table type can be determined as “CIRCULAR” or “FILO” in here. Table Size: The value of table size can be determined here. Its unit is “Bytes”. 13.3.4 Block Explanation Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO (First In Last Out)”...
  • Page 306 In applications where the order of addition of the data on the table is important, a FILO type table is required. On large tables, adding data to FILO type table takes more processing time. Therefore, FILO type table should used just if necessary. For a table which have 4 long datas, adding data in Circular mode works like below: Table Size is the total byte area that the datas of the table cover in memory.
  • Page 307 13.4 BIT TABLE 13.4.1 Connections Tbl: Binary input value to add #BTB0: Block output InB: Clock signal input 13.4.2 Connection Explanations In: Binary input value to add It is Binary input value to be added into table. InB: Clock signal input In the rising edge of “InB”...
  • Page 308 13.4.3 Block Settings Table Type: Table type can be determined as “CIRCULAR” or “FILO” in here. Table Size: The value of table size can be determined here. Its unit is Byte. 13.4.4 Block Explanation Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO (First In Last Out)”...
  • Page 309 In applications where the order of addition of the data on the table is important, a FILO type table is required. On large tables, adding data to FILO type table takes more processing time. Therefore, FILO type table must used just it necessary. For a table which have 4 bit data, adding data in Circular mode works like below: Table Size is the total byte area that the datas of the table cover in memory.
  • Page 310 13.5 WORD TABLE OPERATION 13.5.1 Connections TbI: Table reference connection #WTOp0: Output of the InB: Parameter of operation block Trg: Operation trigger signal 13.5.2 Connection Explanations TbI: Table reference connection It’s connected with the output of the table which is processed. InB: Parameter of operation It’s the input parameter data used in some operations.
  • Page 311 13.5.3 Block Settings Table Offset: It’s used to select the data offset to be processed in the table data. Math Type: The operation type to be processed on the table data is selected. On When Trig is Active: If it is selected, the operation to be processed on the table data is executed only on the rising edge of the "Trg"...
  • Page 312 13.5.4 Block Explanation It executes the operation which is defined on the table data and writes the result to output of the block. The types of operations that can be performed on the table and their explanations are as follows: Latest Data It fetches the data value which is the last value added to table.
  • Page 313 Circular Right Shift It shifts the data in the table right 1 index, and its transfer the rightmost data to left. Shifting Right İt shift the data in the table 1 index to right, write 0 to leftmost index. Put Offset The value in the InB entrance is written onto the data in the index which is defined by the table offset.
  • Page 314 In the example,8 random integer is written on the table. “Tbl” input of word table operation blocks is connected with the output of word table blocks. When “LatestData and Sum “is selected in the word table operation block: When “LatestData” is selected: Since last value added to the table is 29, the value is written on the output of block.
  • Page 315 In the mean operation, the values in the table are summed and divided by 10 because the table size is selected by 10 word values. (155/10=15 decimal part is filtered because it is word table operation block.) There are 10 word value (even number) on the table in the median operation. With median operation, the values on the table are ordered as small to large.
  • Page 316 When “Direction” is selected in the word table operation block; When the direction operation is selected, the last value added to the table is compared with the previous value from the last. İf last value is bigger, than 1 is written on the output of block otherwise it will be 0.
  • Page 317 In this case the value which is written on the 2. offset of the table by Put Offset is read on the 2. offset of the table by Reading Offset. When “ReadByteOffset” is selected in the word table operation block; In the example, the 6th and 7th bytes of the 20 byte long word table are read.
  • Page 318 13.6 ANALOG TABLE OPERATION 13.6.1 Connections TbI: Table reference connection #ATOp0: Output of the block InB: Operation parameter Trg: Operation trigger signal 13.6.2 Connection Explanations TbI: Table reference connection The output of the table to be processed is connected. InB: Operation parameter It is the input of the parameter data which is used in some operation.
  • Page 319 13.6.3 Block Setting Table Offset: It’s used to select the data offset to be processed in the table data. Math Type: The operation type to be processed on the table data is selected. On When Trig is Active: If it is selected, the operation to be processed on the table data is executed only on the rising edge of the "Trg"...
  • Page 320 13.6.4 Block Explanation It executes the operation which is defined on the table data and write the solution to output of the block. The types of operations that can be performed on the table and their explanations are as follows: Latest Data It fetches the data value which is the last value added to table.
  • Page 321 Shifting Right İt shift the data in the table 1 index to right, write 0 to leftmost index. Put Offset The value in the InB entrance is written onto the data in the index which is defined by the table offset. Clear Table Resets the data in the table.
  • Page 322 When "Sum and Mean" is selected in the analog table operation block; When “Sum” is selected; The analog numbers written in the table are summed and the total value is written to the block output. When “Mean” is selected; the values in the table are summed and divided by 5 because the table size is selected according to the 5 analog values.
  • Page 323 While the analog table operation block is selected as "Max and Min"; The maximum value written to the table is 21, the maximum value is 21, and the smallest integer in the table is -4.12, the minimum value is -4.12. While "Direction"...
  • Page 324 In the analog table operation block, "PutOffset and ReadOffset" are selected; Put Offset: "Table offset” has been selected as 1 in analogue table operation block. In this case the value in InB will be written to the 1st offset of the table. Read Offset: The table to be read in the analog table operation block can be selected from inside and outside the offset block.
  • Page 325 13.7 LONG TABLE OPERATİON 13.7.1 Connections TbI: Table reference connection InB: Operation Parameter #LTOp0: Output of the block Trg: Operation trigger signal 13.7.2 Connection Explanations TbI: Table reference connection The output of the table to be processed is connected. InB: Operation parameter The parameter data input used in some operations.
  • Page 326 13.7.3 Block Settings Table Offset: It is used in the table data to select the data offset to be processed. Math Type: The operation type to be performed on the table data is selected. On When Trig is Active: If it is selected, the operation to be performed on the table data is executed only on the rising edge of the "Trg"...
  • Page 327 13.7.4 Block Explanation It writes the result of the operation to the output of the block by performing the operations defined on the table data. The types of operations that can be performed on the table and their explanations are as follows: Latest Data Returns the most recently added data value to the table...
  • Page 328 Shifting Right Move the table data 1 index right and write 0 to the leftmost value Put Offset The value in the input “In” is written on top of the indexed data defined by the table offset. Clear Table Resets the data in the table. Search The block output is written in which index of the table the value entered from the "InB"...
  • Page 329 While "LatestData and Sum" is selected in the long table operation block; When "Latest Data" is selected; Since the last 20 values are stored in the table, the value is written to the block output. When "Sum" is selected; the numbers written in the table are summed and the total value is written at the output of the block.
  • Page 330 When "Mean and Median" is selected in the long table operation block; While "Mean" is selected; the values in the table are summed and divided by 5 because the table size is selected according to 5 long values (Since the 48/5 = 9 long operation is performed, the decimal part of the operation result is filtered.) Median process has 5 long value on table.
  • Page 331 When "Max and Min" is selected in the long table operation block; The maximum value written to the table is 52, the maximum value is 52, and the smallest integer in the table is -32, the minimum value is -32. While "Direction"...
  • Page 332 While “PutOffset and ReadOffset” are selected in the long table operation block; Put Offset: The "table offset” is selected as 0 from the long table operation block. In this case, the value in “InB” will be written to the 0th offset of the table. Read Offset: The table to be read in the long table operation block can be selected from inside and outside the offset block.
  • Page 333 offset are written to the 8th byte which can carry 0-255 values. Since the value is less than 256 9th, 10th, 11 bytes are all 0. 13.8 BIT TABLE OPERATİON 13.8.1 Connections TbI: Table reference connection InB: Operation parameter #BTOp0: Output of the block Trg: Operation trigger signal 13.8.2 Connection Explanations...
  • Page 334 13.8.3 Block Settings Table Offset: It is used in the table data to select the data offset to be processed. Math Type: The operation type to be performed on the table data is selected. On When Trig is Active: If it is selected, the operation to be performed on the table data is executed only on the rising edge of the "Trg"...
  • Page 335 13.8.4 Block Explanation It writes the result of the operation to the output of the block by performing the operations defined on the table data. The types of operations that can be performed on the table and their explanations are as follows: Latest Data Returns the most recently added data value to the table.
  • Page 336 Shifting Left The table data is shifted left by 1 index and 0 is written to the rightmost. Circular Right Shift Move the table data to the right by 1 index and move the rightmost indexed data to the left. Shifting Right Move the table data 1 index right and write 0 to the leftmost value...
  • Page 337 When "LatestData and Sum" is selected in the bit table operation block; When "Latest Data" is selected; the value is written to the block output since the most recent value is 1 on the FILO. When “Sum” is selected; since any of the bit values written to the table is 1, the result which is written on the output of the block is 1 as a result of the bit table average operation.
  • Page 338 When "Max and Min" is selected in the bit table operation block; When the table has bit value 1, the maximum value is 1 and when the table has bit value 0, the minimum value is written as 0 in the block outputs. While “ReadOffset”...
  • Page 339 14 CONTROLLER BLOCKS 14.1 HYSTERESIS 14.1.1 Connections In: Hysteresis block input ThL: Bottom threshold #Hyst0: Hysteresis block output ThH: Upper threshold Trg: Trigger input 14.1.2 Connection Explanations In: Hysteresis block input It is hysteresis block input. Cannot be left blank. ThL: Bottom threshold It is the input for bottom threshold value.
  • Page 340 14.1.3 Block Settings Threshold(Bottom): The bottom threshold value can be determined within the hysteresis block Threshold(Upper): The upper threshold value can be determined within the hysteresis block. On When Trig is Active: The incoming signal to block’s “Trg” input will activate the block. If selected, block’s “Trg”...
  • Page 341 In a system where On/Off ambient temperature control is performed, if the ambient temperature is above the "upper threshold" value, the cooling system is started and the cooling system is shut down when the temperature value becomes lower than the "lower threshold". System is run to keep the temperature in a certain range.
  • Page 342 14.1.5 Sample Application MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 343 In the example, It is aimed to turn on/off the air conditioner with RQ0 connected to the output of the hysteresis block. The temperature sensor is connected to the “In” input. The minimum temperature that the environment should be, is set by the "bottom threshold" and the maximum temperature by the "upper threshold".
  • Page 344 14.2 PID CONTROLLER 14.2.1 Connections Pro: Process value analog data input Tar: Target point entry Sam: Sampling time Kp: P coefficient input (%) Ti: I coefficient input (sec) Td: D Coefficient input (sec) #PID0: Block exit Pro: Process input min. entry Pro: Process input max.
  • Page 345 14.2.2 Connection Explanations Pro: Process value analog data input The instant value read from the system, eg the value read from a device in a temperature control application is connected here. Tar: Target point input The target point value input. Sam: Sampling time (sec) Sampling time value input.
  • Page 346 By this means, the PID block will automatically scale the input value. Pro: Process input max. input Process input max value input The maximum value that the process input value can take is determined. Ex: 20.0 for an input of range of 4-20mA, 100.0 for an entry from 0-100, 65535 for an input range of 0-65535., 100.0 for an input range of -100 ...
  • Page 347 En = ProcessInput - TargetPoint; If the direction input value is 0; The error information used in the PID process is calculated as follows: En = TargetPoint - ProcessInput; #PID0: Block Output It is the block output. It outputs values between the min-max range defined in the “process output“ inputs.
  • Page 348 PID system. These values vary from system to system and should be optimized according to the application conditions. In order to determine these values, Mikrodev PLC has an "automatic tune" mechanism which calculates the values of P, I, D very practical and precise without the need of making any changes in the active project nor need a separate software- hardware etc..
  • Page 349 14.2.5 Sample Application For example, if you want to use 0-10 V controller at PID output, you should enter PID “Output Min.” value as “0” and “Output Max.” value as “10”. If you want to get a current of 4-20mA, you need to write “4”...
  • Page 350 reached and this energy is reduced, the derivative effect will also come into play and the system will try to keep the set value constant. 14.3 ANALOG RAMP 14.3.1 Connections Str: Start/Stop Res: Reset to start #ARmp0: Analog ramp Str: Initial value input block output Stp: End value input Rea: Time to finish value (ms)
  • Page 351 14.3.3 Block Settings Initial Value: The initial value can be set from within the block. End Value: The end value can be set from within the block. Time of Arrival (ms): The time of arrival within the block can be adjusted. 14.3.4 Block Explanation The analog ramp block is used in applications where it is necessary to reach a fixed value from a specified value with a constant acceleration within a certain time period.
  • Page 352 The logic must be applied logic high(1) to start from the "Str" input of the block and logic low(0) to stop. The ramping operation is reset and the output “#ARmp” is fixed to the initial value when the rising edge trigger is applied to the block "Res" input. The word, analog or long registers can be entered in the "Str", "Stp"...
  • Page 353 14.4 ON/OFF CONTROLLER 14.4.1 Connections InA: Controller block input TLw: Bottom threshold THi: Upper threshold #OOC0: Block output THs: Threshold hysteresis tON: ON standby time (ms) tOFF: OFF standby time (ms) 14.4.2 Connection Explanations InA: Controller block input The controller block is the input. Can not be left blank. TLw: Bottom threshold The lower threshold input value THi: Upper threshold...
  • Page 354 It is binary block output. 14.4.3 Block Settings Bottom Threshold Value: Bottom threshold value can be adjusted from within the block. Upper Threshold Value: Upper threshold value can be adjusted from within the block. Threshold Hysteresis Value: Threshold hysteresis value can be entered from within the block.
  • Page 355 OFF or ON states. If the input value of the process meets the defined conditions, output status is ON, otherwise output status is OFF. Mikrodev ON/OFF control function block fulfills this basic ON-OFF control method with a number of superior features. The following comparison types are used to check the process input value.
  • Page 356 14.4.5 Sample Application Example 1 Block process input value has been controlled with ON-OFF control according to the compare type Greater Than. The change in block outputs is delayed as much as the tON and tOFF time values. Alt Eşik #OOC0 tOFF:Close Time tON: Open Time...
  • Page 357 Example 2 The block process input value is controlled with ON-OFF control according to the compare type Greater Than. After the instance, the input value has satisfied the condition, the “#OOC0” output is ON-delayed as long as the tON, then the “#OOC0” output is in logical high(1) position. (The output of “OOC0”...
  • Page 358 Example 3 The block process input value is controlled with ON-OFF control according to the compare type Greater Than. Hysteresis value is also entered, and hysteresis is activated. In the hysteresis comparison method: The transition from the OFF state of the block “OOC0” to the ON state will occur if "Compare point is greater than threshold + hysteresis value."...
  • Page 359 14.5 CHANGE DETECTOR 14.5.1 Connections Up: Block input #CDTC0: Block output L/P: Change value 14.5.2 Connection Explanations Up: Block input It is the block input value from which to determine whether there is a change or not. L/P: Change value The change values can be selected from the L/P input from outside the block or from within the block for the "percentage or level"...
  • Page 360 14.5.3 Block Settings Level: If selected, pulse occurs at #CDTC0 according to level change at Up input. Percentage: When selected, a pulse occurs at #CDTC0 according to the percentage change at the Up input. Value: At an output change (percentage or level) greater than the input value, a pulse occurs at the output.
  • Page 361 14.5.5 Sample Application In the Example; Level is selected as the Change Detector method, and 2 is selected as the level change value from outside the block. When the value of the analog register at the input of “Up” changes more than 2, a pulse is generated at the output of “O1”.
  • Page 362 15.1.2 Connection Explanations VAL: Valve opening level input (%) It is the valve open level as a percentage (%). FOD: Full opening duration input It is the time duration from full closed to full opening. MOD: Minimum opening time duration It is the time duration for minimum opening time.
  • Page 363 15.1.4 Block Explanation It is used in Proportional or PID control applications. Equipment connected to the output will be turned on as long as the logic (1) signal sent from the “#FMB0” output. The equipment connected to the output will shut down as long as the logic (1) signal sent from the “Clo”...
  • Page 364 15.1.5 Sample Application In the examples; The full opening time (FOD) was entered as 100 seconds. Minimum opening time (MOD) value is 0. This means that the smallest change in the VAL input will also cause a change in the outputs.
  • Page 365 15.2 AGING MANAGER 15.2.1 Connection Ena: Enable input #AgMan0: Working slave no Sla: Slave count 15.2.2 Connection Explanations Ena: Enable input It is block activation input. Sla: Slave together count The number of slaves to be activated at the same time. #AgMan0: Working slave no It is the output of the block which shows the number of the running slave and connected to the input of the "Mas"...
  • Page 366 15.2.3 Block Settings Concurrent Slaves Count: The number of slaves (member) connected to the block output which will be active at the same time can be identified from within the block. 15.2.4 Block Explanations “#AgMan0” output connected to “Mas” input of aging member blocks, NOT used alone or with other blocks.
  • Page 367 15.2.5 Sample Application The binary register is connected to the “Ena” input to activate the block. The "Sla" input is linked to the word register to determine how many Aging Members will be active at the same time. On the block “#AgMan0” output there is information about which of the connected members is running.
  • Page 368 15.3 AGING MEMBER 15.3.1 Connections Mas: Aging manager input #AgMem0: Run time output IsR: Running info input IsF: Error info input Ena: Block activation input Agi: Aging time input Run: On/off output Run: Run time reset input Run: Current Aging age input Err: Block error output Fau: Error reset input Fau: Timeout input for error...
  • Page 369 15.3.2 Connection Explanations Mas: Aging manager input The "#AgMan0" output of the Aging Manager block is connected. Another type of block cannot be connected. IsR: Running info input Equipment run information is entered. IsF: Error info input Equipment information such as thermal, fault, error is entered. Ena: Block activation input The block is activated by the logic high(1) signal.
  • Page 370 15.3.3 Block Settings Aging Time(minutes): The Aging Time in minutes can be entered from within the block. Fault Time(second): The Fault Time in minutes can be entered from within the block. 15.3.4 Block Explanation It is used in applications where several equipment must be started and stopped in sequence for a certain period of time.
  • Page 371 It is the connection output to the equipment to be operated. Since equipment On/Off control with Mikrodev PLC products are made with digital output (DQ) or relay output (RQ); digital output (DQ) or relay output (RQ) must be connected to the block output. If the equipment is connected to the output, the digital output (DQ) or the relay output (RQ) block must be selected.
  • Page 372 15.3.5 Sample Application In the example; 2 Aging Member blocks have been added to an aging manager. The Aging Manager block’s "Sla" input is entered as “1” which indicates that the members will be run “one by one”. Two minutes were selected for both members as the aging period. The relay output connected to the first member became logic (1) for 2 minutes, after 2 minutes the first member output became logic (0) and the second member output became logic (1).
  • Page 373 15.4 DEVNET MAIN 15.4.1 Connection TCP: Connection parameters #DNetMain0: Block connection input output 15.4.2 Connection Explanations TCP: Connection parameters input It is the input connection for parameters. #DNetMain0: Block connection output It is the output connection of the block MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 374 15.4.3 Block Settings Self DevNET ID: The device's ID Timeout(ms): Timeout in milliseconds Cycle Delay (ms): The cycle delay in milliseconds Waited DevNET ID: Waited DevNET (Connected Device) ID Destination DevNET ID: Destination DevNET (Device to be connected) ID Broadcast IP Adress: The IP address to which the devices are connected MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 375 15.4.4 Block Explanation DevNET is a system that reads and writes data from one device selected via ethernet and transfers the data to the DevNET register. This system can be thought of as a circular queue structure. It is a UDP-based protocol repetitive and cyclical package. It is a multi-drop protocol and can be added to a single DEV-NET network with up to 65535 PLCs.
  • Page 376 Excellent compatibility with Mikrodev PLCs is ensured. C1-C2 ... represents Device 1-Device 2. Self DevNET Id found in the window is the DevNET Id of the device used. The timeout period found in the window is the time that one of the devices in this DevNet network is waiting for data from the previous device.
  • Page 377 15.5 DEVNET REGISTER 15.5.1 Connection #DNetReg0: Block connection output 15.5.2 Connection Explanations Val: Block connection output It is the block output connection. 15.5.3 Block Settings Remote DevNET ID: The Id of the device from which the data will be read Remote Block Number: It is the Modbus address of the block at the device from which the data will be read MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 378 15.5.4 Block Explanation The data of the registers in the device connected via the Ethernet network is transferred into this block. On the remote DevNET Id field of the window, the ID of the device to be read the data is written. The field which is labeled as Remote Block Number in the window is the Modbus address of the device to be read.
  • Page 379 16.1.5 Sample Application When PLC is started, the block gives logic(1) to block output. 16.2 RESET COUNTER 16.2.1 Connections #ResC0: Block output 16.2.2 Connection Explanations #ResCO: Block output It is block output. 16.2.3 Block Settings There are no block settings. 16.2.4 Block Explanation The reset count of the device is written to the output.
  • Page 380 16.2.5 Sample Application It is displayed the reset count of the device. 16.3 SYSTEM RESET 16.3.1 Connections Trg: Trigger Input 16.3.2 Connection Explanations Trg: Trigger input It is block trigger input. 16.3.3 Block Settings There are no block settings. 16.3.4 Block Explanation In case of rising edge trigger signal is applied to Trg input, the device performs a soft RESET.
  • Page 381 16.3.5 Sample Application When a value different from “0” is written on the word register connected to Trg input, the device is reset. 17 MULTIPLEXER BLOCKS 17.1 ANALOG QUART MULTIPLEXER 17.1.1 Connections I1: Analog quart multiplexer input I2: Analog quart multiplexer input I3: Analog quart multiplexer input #AQMux0: Analog quart multiplexer output...
  • Page 382 17.1.2 Connection Explanations I1: Analog quart multiplexer input is an Analog value input that can be written to the output depending on the value of the “S1” and “S2” block inputs. Analog Register block can be connected I2: Analog quart multiplexer input It is an Analog value input that can be written to the output depending on the value of the “S1”...
  • Page 383 17.1.3 Block Settings In1: First value can be chosen from inside of the block. In2: Second value can be chosen from inside of the block. In3:Third value can be chosen from inside of the block. In4: Fourth value can be chosen from inside of the block.
  • Page 384 The input value is transfered to the block output as a 32 bit analog value 17.1.4.1 Truth Table According to the “S1” and “S2” inputs of the Analog Quad Selector block, which input will be written to the output is specified in the following truth table. #AQMux0 17.1.5 Sample Application...
  • Page 385 17.2 WORD DUAL MULTIPLEXER 17.2.1 Connections I1: Word dual multiplexer input #WDMux0: Word dual I2: Word dual multiplexer input multiplexer output Word dual multiplexer selection input 17.2.2 Connection Explanations I1: Word dual multiplexer input Depending on the value of the “S” block input, it is the word value input that is likely to be written to the output.
  • Page 386 In order to transfer the I1 input to the block output; S:must be logic(0) In order to transfer the I2 input to the block output; S:must be logic(1) The input value is transfered to the block output as a 16 bit word value 17.2.4.1 Truth Table According to the “S”...
  • Page 387 17.3 LONG DUAL MULTIPLEXER 17.3.1 Connections It is input which is long dual multiplexer. #LDMux0: It is output It is input which is long dual which is long dual multiplexer. multiplexer It is input which is long dual multiplexer choice input 17.3.2 Connection Explanations I1: It is input which is long dual multiplexer...
  • Page 388 In order to transfer the I1 input to the block output; S:must be logic(0) In order to transfer the I2 input to the block output; S:must be logic(1) The input value is transfered to the block output as a 32 bit long value 17.3.4.1 Truth Table According to the “S”...
  • Page 389 17.4 ANALOG Dual Multiplexer 17.4.1 Connections I1: Analog dual multiplexer input #ADMux0: Analog dual I2: Analog dual multiplexer input multiplexer output S: Analog dual multiplexer selection input 17.4.2 Connection Explanations I1: Analog dual multiplexer input It is an Analog value input that can be written to the output depending on the value of the “S” input.
  • Page 390 In order to transfer the I2 input to the block output; S:must be logic(1) The input value is transfered to the block output as a 32 bit analog value 17.4.4.1 Truth Table According to the “S” block input value of the Analog Dual Multiplexer block, which input will be written to the output is specified in the truth table below.
  • Page 391 18 MOTION CONTROL BLOCKS 18.1 FAST COUNTER INPUT 18.1.1 Connections Res: Reset input #FC0: Total pulse count T: Time Period for Frequency Calculation Int: Pulse count within a period cycle Tar: Target pulse count Tar: Pulse number target reached Dir: Counting direction Up or Down 18.1.2 Connection Explanations...
  • Page 392 Note: In order to activate the block, the “AT+PTO=1” command should be sent from the Mikroterminal and reset to the device to be used 18.1.3 Block Settings Reserved Fast Counter Input No: Specifies which fast counter channel will be used by the block.
  • Page 393 Therefore, Fast counter blocks can be able to count much more faster signal than software counter. First output of the block (#FC0) indicates the total ticks counted. This value is reset when the device is reset or when a rising edge is detected on reset input of the block. It counts up or down with each incoming pulse signal.
  • Page 394 18.2 PULSE WIDTH MODULATION (PWM) 18.2.1 Connections Str: Start / Stop input Fre: Frequency input Dut: Duty Cycle input 18.2.2 Connection Explanations Str: Start/stop input Input for Start/Stop signal. If it is 0, PWM signal is shut down and related PWM channel becomes a normal digital output.
  • Page 395 18.2.3 Block Settings Reserved PWM Output No: If 0, DQ0 channel is used as PWM If 1 DQ1 channel is used as PWM If 2 DQ2 channel is used as PWM If 3 DQ3 channel is used as PWM Frequency(Hz): Frequency is specified here.
  • Page 396 low-level (0), the PWM will be passive, and the corresponding PWM output will serve as the normal digital output. “Fre” input is used to change the frequency externally. It can be left blank and can be set in the Block Settings menu. Since all the PWM channels in the device are using the same timing source, frequency value is the same for all the PWM channels.
  • Page 397 18.3 PULSE TRAIN OUTPUT 18.3.1 Connections Sta: Start input En: Enable input Sta: Start speed input Sta: Start pulse number input #PTO0: Signal output Mov: Operating speed input Sto Stop speed input Sto: Stop pulse number input Tot: Total pulse number input 18.3.2 Connection Explanations Sta: Start input It is the input for starting PTO.
  • Page 398 Mov: Operating speed input It is an operating speed input that specifies normal operating speed. The value entered here is the width of the pulse and considered as 10 µs multiplier. Sto: Stop speed input It is the input for stop speed. If there is going to be a deceleration during the stop process, the speed just before the stop moment must be entered.
  • Page 399 18.3.3 Block Settings Reserved PTO Output No If 0, DQ0 channel is used as PTO If 1 DQ1 channel is used as PTO If 2 DQ2 channel is used as PTO If 3 DQ3 channel is used as PTO Start Speed: Start speed to begin acceleration Accelerate Pulse Count: Number of pulses during the acceleration process...
  • Page 400 IN[7]: Total Pulse Count Acceleration + Constant + Deceleration IN[3]: Acceleration IN[6]: Deceleration Pulse Count Pulse Count Speed / Pulse Width = 10us * <IN[x]> Time Pulse Width of Speed α IN[5]: Width of Last Pulse IN[2]: Starting Pulse IN[4]: Constant Speed Width Pulse Width DECELERATION...
  • Page 401 After the PTO block starts to work, the output signal of the block goes to Logic(0) . After the total number of pulses is completed, the "#PTO0" output goes to Logic(1). Connecting to “#PTO0” output to another PTO block inputs result in controlling multiple PTO blocks together. 18.4 AXIS DEFINITON 18.4.1 Connections Ena: Enable input of the block...
  • Page 402 18.4.3 Block Settings Axis Number: Specifies the output which the axis block will be using Axis Unit: Machine Unit: Moves in units of millimeters. Motor Unit: Moves in units of pulses. Axis Type: Specifies how to reach the deisred position. Encoder Number: Specifies the encoder number.
  • Page 403 18.4.4 Block Explanation This block is used to control the position of the system on the axis. The block keeps the last position of the system and using this info control the Pulse Train Outputs to realize position aware movement. When a Logic(1) signal is applied to “Go Home”...
  • Page 404 Move/Rev: In Machine Unit option, defines the speed. Speed of the motor is reversely proportional with the number entered here. It has the units of milliseconds. MaxSpeed(Pulse,sec): Defines the maximum speed of the motor when operating. The number is reversely proportional with the speed of the motor. It has units of microseconds. Turn Home Speed: Defines the speed when going to starting point.
  • Page 405 18.5.2 Connection Explanations Sta: Start command binary input: When a signal is applied to this input, block start to drive system. Abs: Target position Determines the target position. Wor: Input for motor speed: Motor speed is setting by connecting a word register to this input. Sta: Input for starting speed: Specifies the ramp speed before reaching to the target input.
  • Page 406 18.5.3 Block Settings Axis Number: Specifies the axis number. TargetSpeed(pulse/sec,mm/sec): Specifies the target speed. Start/Stop Speed(pulse/sec,mm/sec): Specifies the start and stop speed of the motor. Acceleration Duration: Specifies the acceleration duration. Deceleration Duration: Specifies the deceleration duration. 18.5.4 Block Explanation It is used to stabilize the position of the servo motor.
  • Page 407 Acc: Specifies the acceleration time of the motor. Desired value can be entered in Block Settings menu either. Dec: Specifies the deceleration time of the motor. Desired value can be entered in Block Settings menu either. Mov: Specifies the target position. By connecting a word or long register required pulse count is indicated.
  • Page 408 19.1.3 Block Settings Parse Method: Evaluates the incoming data according to the exception set in the tab. FrameTimeOut(ms): It reads the incoming data packet within the ms value specified here. Paket Boyutu: It determines the size of the incoming data packet in bytes. SOF: This is the field where the starting character of the incoming data packet is entered.
  • Page 409 19.2 Packet Parser 19.2.1 Connections #PPar0: Parsed result output RxP: Rx packet input isR: Result valid output 19.2.2 Connection Explanations RxP: Rx packet input The output of the Rx Packet block is connected to the “RxP” input of the Packet Parser block. #PPar0: Parsed result output Parceled data value is output isR: Result valid output...
  • Page 410 19.2.3 Block Settings Parse Segment Type: How to split the incoming data packet is selected under this tab. Parse Value Type: The value type of the data to be parsed. Segment: ValueIndex: After which index the incoming data packet should be separated is entered here.
  • Page 411 19.2.5 Sample Application For the example, we have chosen the decoding method of the Rx packet block as "Beginning/End of Packet". The beginning-of-package character is A and the end-of-package character is B. Index ranges are determined by connecting a packet parser block to its output. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 412 For example, when 41 01 00 02 00 FF 00 FF 00 42 is sent in hex base, the characters at the beginning of the packet and the end of the packet match (41 : A , 42:B) and the data packets are formed if the 8 bytes are in between.
  • Page 413 19.3 Tx Packet 19.3.1 Connections Cha: Block connection input #TxPAc0: Block output Val: Block value input Tx: Trigger input 19.3.2 Connection Explanations Cha: Block connection input Serial port is the input connection to which the block output is connected. Val: Block value input The values that we send from this input form the data to be included in the data package to be sent.
  • Page 414 19.3.3 Block Settings Checksum Type: Operation Type: Specifies the type of data to be sent Message: The data package form to be sent is entered. Ex: “ C1DDE” C: start E: end character ValueIndex: The data in the message to be sent starts from the 2nd Index.
  • Page 415 19.3.5 Sample Application In the above example application, the value 7 is sent with the Tx Packet block and is read by the Docklight application, which is a serial port simulation. In the picture on the side, the rules to package and send the data to be sent in the Tx Packet block are set.
  • Page 416 19.4 Serial Gateway 19.4.1 Connections Rem: Connection input Loc: Connection input Tx: Data size input Tx: Data TimeOut time input 19.4.2 Connection Explanations Rem: Connection input The port input to which the remote device is connected is set. Loc: Connection input It is the serial port input to which the locally operating device is connected.
  • Page 417 19.4.3 Block Settings Buffer Size: It is the size of the value in bytes of the data to be sent in a single packet. This value can also be determined from the “Tx” block input. Buffer Timeout (milliseconds): This is the place where the “timeout”...
  • Page 418 between the device that communicates through the serial port working locally and the device that is connected remotely, using the Serial Gateway block. Hercules app for remote device simulation, Example using Docklight for serial connection simulation, In the simulation application above, the "Hello, I'm Docklight" message sent as ASCII over the Serial Port was read by Hercules and the "Hello, I'm Hercules"...
  • Page 419 20 STRING BLOCKS 20.1 STRING REFERANCE 20.1.1 Connections #StrRef0: String data output 20.1.2 Connection Explanations #StrRef0: String data output String data output is a reference connection. 20.1.3 Block Settings String Offset: It is the part of the string table where the data to be used is selected.
  • Page 420 20.1.4 Block Explanation It is used to select and use the desired index in the String Table for blocks that process or input texts (String - Text). ”String table” part is pushed from project tab in order to reach String table on the Mikrodiagram or Telediagram From on the String table will be used string contains such as (number, message containing etc.) can be entered in the String table.
  • Page 421 20.2 STRING MANIPULATION 20.2.1 Connections InA: First string value input InB: Second string value input #StrM0: String change output Trg: Trigger input 20.2.2 Connection Explanations InA: First string value input It is first string’s input. InB: Second string value input It is second string’s input.
  • Page 422 20.2.3 Block Settings Text Offset: Result of operation which is written on String table is determined the index. String Math: The part of the process to be done is selected. On When Trig is Active: If selected; When the rising edge (logic (1)) trigger comes to the block “Ttk”...
  • Page 423 “InB” input is appended to the end of the string reference linked to the “InA” input. The result is written to the string table index selected from the String Offset in the block options. (Ex: InA=micro, InB=dev Result=mikrodev) MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 424 20.2.5 Sample Application The data from the word register connected to the inA input will be converted to string value with the expression "% s" at the inB input. When the trigger is active is signed when only DI0 logic high(1) signal comes will operate. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 425 20.3 STRING OPERATION 20.3.1 Connections InA: First string value input InB: Second string value input #StrOp0: String processing output Trg: Trigger input 20.3.2 Connection Explanations InA: First string value input It is first string value input InB: Second string value input It is second text value input.
  • Page 426 20.3.3 Block Settings Math: Strings process steps that are part of the selection. On When Trig is Active: If selected; When the rising edge (logic (1)) trigger comes to the block “Ttk” block input, the action is taken. 20.3.4 Block Explanation As doing operation on the string reference ,result of operation composed the integer value is written blocks output.
  • Page 427 21 CALENDER BLOCKS 21.1 WEEKLY TIMER 21.1.1 Connections Day: Day selection input O.T: Opening time input #WT0: Block Output C.T: Closing time input 21.1.2 Connection Explanations Day: Day selection input It is day selection input. O.T: Opening time input It is the input which determine opening time. C.T: Closing time input It is the input which determine closing time.
  • Page 428 21.1.3 Block Settings Days: Determines the operating days for weekly timer. Hour period: It determines weekly timer’s operating interval. All Day: If it is chosen the hour period becomes passive; block output is activated during 24 hours for the selected days 21.1.4 Block Explanation O1 output becomes logic(1) for the selected day and time intervals.
  • Page 429 Sunday. Thus 1 for Monday, 2 for Tuesday, 4 for Wednesday, 8 for Thursday, 16 for Friday, 32 for Saturday, 64 for Sunday values must be entered. When more than one day is wanted to be chosen, corresponding values is written as a sum. For example, when it is wanted to choose Monday, Wednesday and Friday, 1+4+16=21 value must be entered.
  • Page 430 Pump will operate in the selected days of the week such as Tuesday, Thursday, Friday between 08.30 and 17.00 hours and it will not operate in other days and times. 21.2 YEARLY TIMER 21.2.1 Connections O.D: Date of opening input #YT0: Block output C.D: Date of closing input 21.2.2...
  • Page 431 21.2.3 Block Settings Open Date: The date value which Yearly timer’s output will be logic (1) can be determined in the block. Close Date: The date value which Yearly timer’s output will be logic (0) can be determined in the block. MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 432 21.2.4 Block Explanation It is used to generate a logical (1) output between two selected time intervals of the year. It outputs the logic(1) signal in between opening and closing dates which are entered and if else logic(0). If opening date(O.T) and closing date (C.T) is entered from out of block, Unix Epoch Time type is entered as opening and closing time.
  • Page 433 #ATmr0: Block output For the location in the entered coordinates, Block output is logic(1) for day time and logic(0) for night time. SunRise: Sunrise time Sunrise time for location in the entered coordinates. For example if sunrise is 05:43, 543 value is read in this block output.
  • Page 434 21.3.4 Block Explanation Sunset and sunrise time is calculated by using the latitude and longitude values. This time calculation is run once in everyday at midnight. According to sunrise/sunset time, the block output is set. Output of block is updated once every minute. In the Day output of block, during the daytime logic(1) signal output is generated, after sunset the logic(0) output I generated during the night time for the entered coordinates.
  • Page 435 For example; latitude 41, longitude 29 and offset 2 values must be entered for İstanbul. When clocks go forward for summer time the offset should be set to 3. Sunset and sunrise times can be viewed from output of “Sunrise” and “Sunset” outputs. 21.4 SYSTEM SECONDS 21.4.1 Connections...
  • Page 436 21.4.5 Sample Application In the example, real second value of the PLC is read. 21.5 SYSTEM MILISECONDS 21.5.1 Connections Sta: Block output 21.5.2 Connection Explanations Sta: Block output It is block output which shows the system’s milliseconds as a 32 bit value. 21.5.3 Block Settings There is no Block Settings...
  • Page 437 21.5.5 Sample Application In the example, time since the PLC reset is seen as milliseconds value.(The system is reset nearly before 15 seconds.) 21.6 SYSTEM HHMM (HOUR-MINUTE) 21.6.1 Connections #SHHM1: Block minutes output Hou: Block hour output 21.6.2 Connection Explanations #SHHM1: Block minutes output It is the minute value, 16 bits long Word Hou: Block hour output...
  • Page 438 21.6.5 Sample Application The PLC’s hours and minutes information is read and that the current time is seen as 14:56. 21.7 SYSTEM DAY OF WEEK 21.7.1 Connections #SDWB0: Block output 21.7.2 Connection Explanations #SDWB0: Block output It is 16 bits long word output that read the day of weeks value MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 439 21.7.3 Block Settings There is no block settings. 21.7.4 Block Explanation System day of week shows PLC’s real time clock’s week of day. It is read such as Sunday 0, Monday 1, Tuesday 2,Wednesday 3,Thursday 4, Friday 5,Saturday 6. 21.7.5 Sample Application Shows the day of week.
  • Page 440 21.8.4 Block Explanation The system day of month block shows PLC’s real time clock’s day of month. It displays values between 1-31. 21.8.5 Sample Application Day of month value is showed on the block. 21.9 SYSTEM DAY OF YEAR 21.9.1 Connections #SDYB0: Block output 21.9.2...
  • Page 441 21.9.5 Sample Application The value of the day of the year is read and it is 216 days since the beginning of the year. 21.10 SYSTEM MONTH 21.10.1 Connections #SMoB0: Block output 21.10.2 Block Explanation #SMoB0: Block output It is the block output 21.10.3 Block Settings There is no Block Settings...
  • Page 442 21.10.5 Sample Application It is seen that it is the eighth month of the year (August). 21.11 SYSTEM YEAR 21.11.1 Connections #SYeB0: Block output 21.11.2 Connection Explanations #SYeB0: Block output It is the connection of block output 21.11.3 Block Settings There is no Block Settings 21.11.4 Block Explanation...
  • Page 443 21.11.5 Sample Application It is read the year value of the system. 21.12 NTP SYNCRONISE BLOCK 21.12.1 Connection Ser: NTP Server Input Por: NTP Server Port Input Trg: Trig Input 21.12.2 Connection Explanations Ser: NTP Server Input NTP Server IP can be defined from this entry in the block. Por: NTP Server Port Input NTP Server Port number can be defined from this entry in the block Trg: Trig Input...
  • Page 444 21.12.3 Block Settings NTP Server IP: NTP Server IP number can be entered from the block entry or can be set from the block special settings.. NTP Server Port: NTP Server Port number can be entered from the block entry or can be set from the block special settings.
  • Page 445 21.12.5 Sample Application The timing frequency of the real-time pulse generator is 1 per second. The RTPG block sends a trigger once per second to the NTP synchronization block, performing a time synchronization with the NTP server once per second MP110 and MP211 PLC SERIES/ Programming Manual...
  • Page 446 21.13 SAVE TIME 21.13.1 Connections Sav: Saving trigger input Sec: Second input Min: Minute input Hou: Hour input #STiB0: Block output Day: Day input Mon: Month input Yea: Year input 21.13.2 Connection Explanations Sav: Saving trigger input It is the input to be triggered in rising edge for saving time. Sec: Second input It is the seconds input of Save Time.
  • Page 447 It is the month input of Save Time. Year: Year input It is the year input of Save Time. #STiB0: Block output It is the block output connection. 21.13.3 Block Settings There is no Block Settings. 21.13.4 Block Explanation It is used to set the PLC’s time and date within the logic project. It saves the values written into the block inputs to the real time clock of the PLC at the rising edge instance of the “Save Input”.
  • Page 448 In the example; the time and date values written to the inputs of the save time block are written to the real time clock at the rising edge trigger of the "Sav" input. 21.14 TIME PLAN PICKER 21.14.1 Connections #TPP0: Default output Rem: Remaining output 21.14.2 Connection Explanations...
  • Page 449 21.14.4 Blok Explanation It can be used in conjunction with Mikrodev ViewPLUS SCADA. It CAN NOT BE USED alone. If the index is selected in the Mikrodiagram "Time Plan Picker", the same index of the "Schedule Tag" must be selected in ViewPLUS SCADA. In order to make settings for "Time Plan Picker", at "View PLUS SCADA"...
  • Page 450 The "Def" output of the "Time Plan Picker" is in logic(1) if the day and time is in selection range of the PLC clock selected from "ViewPLUS SCADA", while in other cases the "Def" output is logic(0). "Rem" output block is logic low(0), if it satisfies the time zone condition selected from the ViewPLUS SCADA;...
  • Page 451 In the examples; PLC program is in first picture and ViewPLUS SCADA interface is in the second picture. In the case of “time plan picker 1”, the output of "Def" output and relay (RQ0) is logic (1) because the PLC time is on one of the selected days and the time is between 14:22 and 14:25. The “Rem” output is logic low(0) because of the output “Def”...
  • Page 452 It is the second data input. in2: Third data input It is the third data input. in3: Fourth data input It is the fourth data input. Trg: Trigger input It is trigger connection input. #MCR0: First data output It is the first data output. o1: Second data output It is the second data output.
  • Page 453 22.1.4 Block Explanations Custom blocks can be designed by inserting special command definitions in the macro field of the block. There are 50 analog variables you could use in the macro block. You can use variable definitions in the macro using the addresses "v0", "v1", "v2" ... and "v49". The variables are off floating point-analog type .
  • Page 454 [IF, v1,2] [v2 = $1504 + 0] In the above example; [v1 = v0> $1504] > If the value of "v0" is greater than the value of block $1504, logic (1) will be assigned to v1. [IF, v1,2] > If “v1” value is logic (0), skip two lines; If “v1” is logic (1) continue to the next command line. [v2 = $1504 + 0] >...
  • Page 455 22.1.4.1 Commands Command Command Definition Plus Minus Multiply Divided by Modular arithmetic Logical “AND” operation & Logical “OR” operation Logical “X-OR” operation > Greater than < Less than Equal to Greater than or equal to Less than or equal to Not equal to Logical “IF”...
  • Page 456 22.1.5 Sample Application Control of 8 binary register values by the logical "and" operation written in the macro: The macro block will only operate when the trig is active. Macro commands: [v0 = $3000 & $3001 ] -> Evaluate the registers addressed with $3000 and $3001 in the logical "and"...
  • Page 457 Process result with all register values are logic(1): The definition of the AND operation is that if all of the inputs are logic (1), the output is logic (1), so the macro block output is logic (1). MP110 and MP211 PLC SERIES/ Programming Manual...

This manual is also suitable for:

Mp211 plc series