Lazarus IDE for FreePascal

Analogue Input Scaling

In analogue input, scaling is the most important step. In order to get the right value in HMI, good scaling is a must to do.

Thanks to

For example
Analogue Input resolution = 12 bits = 4096 different levels ? 4000
Proccess value = 0 – 2000 mBar

Mango, open source Machine to Machine on Ubuntu

This is not Paid to Review. I just share my experience about installing Mango, open source M2M on Ubuntu 9.10. This article is only copying from various sources.

BE AWARE: My experience is very limited. I am not sure these codes are perfect. I just want say that they work for me. Thanks

Continue reading Mango, open source Machine to Machine on Ubuntu

Modbus Protocol 2

Special thanks to :

I think that the best learning is by doing.

I have done many project using modbus RTU and now i will learn the basic fundamental of modbus.

There are 2 kind of modbus :
1. Modbus serial

2. Modbus TCP


Modbus Protocol

Modbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers (PLCs).

Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems.

Versions of the Modbus protocol exist for serial port and for Ethernet.

For serial connections, two variants exist, with different representations of numerical data and slightly different protocol details. Modbus RTU is a compact, binary representation of the data. Modbus ASCII is human readable, and more verbose. Both of these variants use serial communication. The RTU format follows the commands/data with a cyclic redundancy check checksum, while the ASCII format uses a longitudinal redundancy check checksum. Nodes configured for the RTU variant will not communicate with nodes set for ASCII, and the reverse.

For connections over TCP/IP, the more recent variant Modbus/TCP exists. It does not require a checksum calculation.

I have applied tcp/ip modbus protocol for Koyo PLC to communicate with Daqfactory SCADA. It has done very well.

RTD vs Thermocouple

When should control engineers use a Thermocouple or RTD?

RTD = resistance temperature detectors
below 600 °C
High accuracy
Low drift
Wide operating range
Suitability for precision application

The most common of RTD is PT 100, R = 100 ohm at 0°C, sensitivity 0.385 ohm/°C

A thermocouple is a junction between two different metals that produces a voltage related to a temperature difference
range ?180 to 2,320 °C