Mikrodev SM Rtu PM en
Mikrodev SM Rtu PM en
Mikrodev SM Rtu PM en
Manual
• RTU300/RTU400
RTU Series
07 / 2018 1.6
MIKRODEV_SM_RTU_PM_EN
CONTENT
1 LOGIC GATE BLOCKS ......................................................................................10
In the programming of RTU300 / RTU400 series devices, Function Block Diagram - FBD
language which is defined in IEC 61131-3 standard is used. Thanks to the programming
with the FBD language, the project can be developed easily and quickly with the drag and
drop logic.
In this document, you can find information about the function block library components
used to program Mikrodev RTU300/RTU400 series RTUs.
Please follow our website www.mikrodev.com for the up to date version of the document.
Since 2006, MIKRODEV has been developing and manufacturing industrial control and
communication products. MIKRODEV serves the system integrators in the public and
private sector, OEM and end users.
Our products are manufactured complying with the quality standards required by the
industrial automation industry and the quality of our products are proved on the field for
many years
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.
MIKRODEV products' performance and wide range of applications make them possible for
customers to achieve faster, simplified and cost-effective results.
Failure to comply with these rules may result in death, serious injury or
property damage
1.1.1 Connections
I: Signal input
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.2.1 Connections
1.2.5 Not Gate is used for inverting the input signals. If the input signal is high(1) the output
will be low(0) and if the input signal is “0” the output will be “1”.
1.3 OR GATE
1.3.1 Connections
I1: Signal input
Q1:Output
I3: Signal input
of the block
0 0 0
0 1 1
1 0 1
1 1 1
1.4.1 Connections
1.4.8 Examples
1.5.1 Connections
I1: Signal input
Q1:Output
I3: Signal input
of the block
1.5.8 Examples
1.6.1 Connections
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
1.7.1 Connections
I1: Signal input
Q1:Output
I3: Signal input of the block
2.2.1 Connections
2.3.1 Connections
2.4.1 Connections
2.5.1 Connections
2.6.1 Connections
2.7.1 Connections
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.
f the block is locked, the value at the first output of the block is equal to the locked value in the block
settings. If the block is not locked, it is equal to the related physical input’s value.
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 address plus 1”.
2.8.1 Connections
Locked:
Lock / Offset:
Lock: Write the value at the lock or shift
box to the output.
Offset: It is not activated on digital inputs
with locks.
If the block is locked, the value at the first output of the block is equal to the locked value in the block
settings. If the block is not locked, it is equal to the related physical input’s value.
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.
2.9.1 Connections
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.
Offset: It is not activated on digital inputs
with locks.
If the block is locked, the value at the first output of the block is equal to the locked value in the block
settings or it is equal to the sum of the real value and the offset value. If the block is not locked, it is
equal to the related physical input’s value.
Third output of the block indicates the value which will be written or added to the output when when
the first output is 1 or 2 respectively. This output is mapped into Modbus addresses and can be read
or written remotely. The Modbus address of the output is “block address plus 4”.
As an example; if block modbus address of the block is 6012 : first output 6012, second output 6014,
third output 6016.
2.10.1 Connections
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.
Offset: It is not activated on digital inputs
with locks.
If the block is locked, the value at the first output of the block is equal to the locked value in the block
settings. If the block is not locked, it is equal to the related physical input’s value.
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 address plus 1”.
2.11.1 Connections
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.
Offset: It is not activated on digital inputs
with locks.
If the block is locked, the value at the first output of the block is equal to the locked value
in the block settings. If the block is not locked, it is equal to the related physical input’s value.
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 of the block address plus 2.
2.12.1 Connections
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.
Offset: It is not activated on digital inputs
with locks.
If the block is locked, the value at the first output of the block is equal to the locked value in the block
settings. If the block is not locked, it is equal to the related physical input’s value.
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 address plus 1”.
3.1.1 Connections
Q1: Block
output
Trg:Trigger Input
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.2.1 Connections
4.1 ON DELAY
4.1.1 Connections
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.
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.
.
4.2.1 Connections
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.
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.
As soon as received Logic(1) signal at Trg input, Q1 output state is changed to Logic(1) immediately.
T value can be written in block custom settings.
Any type of block signal “word”,”analog” or ”long” can be connected to the T input. T is number which
is between the 0-65535 and be careful about variable type range.
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.
4.3.1 Connections
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).
4.4.1 Connections
İ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.
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.
After Q1 state goes to Logic(1), Q1 output signal keeps its states as long as receiving a rising edge at
RST input.
When a rising edge signal applied to RST input, Q1 Block output goes to Logic(0)
T value can be written in block custom settings.
Any type of block signal “word”,”analog” or ”long” can be connected to the T input. T is number which
is between the 0-65535 and be careful about variable type range.
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)
4.5.1 Connections
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.
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.1 Connections
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.
Any type of block signal “word”,”analog” or ”long” can be connected to the T input. T is number which
is between the 0-65535 and be careful about variable type range.
When DI0 is logic(1), DQ0 will be 5 seconds logic(0), 5 seconds logic(1) periodically.
4.7.1 Connections
Timing :
Pulse period choice can be done from in the
block.
It cannot be choosen from block inputs.
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.
5.1.1 Connections
Compare Type:
INB:
INC:
5.2.1 Connections
Compare Type:
INB:
INC:
5.3.1 Connections
Comparison Type:
INB:
Settings.
INC:
Settings.
5.4.1 Connections
Math Type:
INB:
Write On Input:
In “Sum_1” 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 “Sum_2” 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.
In “Subt_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 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.
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.
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.
Corresponding binary value of the decimal value at the inA: (10) 10=(01010)2
Corresponding binary value of the decimal value at the inB: (24)10= (11000)2
The result of bitwise AND operation between inA and inB is: (8) 10=(01000)2
The result of bitwise OR operation between inA and inB is: (26) 10=(11010)2
Corresponding binary value of the decimal value at the inA: (8) 10=(01000)2
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)10=(10000)2 is obtained.
Shift Right: When 8 is shifted right by 1: (4)10=(00100)2 is obtained.
Corresponding binary value of the decimal value at the inA: (21) 10=(10101)2
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)2 :1.
In “Check Bit 2” example, the value of the checked bit is (10101)2 :0.
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.
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. Since the value at the inB input is smaller than the low
limit, the value at the inA is written to the O1 output of the block.
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. Since the value at the inB input is greater than the low
limit, the value at the inA is written to the O1 output of the block.
An 8bit merge block is connected to inA input of the block and an other 8bit merge block is connected
to inB input of the block. The value at the inB block is shifted left by 8bits and added to the value at the
inA input of the block. That way, a merge 16 bit merge block is designed with 0-8 bits are connected to
inA input and 9-15 bits are connected to inB input.
5.5.1 Connections
INB:
Write On Input:
block.
It is used for IEE754 floating point number mathematical operations. With Analog Math
Block, “addition”, “subtraction”, “multiplication”, “division”, “absolute value”, “square root”,
“sin”, “cos”, “tan”, “asin”, “acos”, “atan1”, “atan2”, “get”, “lower limit”, “upper limit”, “set”
and “Word to Signed” operations can be performed.
On When Trig is Active: If this option is selected, with every rising edge on the Trig input
of the block, specified mathematical operation is performed.
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. An Analog register should be connected to the inA input of the
block. This operation is performed at each PLC cycle by default. If “On When Trig is Active”
option is selected, this operation is performed at each rising edge detected on
the Trig input of the block.
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.
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.
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.
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.
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. Since the value at the inB input is smaller than the
low limit, the value at the inA is written to the O1 output of the block.
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. Since the value at the inB input is greater than
the low limit, the value at the inA is written to the O1 output of the block.
5.6.1 Connections
Math Type:
INB:
Write On Input:
block.
5.6.6 Examples
Addition 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.
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.
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.
Corresponding binary value of the decimal value at the inA: (27) 10=(11011)2
Corresponding binary value of the decimal value at the inB: (20) 10= (01011)2
The result of bitwise XOR operation between inA and inB is: (16) 10=(10000)2
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.
Corresponding binary value of the decimal value at the inA: ; (4) 10=(00100)2
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 OUT output of the block.
Shift Left: When 8 is shifted left by 1: (16)10=(10000)2 is obtained.
Shift Right: When 8 is shifted right by 1: (1)10=(00001)2 is obtained.
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” example, low limit is activated. Since the value at the inB input is smaller than the
low limit, the value at the inA is written to the OUT output of the block.
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” example, high limit is activated. Since the value at the inB input is greater than
the low limit, the value at the inA is written to the OUT output of the block.
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.
Set example:
6.1.1 Connections
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" input.
Retentive(Persistence):
If selected; the counter keeps the last
value when the power of the device is
interrupted or reset.
It is used to increment the counting process from any value in positive (+) direction one by one, or to
reduce a value in negative (-) direction one by one.
If the counter direction is to be determined from outside the block;
"Dir" input of the counter is logic high(1) => the counter has positive (+) direction
"Dir" input of the counter is logic low(0) => the counter has positive (-) direction
The counter Increases/decreases value by 1 on the rising edge of the logic high(1) signal applied to
“Trg” input.
The reference point from which the counting process starts can be specified by overwriting the block
register.
It can count 32 bits signed integers.
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.
6.2.1 Connections
Up: Up input
Retentive (Persistence):
It is used when positive (+) direction and negative (-) direction counting is done from two different
inputs on the block.
The counter value increases by 1 when the rising edge applied at the "Up" input.
When the rising edge applied the "Dow" input, the counter value 1 is decremented.
The reference point from which counting starts can be specified by writing on the block register.
Up to 32-bit counting can be performed.
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.
6.3.1 Connections
Time Scale:
“Seconds, minutes, hours" can be selected
from the time scales.
When the "Act" input is logic(1), it counts the time in selected time scale (seconds, minutes, hours and
writes to the output.
On every logic(1) signal applied on the "Act" input, it continues to count from the last value.
The counter value is reset when the rising edge is applied on the block "Res" input.
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.
7.1.1 Connections
Parse Method:
There are two methods; “String
Compare” and “Ascii to Integer”.
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. Because,
received text message will be written
into it.
SMS receiver block is used in applications requiring SMS control. String reference blocks are
connected to the No and Msg inputs.
“Text Offset” combobox, determines the offset which the received SMS will be saved into. This index
value should be an appropriate value in the string table, care must be taken for not to affect the
indices used by other blocks.
The incoming SMS text is written to the index determined from the options. Thus, this value can be
used as desired with text reference.
Phone No to be accepted: You need to enter the telephone number into the "String Table" which will
be used to accept SMS messages including the country code(i.e +44752…). If an SMS from any
number will be accepted, this input is left blank or the phone number is entered as “0”.
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.
When each SMS is received, the Fla output generates a rising edge trigger.
The SMS Receiver block is available on non-PPP firmwares if only the device has GSM feature and
SMS feature is turned on.
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. When we consider the system off blocks group;
"close_role" is connected to the string reference, and when "close_role" SMS is received from the
number specified in the string table, the pulse relay RQ0 will become logical low(0) and the system will
stop. "Out" and "Fla" outputs are connected to AND gate, and each time the SMS arrives, the
operations are performed in the same way.
7.2.1 Connections
This block is used to send SMS Texts from the device to any mobile phone. When a rising edge signal
is applied to Trg input of the block, SMS text is build from the “Msg Input” - SMS text body and then it
will be sent to mobile number defined in “Number Input”
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 references are connected to the input “No” and the number to which the SMS will be sent is
selected from string table.
If you need to send SMS to the last number which SMS is received from, the symbol "<" defined in the
string table should be entered in the string reference connected to the No input.
In the Msg input, the SMS content to be sent is entered. This content also needs to be connected
through a string reference block.
If you want to send a block value connected to the block’s “IN” input as SMS, “%s” should be written
into the SMS content to be sent in the string table. For example; "Room temperature is %s". ( “% s” is
replaced with the block value in the IN input is replaced.)
In order to be able to send more than one block values by SMS, '$' is added to the beginning of the
block addresses and added to the string table. For example, if the description in the string table is
"Measured values are line1: $3000, line2: $3004" is sent, values of the blocks 3000 and 3004 are
sent.
Note: A maximum of 63 characters can be entered into the text field in the String Table.
Note: The SMS functions are only available on PPP disable firmware.
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 input is sent with the command "%s" and AI0 (line 5001) is sent with "$ 5001"
command as SMS with the rising edge trigger coming to the block value trg input.
7.3.1 Connections
Thanks to the DTMF blocks, Remote control projects via Phone DTMF codes can be easily done. If
incoming call is generated from the specified number or there is no phone number filter, then, call is
accepted by the device and the DTMF codes entered from the remote phone is reflected on the block
output.
Call output generates a logical high(1) signal at its output as long as a call continues.
After the call is accepted, the "*" key is pressed first in the telephone in order to operate with the
DTMF code. Enter the desired DTMF code and press the "#" key. Here, the value entered between *
and # is transferred to the DTM output as a “word integer” output. 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 "*" key. The DTMF code entered with the "#" key is transmitted to the output.
In the example; The telephone number whose call will be accepted is entered with the text reference.
If "equal" is selected in the comparators, if the inB value of the comparison type is equal to the inA
value, then the outputs are logic high(1).
When the DTMF code * 10 # is sent after the call is accepted, the pulse relay is set and RQ0 will be
logic high(1). When the DTMF code * 20 # is sent, the pulse relay output will be reset and RQ0 will be
logic (0). In this way, any equipment with DTMF codes can be subjected to remote control operations
such as turn off/on etc.
7.4.1 Connections
Applying the logical high (1) signal to the input of the DTMF Originate Call block makes a call to the
defined number.
The DTMF code cannot be sent even if the incoming call is answered by the user. In the case of a
scenario in which a program is defined, a call is made with the rising edge trigger coming to the Ori
input.
Enter the phone number to originate the call to input No with string reference blocks . You can also
enter the number in the block options by leaving this input blank.
When a high-level signal arrives at the Ori input, the block will be activated and the specified number
will be called.
SMS number will be sent to Turkey in the text table "+90" adding "+901234567898" should be entered.
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.
The telephone number to call is determined by text reference. The number specified by the rising edge
trigger signal coming to the input "Ori" will be dialed.
7.5.1 Connections
O:Block output
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.
If block value is 1, the signal level is at the lowest level and 31 is at the highest level.
This feature is only available on non-PPP firmwares for devices with GSM capability.
8.1 LOGGER
8.1.1 Connections
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.
With every high edge signal which is comes to Trg input, the LOG record is kept. Which block datas
will write to the LOG memory in logger operation is determined with the choosing “Add to log-record
memory". Block data and real time information are written together.
When is applied the high signal to the “En” input, The block will active.
“Add to log-record memory” choice must be choosen in block choices which is wanted recording for
log record.
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.
9.1.1 Connections
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.
Edge Type Options: High, Low, Raise, Fall,
Raise/Fall
Persistence:
If it is selected, register value is non-
volatile even if the device power is off.
Last value of the register is reloaded
automatically after power on.
Load Initial Value:
Active only Persistence is selected.
This is a selection between initial value
coming from user project or last saved
value coming from non-volatile momory as
a initial value after new project is
downloaded into device.
Possible “Edge type “ options and usage are given at following table:
High Only if the Lat Signal is Logic(1), Value at I1 input is saved into Register Memory
Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat
Signal
Fall Value at I1 input is saved into Register Memory when Falling edge of the Lat Signal
Both Value at I1 input is saved into Register Memory when Raising or Falling edge of the
Lat Signal
I1 Data Input signal type may be different from register block type. For example, Analog signal can be
applied to Word register block. In that case, Automatic variable casting occurs. Therefore, user must
be pay attention to variable types.
Sample transformation table is given the below from different variable types for entiring value to the
word register
It is the variable type in input Sample Input Value It is value which is will be
loaded to the word register
Binary 0 0
Binary 1 1
Analog 12.34 12
Analog 98.9 98
Long 65000 65000
Long 80000 (0x00013880) 14464 (0x3880)
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.
9.2.1 Connections
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.
Edge Type Options: High, Low, Raise, Fall,
Raise/Fall
Persistence:
If it is selected, register value is non-
volatile even if the device power is off.
Last value of the register is reloaded
automatically after power on.
Load Initial Value:
Active only Persistence is selected.
This is a selection between initial value
coming from user project or last saved
value coming from non-volatile momory as
a initial value after new project is
downloaded into device.
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.
Possible “Edge type “ options and usage are given at following table:
High Only if the Lat Signal is Logic(1), Value at I1 input is saved into Register Memory
Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat
Signal
Fall Value at I1 input is saved into Register Memory when Falling edge of the Lat Signal
Both Value at I1 input is saved into Register Memory when Raising or Falling edge of the
Lat Signal
I1 Data Input signal type may be different from register block type. For example, Word signal can be
applied to Analog register block. In that case, Automatic variable casting occurs. Therefore, user must
be pay attention to variable types.
Sample transformation table is given the below from different variable types for entiring value to the
word register
It is the variable type in input Sample Input Value It is value which is will be loaded
to the analog register
Binary 0 0.0
Binary 1 1.0
Word 12 12.0
Word 98 98.0
Long 65000 65000.0
Long 80000 80000.0
In the sample;
“-5.6 “ value was written as offline or online in to the analog register which is 5000 block number by the
user. The output of block which is 6000 due to connected the 6002 block number “–5.6” value was
written in to the analog register which is 6002 block number. (“Lat” input is given the blank because of
“Edge Type is selected as “low”)
9.3.1 Connections
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.
Edge Type Options: High, Low, Raise, Fall,
Raise/Fall
Persistence:
If it is selected, register value is non-
volatile even if the device power is off.
Last value of the register is reloaded
automatically after power on.
Word Register Block is used as a 32 bit signed integer 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.
Possible “Edge type “ options and usage are given at following table:
Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat
Signal
Fall Value at I1 input is saved into Register Memory when Falling edge of the Lat Signal
Both Value at I1 input is saved into Register Memory when Raising or Falling edge of the
Lat Signal
I1 Data Input signal type may be different from register block type. For example, Analog signal can be
applied to Long register block. In that case, Automatic variable casting occurs. Therefore, user must
be pay attention to variable types.
Sample transformation table is given the below from different variable types for entiring value to the
Long register.
It is the variable type in input Sample Input Value It is value which is will be loaded
to the long register
Binary 0 0
Binary 1 1
Analog 12.34 12
Analog 98.9 98
Word 65000 65000
In the sample:
Due to the the name of long register is selected as “edge type”, every high edge trigger to Lat input,
Analog register is recorded to the long register.
9.4.1 Connections
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.
Edge Type Options: High, Low, Raise, Fall,
Raise/Fall
Persistence:
If it is selected, register value is non-
volatile even if the device power is off.
Last value of the register is reloaded
automatically after power on.
Load Initial Value:
Active only Persistence is selected.
This is a selection between initial value
coming from user project or last saved
value coming from non-volatile momory as
a initial value after new project is
downloaded into device.
Possible “Edge type “ options and usage are given at following table:
High Only if the Lat Signal is Logic(1), Value at I1 input is saved into Register Memory
Raise Value at I1 input is saved into Register Memory when Raising edge of the Lat
Signal
Fall Value at I1 input is saved into Register Memory when Falling edge of the Lat Signal
Both Value at I1 input is saved into Register Memory when Raising or Falling edge of the
Lat Signal
I1 Data Input signal type may be different from register block type. For example, Analog signal can be
applied to Binary register block. In that case, Automatic variable casting occurs. Therefore, user must
be pay attention to variable types.
Sample transformation table is given the below from different variable types for entiring value to the
word register
It is the variable type in input Sample Input Value It is value which is will be loaded
to the binary register
Word 0 0
Word 234 1
Analog 0.0 0
Analog 98.9 1
Long 0 0
Long 80000 1
In the sample;
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.1 Connections
Flag register may be used to prevent logic operations from infinite logic loops when feedback is
applied.
In the sample:
After delaying 3 second the draw, the binary flag has become logical (1), resetting the "Pulse
Relay", DQ0 has taken to logical (0) position.
9.6.1 Connections
Flag register may be used to prevent logic operations from infinite logic loops when feedback is
applied.
9.7.1 Connections
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.
9.8.1 Connections
Flag register may be used to prevent logic operations from infinite logic loops when feedback is
applied.
10.1.1 Connections
On the serial port MODBUS RTU Master protocol is actived. The device as an RTU Master sends
reading and writing requests to slave devices.
10.2.1 Connections
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” to Master block. Generally, requests are grouped as reading and writing in the
MODBUS protocol. When MODBUS request blocks which are used for reading and writing are
triggered, the request is added to the queue on Master Block. If the RS485 line is idle, the requests in
the queue on Master Block are sent one by one and response is waited. If a response is received
before “timeout” duration, the reply is processed, if no reponse is received the request is canceled and
error counter is increased by one. Here “timeout” duration is defined in master block’s settings section.
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.
.
MODBUS TCP Master protocol is actived on TCP socket. The device as an TCP Master sends
reading and writing requests to slave devices.
10.3.1 Connections
Add:
Sta: Connection status
output
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.
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
Word Blocks 4000 (0x03) Read Holding Registers
(0x04) Read Input Registers
(0x06) Write Single Register
(0x10) Write Multiple registers
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
10.4.1 Connections
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.
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
Blok Name Modbus slave adress Function Name
Two – Binary Blocks 1000 (0x01) Read Coils
(0x02) Read Discrete Inputs
(0x05) Write Single Coil
(0x0F) Write Multiple Coils
Word Blocks 4000 (0x03) Read Holding Registers
(0x04) Read Input Registers
(0x06) Write Single Register
(0x10) Write Multiple registers
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
10.5.1 Connections
10.6.1 Connections
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. With every rising edge trigger
signal coming to the Trg input of the MODBUS reader, the read request is added to the request queue
of the master block. 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.
10.7.1 Connections
10.8.1 Connections
10.9.1 Connections
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. With every rising edge trigger
signal coming into the “Trg” input of the MODBUS writer, the value in “In” input is added to the request
queue of the master block as a read request. In cases where the master block’s communication
channel is available and is not in a waiting state for the previous request, the requests in the queue
will run sequentially.
10.10.1 Connections
10.11.1 Connections
10.12.1 Connections
It is used for reading/writing one or more registers starting from a specific register address.
The "register address" specifies from which register to start reading/writing.
"Number of registers" specifies the number of registers to read/write after the register specified by the
register address. The maximum number of registers can be 120.
For multi-line reading, the source of the data to be read is determined by the Tab input on the block.
The data source can be 1- Table, 2- Normal Block Reference.
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.
11.1.1 Connections
Asdu Address:
ASDU state address.
Transmission type:
Balanced or Unbalanced protocol is
selected.
COT size:
The number of bytes of the Cause of
Transmission field is selected.
IOA Byte:
The number of bytes of Information
Object Addresses is selected.
By adding IEC101 block, The IEC 60870-5-101 slave is activated on the RTU.
TCP or Serialport block is added to IEC101block “ser” input.
To serve more than one server, IEC101 block must be added for each server.
.If The IEC101 Asdu address is set from outside not from the inside the block, The Asd enter is used
On the rising edge of the trigger, the periodically sending objects between IEC101 objects are actively
transmitted to the server by the periodic COT. Trigger input can be left blank.
11.2.1 Connection
To serve more than one server, a DNP3 block must be added for each server.
Asp input is used if the DNP3 Asdu address is to be set from outside, not from within the block.
On the rising edge of the trigger, DNP3 objects are periodically sent active selected objects,
It is transmitted to the server via periodical COT. Trigger input can be left blank.
With the addition of DNP3 Slave Block to the RTU logic project, the DNP3 protocol becomes active in
the RTU.
Variables in the RTU logic project, DNP3 association is provided in the variable address
table.
11.3.1 Connections
Ser: TCP Socket Input Q1: L,nk information
output
Line label can be defined for all blocks defined on the Mikrodiagram. In the variable table, the line
label must be defined in order to be able to associate with the protocol addresses.
Alias:
A special name is given that defines this defined
variable.
Start Address:
The address allocated for this variable on
SCADA is written here. It is written as a decimal
value
Line Label:
The block to be associated on the Mikrodiagram
is selected with the line label.
Point Count:
Calculated automatically. It makes sense on
tables.
Protocol Type:
Modbus, Dnp3, IEC101, IEC104 are selected.
Object type will change according to protocol
type.
Object Type:
IEC104 object type information selected. look the
protocol type information for detailed information.
Object Class:
The class information to which the variable
belongs is selected.
Send On Trigger:
IEC104 Slave block is the selection to send to
this SCADA as a periodic send when the test is
detected from the trigger input.
Change Value:
With the "Send method", it adjusts the
percentage change in the level.
12.1.1 Connections
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:
- Modbus RTU Master
- Modbus RTU Slave
- Modbus TCP Master
- Modbus TCP Slave
- DNP3
- IEC101
- Modbus Gateway mode
- Transparent Serial Gateway mode
12.1.5 Example
12.2.1 Connections
Socket Type:
One of the TCP Client or TCP Server
options can be selected in Block Settings.
Server Port:
Client port input.
Server IP:
Client IP input.
Listening Port:
Server port input.
IP Filter:
IP filter input of the server.
Media Type:
Ethernet, GSM or WİFİ is chosen here.
12.2.5 Example
TCP Socket Block is connected to the TCP Slave Block, TCP Server is
selected in Block Settings menu and server port is specified. “Con”
output is high, therefore the device is being reached by a Modbus TCP
Master Block.
13 TABLE BLOCKS
13.1.1 Connections
Type of Table:
Table Size:
Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO
(First In Last Out)” must be chosen.
In FILO Mode; the data added into the table with smaller index is always added like a new one. While
the new data becomes 0th data, the oldest one becomes the last element. For a table which has 4
word data, adding data in FILO mode works like below.
12 44 23 101 5
67 12 44 23 101
25 67 12 44 23
42 25 67 12 44
In applications where the order of addition of the data on the table is important, a FILO type table is
required.
For a table which has 4 word data, adding data in Circular mode works like below:
12 44 44 44 44
67 67 23 23 23
25 25 25 101 101
42 42 42 42 5
Table Size is the total byte size that the datas of the table cover in memory. Since the word datas are
2 bytes long, the size of the table should be 2 times the number of Word datas to be kept in the table.
Retentivity can be activated in the table blocks. After all PLC loops, the data in table blocks which
retentivity is activated, recorded to the retentive memory of PLC. If PLC is somehow restarted then
data in the table is read from the retentive memory and the initial values are filled. Thus, the data in
the table becomes retentive. If it is also desired to record the order of data addition into the table, FILO
must be selected as the table type. In the table which retentivity is activated an optimum table size
must be selected to prevent wasting retentivity memory.
13.2.1 Connections
Table type:
Table size:
Table size and table type can be chosen like below by user. Here, “Circular or FILO (First In Last Out)”
should be chosen.
In FILO Mode; the data with smaller index which is the data is added into the table always added like a
new one. While the new data become 0th data, the oldest one become the last data. For a table which
have 4 analog data, adding data in FILO mode works like below:
In applications where the order of addition of the data into the table is important, a FILO type table is
required.
For a table which have 4 analog data, adding data in Circular mode works like below:
12 44 44 44 44
67 67 23 23 23
25 25 25 101 101
42 42 42 42 5
Table Size is the total byte size that the datas of the table cover in memory. Since the analog datas 4
bytes long, the size of the table should be 4 times the number of analog datas to be kept in the table.
Retentivity can be activated in the table blocks. After all PLC loops, the data in table blocks which
retentivity is activated, recorded to the retentive memory of PLC. If PLC is somehow restarted then
data in the table is read from the retentive memory and the initial values are filled. Thus, the data in
the table becomes retentive. If it is also desired to record the order of data addition into the table, FILO
must be selected as the table type. In the table which retentivity is activated an optimum table size
must be selected to prevent wasting retentivity memory.
13.3.1 Connections
Table Type:
Table type can be determined as
“CIRCULAR” or “FILO” in here.
Table size:
Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO
(First In Last Out)” should be chosen.
In FILO Mode; the data with smaller index which is the data is added into the table always add like a
new one. While the new data become 0thh data, the oldest one become the last data. For a table
which have 4 long data, adding data in FILO mode works like below:
12 44 23 101 5
67 12 44 23 101
25 67 12 44 23
42 25 67 12 44
In applications where the order of addition of the data on the table is important, a FILO type table is
required.
For a table which have 4 long datas, adding data in Circular mode works like below:
12 44 44 44 44
67 67 23 23 23
25 25 25 101 101
42 42 42 42 5
Table Size is the total byte area that the datas of the table cover in memory. Since the long datas 4
bytes long, the size of the table should be 4 times the number of long datas to be kept in the table.
Retentivity can be activated in the table blocks. After all PLC loops, the data in table blocks which
retentivity is activated, recorded to the retentive memory of PLC. If PLC is somehow restarted then
data in the table is read from the retentive memory and the initial values are filled. Thus, the data in
the table becomes retentive. If it is also desired to record the order of data addition into the table, FILO
must be selected as the table type. In the table which retentivity is activated an optimum table size
must be selected to prevent wasting retentivity memory.
13.4.1 Connections
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.
Table size and table type can be chosen like below by user. Here, one of the options “Circular or FILO
(First In Last Out)” should be chosen.
In FILO Mode; the data with smaller index which is the data is added into the table always add like a
new one. While the new data become 0.data, the oldest one become the last data. For a table which
have 4 bit data, adding data in FILO mode works like below:
0 1 0 1 1
0 0 1 0 1
0 0 0 1 0
0 0 0 0 1
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:
0 1 1 1 1
0 0 0 0 0
0 0 0 1 1
0 0 0 0 1
Table Size is the total byte area that the datas of the table cover in memory. Since the Bit datas are 1
byte long, the size of the table should be same as the number of Bit datas to be kept in the table.
Retentivity can be activated in the table blocks. After all PLC loops, the data in table blocks which
retentivity is activated, recorded to the retentive memory of PLC. If PLC is somehow restarted then
13.5.1 Connections
Table Offset:
Math Type:
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.
Note: If the median is selected in the table operation, the values in the table indices are
changed since the data in the table is sorted from small to large.
In the sample applications, the table type is selected as FILO and the table size is selected as 20
bytes, each word value is 2 bytes so 10 word values can be recorded in the table. Each time the value
in the change detector block and Word table “In” input change, it is written on the table.
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:
The arithmetic mean of the values at the 4th and 5th offset (16 and 18) of the table, which is sorted
from small to large, is taken and written at the output of the block.
The largest integer written on the table is 33 so maximum value is 33; the smallest integer written on
the table is 0 so minimum value is 0.
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.
When “PutOffset and ReadOffset” are selected in the word table operation block;
13.6.1 Connections
Table Offset:
It’s used to select the data
offset to be processed in the
table data.
Math Type:
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:
Note: If the median is selected in the table operation, the values in the table indices are
changed since the data in the table is sorted from small to large.
In the sample applications, the table type is selected as Circular and the table size is selected as 20
bytes, each analog value is 4 bytes so 5 word values can be recorded in the table. Each time the
value in the change detector block and Analog table “In” input change, it is written on the table.
In the example, 3 analog values are randomly written in the table.
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. (27.33/5=5.466)
The value at the middle point of the table (0 value in the 2nd offset) is written to the block output.
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.
When the direction operation is selected, the last value added to the table is compared with the
previous value from the last. If the last value is greater, "1" is written to the block output. If the last
value is smaller, "0" is written to the block output.
In the analog table operation block, "PutOffset and ReadOffset" are selected;
13.7.1 Connections
Table Offset:
Math Type:
The operation type to be performed
on the table data is selected.
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
Note: If the median is selected in the table operation, the values in the table indexes change
because the table data is sorted from small to large.
In the example applications, the table type is selected as “Circular”, the table size is selected as 20
bytes, and 1 long value is 4 bytes, 5 long value tables can be saved. The change detector block and
the value of the input in the long table “In” are changed each time the value changes.
In the example, 5 random values are written randomly in the table.
While "LatestData and Sum" 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.
With median operation, values in the table are sorted from small to large.
The value at the middle point of the table (12 values in the 2nd offset) is written to the block output.
When "Max and Min" is selected in the long 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. If the last value is greater, "1" is written to the block output. If the last
value is smaller, "0" is written to the block output.
While “PutOffset and ReadOffset” are selected in the long table operation block;
In the example, the 8th and 9th bytes of the long table which is 20 bytes long are read. 8th, 9th, 10th,
11th byte corresponds to the 2nd table offset in the table. In this case, the 8th, 9th bits indicate the
LSB bits, and the 10th, 11th bits indicate the MSB bits. “12” value at the 2nd table offset are written to
the 8th byte which can carry 0-255 values. Since the value is less than 256 9th, 10th, 11th bytes are all
0.
13.8.1 Connections
Table Offset:
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.
Sum If any of the data in the table is 1, the result is 1, if all 0, the
result is 0.
Mean If any of the data in the table is 0, it is 0, and if all of them are 1,
the result is 1.
Max If any of the data in the table is 1, the result is 1, if all 0, the
result is 0.
Min If any of the data in the table is 0, the result is 0, all 1 are the
result 1.
Median The data in the table is sorted from small to large, the value in
the middle of the table is written to the block exit after sorting. If
Note: If the median is selected in the table operation, the values in the table indexes change because
the table data is sorted from small to large.
The table type "FILO" is selected in the sample applications, the table size is selected as 5 bytes and
5 bit value can be saved in the table.
İn the example,5 bit value is written on the table.
1 0 1 1 0
When "LatestData and Sum" is selected in the bit table operation block;
When “Mean” is selected; since the values in the table are not all 1, the result is written as 0 in the
output of the block as a result of the bit table average operation feature.
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” is selected in the bit table operation block;
Read Offset: The table offset to be read in the bit table operation block can be selected from inside
and outside of the block. In the example, the offset is chosen as 0 from out of the block.
In this case, the value in the 0th offset is read as 1 with Reading Offset.
14.1 HYSTERESIS
14.1.1 Connections
Threshold(Bottom):
The bottom threshold value can be
determined within the hysteresis block
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".
The air conditioner turns on when the ambient temperature has risen above 23 ° C and then turns off
when it is below 20 ° C and it doesn’t turn on until the temperature rises above 23 ° C again. The
same cycle was repeated when the temperature rises above 23 ° so that the ambient temperature is
kept constant between 20 ° and 23 °.
14.2.1 Connections
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 ... + 100
By this means, the PID block will automatically scale the input value.
PID controller is one of the frequently used automatic control mechanisms in industrial and automatic
control field. The PID controller performs Proportional Integrative and Derivative operations. A PID
controller is a controller that is designed to stabilize a mechanism at a constant value in the most
optimal time and to keep the value constant in the ideal values.
One of the most important points in PID applications is to determine the P, I, and D values that
characterize the PID system. These values vary from system to system and should be optimized
14.3.1 Connections
Str: Start/Stop
O1: Analog
Str: Initial value input ramp block
output
If the Str input returns to logic low(0) position before the "reaching time" is completed, the O1 block
output ramping stops. When the Str input is again logic high(1), the ramping process continues from
where it left off.
The analog value between the "start and end" values can be measured on the O1 output.
"Start value, stop value and reaching time" can be entered from the block object properties and from
outside the block.
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 O1 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" and “Rea” inputs.
In the example; the blocks have been set starting value 1, ending value 8.6, and reaching time
20 seconds.
Initially Str input has been toggled to logic low(0) after a certain period of logic high(1) and O1 output
stayed at 5.3943 because it did not reach the ramp end time.
Then the Str input is again logic high(1), the ramp completes the remaining reach time and
reaches the end value of 8.6.
The "start value" and "end value" graph on the time axis of reaching time are as follows.
14.4.1 Connections
When O1 output is in ON state, if the block input compare condition becomes logical high(1) position
and this condition is satisfied for tOFF duration, O1 output turns OFF
O1: Block output
It is binary block output.
InA
Alt Eşik
O1
InA
Alt Eşik
O1
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 O1 to the ON state will occur if "Compare point is
greater than threshold + hysteresis value." (If the value of InA is above 5 + 2 = 7, the output of O1 is
logic high(1).)
The transition from the ON state to the OFF state of the block O1 output will occur if "Compare Point
is lower than Threshold-Hysteresis Value" (if the value at the INA input is below 5-2 = 3, the O1 output
is logic low(0)).
Alt Eşik
O1
Note: The threshold hysteresis value and tON (turn on time) and tOFF (turn off time) features can be
used at the same time. tON or tOFF will get activated after hysteresis threshold is exceeded.
14.5.1 Connections
O1: Block
output
The Change Detector block is used when changes to any block value need to be monitored.
If the difference between the present value of the value at the “Up” entry and the next value is greater
than the specified percentage or level change value, a momentary pulse is generated at the O1 block
output.
You should connect the block ,when whose value changes the O1 output should generate a pulse, to
the “Up” input .(Counter, register, etc.)
In the block options, the value change is selected as the percentage or level change.
To generate a pulse at output O1, the minimum change value of the “Up” input can be set from the
"value" window in the block options or from the L/P input outside the block.
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. Pulses are counted by the up counter connected to the output
O1.
15 HVAC BLOCKS
15.1.1 Connection
Equipment connected to the output will be turned on as long as the logic (1) signal sent from the “Ope”
output. The equipment connected to the output will shut down as long as the logic (1) signal sent from
the “Clo” output.
The "Ope" and "Clo" outputs of the block generate a logic low(0) or logic high(1) signal according to
their control status. The two outputs does not produce a logic high(1) signal at the same time.
The time to one hundred percent opening time is specified in milliseconds in the Full Open Duration
(FOD). The minimum running time of the equipment is specified in Minimum Opening Duration (MOD)
in milliseconds. If the percentage change rate at the "VAL" entry corresponds to a smaller value than
the minimum opening duration "MOD", the run signal will not be sent to the output. (If MOD: 1 sec,
FOD: 100 sec. and the VAL change is greater than %1, the equipment moves.)
The "VAN" input specifies how much of the equipment should be opened in percent. Precise data
input can be achieved by connecting an analog register to this input.
32-bit long value can be entered for full opening and minimum opening values.
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.
In the case of floating 1; The VAL input is entered 35 for the 35% opening of the initially closed valve.
The open output has been logic low(0) after becoming logic high(1) for 35 seconds. Thus, Floating 1
valve was opened by 35%.
In the case of floating 2; The valve is initially opened at 35%. Then the opening of the valve was
reduced to 15%. The “Clo” output has been logic low(0) after becoming logic high(1) for 20 seconds.
Thus, the Floating 2 valve open rate is reduced from 35% to 15%.
15.2.1 Connection
“Wor” output connected to “Mas” input of aging member blocks, NOT used alone or with other blocks.
As long as the logic high(1) signal is input to “Enb”, the block becomes active and activates the
connected aging members. Up to 10 aging members can be connected to the block output.
The number of aging member blocks which are active at the same time can be set from within the
block or from the block "Sla" entry. (Eg: if this value is set to 3 and 7 members are connected to the
“Wor” output, 7 members will be active in groups of 3.)
15.2.5 Example
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 “Wor” output there is information about which of the connected members is running. This
information is given as bits of the output value. For example, in the above example, the output value
equals 4, binary equals to “0100”, which means that the second slave is active.
The output of this block in the ready state must be connected to the "Mas" input of the AGING
MEMBER blocks.
15.3.1 Connections
This block is used when the pumps in a pump station are operated in the determined sequence and
durations. After a pump completes the aging period, it is stopped and another pump which is included
in the aging scenario period is started and the system enters into a cyclic loop and the same pumps
are used.
Even if the error at block error input returns to logic (0), the error output at block "isF" will
not turn to logic (0). The block error output is reset when the rising edge trigger is applied to
1- When any thermal, fault, error, etc. occurs at the block fault input, the error output
becomes logic (1).
2- If the running information does not seem to appear at isR input even though On/Off
control logic is output (1), error output becomes logic (1) after the timeout duration. In
order to reset the error output, the rising edge trigger must be applied on the error
reset input.
In the example;
2 aging members has been added to an aging manager. The manager’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). After 2 minutes,
the second member becomes logical (0) and the first member becomes logical (1) again. The system
has thus entered the periodic operation cycle.
15.4.1 Connection
It is a multi-drop protocol and can be added to a single DEV-NET network with up to 65535 PLCs.
All nodes are on the same level and there is no Master / Slave structure.
The Ethernet port used in the PLC also supports other protocols.
Points are automatically synchronized according to their node addresses and messages they receive.
Thanks to the wait time and timeout mechanisms, network changes can be adaptable. This provides a
superior level of robustness.
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.
Cycle Delay, located in the window, is the "how long the device will wait for a cycle". A value can be
entered by subtracting 1 from the number of devices and multiplying the timeout value by this value.
The Waited DevNET Id located in the window is the Id of the device to be read.
The TargetDevNET Id in the window is the Id of the device to which the data will be written.
The "Broadcast IP Address" located in the window is the address of the internet network to which the
devices are connected. (An example is 192.168.2.255, where the last 255 is entered to allow access
to all devices connected to this network.)
15.5.1 Connection
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.
Warning!! To read with this block, "Sync with DevNET" option also must be checked on the other
device.
16 SYSTEM BLOCKS
16.1.1 Connections
16.1.5 Example
16.2.1 Connections
16.2.5 Example
16.3.1 Connections
16.3.5 Example
When a value different from “0” is written on the word register connected to Trg input, the device is
reset.
17.1.1 Connections
In the example;
According to logic states of the Analog Quart Multiplexer’s selection inputs (S) , the values in the
inputs and O1 output are showed. In the example I4 is selected by setting both S1 and S2 to logic(1).
(For logic (0) to the S choosing input shold be 0; for logic (1) any value which is different from zero is
valid.
17.2.1 Connections
In the example;
According to logic states of the Word Dual Multiplexer’s selection input (S) , the values in the inputs
and O1 output are showed. In the example different inputs are selected by setting both S to logic(1) or
logic(0). (For logic (0) to the S choosing input shold be 0; for logic (1) any value which is different from
zero is valid.
17.3.1 Connections
In the example ;
According to logic states of the Long Dual Multiplexer’s selection input (S) , the values in the inputs
and O1 output are showed. In the example different inputs are selected by setting both S to logic(1) or
logic(0). (For logic (0) to the S choosing input shold be 0; for logic (1) any value which is different from
zero is valid.
17.4.1 Connections
O: Analog dual
I2: Analog dual multiplexer input
multiplexer output
In the example;
According to logic states of the Analog Dual Multiplexer’s selection input (S) , the values in the inputs
and O1 output are showed. In the example different inputs are selected by setting both S to logic(1) or
logic(0). (For logic (0) to the S choosing input shold be 0; for logic (1) any value which is different from
zero is valid.
18.1.1 Connections
Initial T Value:
Target Value:
First output of the block 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.
“T” value indicates the time period which the pulses are counted in. Number of pulse count in defined
period “T” is written to “Int” output of the block. “T” has the units of milliseconds. For example, if
T=1000 (means 1000 millisecond), than the “Int” output of the block will show he frequency of the input
digital signal connected to related fast counter input.
With “Target Val” input, a target value is specified and when the target value is reached a pulse is sent
out from the third output(“Target Reached”) of the block. If the “Target Val” input is equal to 0, then the
mechanism is disabled. If the “reset when target value is reached” option is activated, total count and
the “Target Reached” output of the block is reset when the target value is reached. A target value can
be specified only when counting up.
If a high signal is applied to the “Res” input of the block, total count value will be reset.
Fast counters counts in the signed 32-bit format. Count value can vary between the values -
2147483648 and 2147483648.
18.2.1 Connections
“DUTY” input of the block specifies the duration of the high and low parts of the signal with a specified
frequency.
“Str” input of the block stands for “Start/Stop”. When a high signal applied to the “Str” input, PWM
Block is activated and starts to generate PWM signal. When a low signal is applied to the “Str” input,
the block is deactivated and PWM output serves as a normal digital output.
“Dut” input of the block can be set externally or can be set in Block Settings. Different duty cycle
values can be assigned to the different blocks, independent from each other.
Block serves as a PWM signal generator when the PWM channel is active, and serves as a normal
digital output when the PWM channel is passive.
18.2.5 Example
18.3.1 Connections
Speed /
Pulse Width = 10us * <IN[x]>
Time
Pulse Width of Speed α
It is used to make a controlled step input motion by sending a certain number of pulses. Acceleration,
constant motion and deceleration functions are performed by controlling the pulse width and the
number of pulses.
If Acceleration and Deceleration functions are not required, corresponding pulse count parameters
must be set to 0.
Total pulse count parameter is sum of pulse count of Accelaration, Constant Speed, Deceleration
phases.
The value entered as pulse width information is evaluated as 10 μs on the device side. For example,
for input pulse width of 120 us, input must be written 12.
After the PTO block starts to work, the output signal of the block goes to Logis(0) . After the total
number of pulses is completed, the "Cou" output goes to Logic(1). Connecting to Cou output to
another PTO block inputs result in controlling multiple PTO blocks together.
18.4.1 Connections
Sta: Status
Go: Go home command input
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” input of the block, PLC starts to drive the motion
system until Logic(1) signal appears at “Home” input of the block. If homing process is started while it
is already at home position, PLC starts homing process to calculate axis length per pulse count.
To use the axis block, AT+PTO=1 command must be sent to the device using Mikroterminal to make
digital outputs pulse outputs. DO0, DO1, DO2, DO3 cannot be used for any other purposes anymore.
Axis and machine moves in units of millimeters. Motor unit moves in the units of pulses. Axis type
determines how the motor reaches the desired position. If “circular” is selected, desired position will be
reached by the shortest path. If “linear” is selected, when the starting point is reached, motor starts to
move at the opposite direction, and then reaches to the desired position. This way, if there is a cable
attached to the motor it will not be damaged.
Turn home way: specifies the direction of the motor when going back to starting point.
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.
Home Turn Speed: Defines the speed when going to starting point. It is reversely proportional with the
speed of the motor. It has units of microseconds.
18.5.1 Connections
TargetSpeed(pulse/sec,mm/sec):Specifies the
target speed.
Sta: When the signal is applied to the Sta input, block starts to send out pulses.
Wor: A word register is connected to this input to adjust the motor speed. It can be set in the Block
Settings menu either. It is reversely proportional to the speed of the motor. It can be set in the Block
Settings menu. It has units of microseconds.
Sta: Specifies the ramp speed before reaching the target speed. It is used when accelerating and
decelerating. It can be set in the Block Settings menu. It has units of microseconds.
Acc: Specifies the acceleration 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.
Dir: Specifies the direction of the movement. 1 means forward, 0 means reverse direction.
Cou: It is a pulse output. When block produces a pulse, gives a pulse signal.
19.1 Rx Packet
19.1.1 Connections
Çözme Yöntemi:
FrameTimeOut(ms):
SOF:
EOF:
19.2.1 Connections
Kısım:
DeğerIndeksi:
DeğerBoyt:
19.3.1 Connections
Checksum Type:
Mesaj:
DeğerIndeksi:
DeğerBoyt:
20.1.1 Connections
String Offset:
It is the part of the string table where the data to be
used is selected.
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 containig etc) can be
entered.In the String table. Each line can have max 63 characters on the String table.
When the do programme can be used text referance in order to use values which have been recorded
on the String table. Send and receivering SMS, acception calling and doing research on blocks and
entered numbers and message content are identified from String referance . SMS content where is on
string table and choosing telephone number is done from string referance’s block “string offset”
20.2.1 Connections
Trg:Trigger input
String Offset:
String Math:
The part of the process to be done is
selected.
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.
20.3.1 Connections
Math:
Strings process steps that are part of the
selection.
Compare The string referance input of inA and inB inputs as alphabetic sorting as
compare is written the output.
String Long The character number of the inA referance string is written to the output.
Writing to number The content of string of the inA referance is transformed to the output.
21 CALENDER BLOCKS
21.1.1 Connections
In the example, Bit Merge Block is connected into weekly timer inputs. For Bit Merge Block
, every input is represented by one day. Binary registers are connected to Bit
Merge block’s inputs. One word register is connected to the O.T. and C.T. inputs, and it is aimed to
control the on/off state of the pump by using the relay output (RQ0) connected to the output of Weekly
Timer.
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.1 Connections
Open Date:
Close Date:
The date value which Yearly
timer’s output will be logic (0) can
be determined in the block.
21.3.1 Connections
Astronomical timer’s latitude, longitude and offset information is determined with registers.
These values may also be determined within the block. The digital output or relay output can
be connected to the ”Day” output.
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.1 Connections
21.4.5 Example
21.5.1 Connections
21.5.5 Example
In the example, time since the PLC reset is seen as milliseconds value.(The system is reset nearly
before 15 seconds.)
21.6.1 Connections
The PLC’s hours and minutes information is read and that the current time is seen as 14:56.
21.7.1 Connections
21.7.5 Example
Shows the day of week. If read value is six, then the day is Saturday.
21.8.1 Connections
21.8.5 Example
21.9.1 Connections
21.9.5 Example
The value of the day of the year is read and it is 216 days since the beginning of the year.
21.10.1 Connections
21.10.5 Example
21.11.1 Connections
21.11.5 Example
21.12.1 Connections
21.12.5 Example
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.13.1 Connections
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" ; "Scheduler" must be added to "Scada Editor" and "Schedule tag" must be selected.
If more than one index is selected in the time plan picker and the tags defined in these indexes are
added to ViewPLUS SCADA, output logic (1) occurs between the indexes if the index condition is met
with OR operation.
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; if it does not, it shows how long remained for the condition to be satisfied.
21.13.5 Example
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” is logic (1).
In the case of “time plan picker 2”, the PLC time date is on one of the selected days but since
the time is not between 14:30 and 14:35, the "Def" output signals logic (0) and the relay
(RQ0) is inactive. The "Rem" output shows how many minutes are left until 14:30. In this
22.1 MACRO
22.1.1 Connection
Macro:
It is the field where custom command
definitions are made.
The definition of the AND operation is that if any of the inputs are logic (0), the output is logic (0), so the
macro block output is logic (0).