Industrial Components

Connect Delphi, C++Builder and .NET applications to PLCs, SCADA servers, energy meters, drives and serial devices: Modbus TCP and RTU, client and server, an OPC UA client and a serial port for RS-232 and RS-485.

New

Included in sgcWebSockets Enterprise (Delphi and .NET) and All-Access, or as the standalone sgcIndustrial pack

Industrial Protocols

One pack for the field level: the protocols that PLCs, meters and drives speak, in the same component style as the rest of sgcWebSockets.

Serial Port

TsgcSerialPort opens RS-232 and RS-485 ports on Windows, Linux and macOS, writes data and receives it in an event or with blocking reads. It is also the transport of the Modbus RTU components.

Learn more →

Modbus Client

TsgcModbusTCPClient and TsgcModbusRTUClient read and write coils and registers over TCP/IP or a serial line, with typed helpers for 32-bit values and strings.

Learn more →

Modbus Server

TsgcModbusTCPServer and TsgcModbusRTUServer turn your application into a Modbus device that answers from a thread-safe TsgcModbusDataModel, with events to check every read and write.

Learn more →

OPC UA Client

TsgcOPCUAClient connects to OPC UA servers over opc.tcp with signed and encrypted security policies, browses the address space, reads, writes, calls methods and subscribes to data changes and events.

Learn more →

Industrial Features

Everything you need to read, write and serve plant data from your own applications.

Field Devices in a Few Lines of Code

Every Modbus request is a blocking call that returns the values or raises a clear exception, so reading a PLC looks like reading a local variable. The components handle framing, transaction ids, CRC checks, timeouts and retries for you.

  • Modbus TCP and Modbus RTU, client and server
  • OPC UA client over opc.tcp with Sign and SignAndEncrypt, browse, read, write, call, subscriptions and automatic reconnect
  • Function codes 01 to 08, 15, 16, 22, 23 and 43/14
  • 32-bit integers, floats and strings in four word orders
  • Thread-safe server data model with read and write events
  • TLS, proxy and automatic reconnection for the Modbus TCP client
  • RS-232 and RS-485 serial ports on Windows, Linux and macOS
  • Modbus TCP interoperability tested against pymodbus
  • Delphi, C++Builder and .NET (C#) with the same API
YOUR APP PLC METER DRIVE TCP RTU

Read a PLC in a Few Lines

Connect a Modbus TCP client, read ten holding registers and write one. The same code works against any Modbus TCP device or gateway.

uses
  sgcIndustrial;

procedure TForm1.ReadPLC;
var
  vRegisters: TsgcModbusRegisters;
begin
  FClient := TsgcModbusTCPClient.Create(Self);
  FClient.Host := '192.168.1.50';
  FClient.Port := 502;
  FClient.UnitId := 1;
  FClient.OnError := OnModbusError;
  FClient.Active := True;
  if FClient.Active then
  begin
    // holding registers 0..9 (40001..40010 in many device manuals)
    vRegisters := FClient.ReadHoldingRegisters(0, 10);
    Memo1.Lines.Add(Format('Register 0 = %d', [vRegisters[0]]));
    FClient.WriteSingleRegister(100, 1234);
  end;
end;

procedure TForm1.OnModbusError(Sender: TObject; const aError: string);
begin
  Memo1.Lines.Add('Error: ' + aError);
end;
#include "sgcIndustrial.hpp"

void __fastcall TForm1::ReadPLC()
{
  FClient = new TsgcModbusTCPClient(this);
  FClient->Host = "192.168.1.50"; // Port is 502 by default
  FClient->UnitId = 1;
  FClient->OnError = OnModbusError;
  FClient->Active = true;
  if (FClient->Active)
  {
    // holding registers 0..9 (40001..40010 in many device manuals)
    TsgcModbusRegisters vRegisters = FClient->ReadHoldingRegisters(0, 10);
    Memo1->Lines->Add("Register 0 = " + IntToStr(vRegisters[0]));
    FClient->WriteSingleRegister(100, 1234);
  }
}

void __fastcall TForm1::OnModbusError(TObject *Sender, const String aError)
{
  Memo1->Lines->Add("Error: " + aError);
}
using System;
using esegece.sgcWebSockets;

class PlcReader
{
    TsgcModbusTCPClient FClient = new TsgcModbusTCPClient();

    public void ReadPLC()
    {
        FClient.Host = "192.168.1.50";
        FClient.Port = 502;
        FClient.UnitId = 1;
        FClient.OnError += OnModbusError;
        FClient.Active = true;
        if (FClient.Active)
        {
            // holding registers 0..9 (40001..40010 in many device manuals)
            ushort[] vRegisters = FClient.ReadHoldingRegisters(0, 10);
            Console.WriteLine("Register 0 = " + vRegisters[0]);
            FClient.WriteSingleRegister(100, 1234);
        }
    }

    void OnModbusError(object Sender, string aError)
    {
        Console.WriteLine("Error: " + aError);
    }
}

Industrial Component Reference

Written technical documents for every component, covering configuration, the properties and events you will use, and complete working code. Each one is also published as a PDF.

Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Included in sgcWebSockets Enterprise

Included in sgcWebSockets Enterprise (Delphi and .NET) and All-Access, or as the standalone sgcIndustrial pack.