PLCcom for S7

the professional communications library for .NET and Java developers

The library PLCcom is a highly optimized component, specially provided for Java / .NET software developers to read out or write data from a PLC.

PLCcom is compatible to Siemens S7 controllers (200, 300, 400, 1200s, 1500s series, SoftPLC WinAC RTX and Logo! 0BA7, 0BA8 and 0BA0) and CPUs from other manufacturers (eg VIPA 100V/200V/300V/300S etc.).

Innovative and fast to use

The libraries, depending on version, are 100% Java or .NET files. The driver can be incorporated directly by link, and API retrievals are not necessary. It is perfectly possible to use the component in 32 or 64 bit system environments as well as across platforms.
The internal routines are optimized for high-performance access.

Also included in the scope of delivery are extensive code examples that demonstrate the extremely easy integration of PLC control to your application, and can also be used in your projects.

Here are some simple code examples (further examples):

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", //IP address
                0, //Rack
                2, //Slot
                ePLCType.S7_300_400_compatibel); //Type of Device

Dim Device As PLCcomDevice = New TCP_ISO_Device("192.168.1.100", _ 'IP address
                0, _ 'Rack
                2, _ 'Slot
                ePLCType.S7_300_400_compatibel  'type of device

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", //IP address
                0, //Rack
                2, //Slot
                ePLCType.S7_300_400_compatibel); //type of device

Example: Creating a TCP-IP communication object

PLCcomDevice Device = new MPI_Device("COM1",        //local serial interface
                0,                                  //local MPI bus address
                2,                                  //PLC MPI bus Address
                eBaudrate.b38400,                   //serial baudrate
                eSpeed.Speed187k,                   //MPI speed
                ePLCType.S7_300_400_compatibel);    //type of device

Dim Device As PLCcomDevice = New MPI_Device("COM1", 'local serial interface
                    0,                              'local MPI bus address
                    2,                              'PLC bus address
                    eBaudrate.b38400,               'serial speed
                    eSpeed.Speed187k,               'MPI bus speed
                    ePLCType.S7_300_400_compatibel) 'type of device

PLCcomDevice Device = new MPI_Device("COM1",        //local serial interface
                0,                                  //local MPI bus address
                2,                                  //PLC MPI bus Address
                eBaudrate.b38400,                   //serial baudrate
                eSpeed.Speed187k,                   //MPI speed
                ePLCType.S7_300_400_compatibel);    //type of device

Example: Creating a MPI communication object

PLCcomDevice Device = new MPI_Device("COM1",        //local serial interface
                0,                                  //local MPI bus address
                2,                                  //PLC MPI bus Address
                eBaudrate.b38400,                   //serial baudrate
                ePLCType.S7_300_400_compatibel);    //type of device

Dim Device As PLCcomDevice = New MPI_Device("COM1", 'local serial interface
                    0,                              'local MPI bus address
                    2,                              'PLC bus address
                    eBaudrate.b38400,               'serial speed
                    ePLCType.S7_300_400_compatibel) 'type of device

PLCcomDevice Device = new MPI_Device("COM1",        //local serial interface
                0,                                  //local MPI bus address
                2,                                  //PLC MPI bus Address
                eBaudrate.b38400,                   //serial baudrate
                ePLCType.S7_300_400_compatibel);    //type of device

Example: Creating a PPI communication object

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", 0, 2, 
ePLCType.S7_300_400_compatibel);
 
//read 10 Bytes from DB1
ReadDataRequest myReadDataRequest = new ReadDataRequest(eRegion.DataBlock,  //Region                1,             //DB only for datablock operations otherwise 0
                0,                  //read start adress
                eDataType.BYTE,     //desired datatype
                10);                //Quantity of reading values
 
//read
ReadDataResult res = Device.ReadData(myReadDataRequest);
 
//get the results
if (res.Quality == OperationResult.eQuality.GOOD)
{
   foreach (Object item in res.GetValues())
    {
        Console.WriteLine("read " + item.ToString());
    }
}
else
{
    Console.WriteLine("error " + res.ToString());

Dim Device As PLCcomDevice = New TCP_ISO_Device("192.168.1.100", 0, 2, ePLCType.S7_300_400_compatibel
 
'read 10 Bytes from DB1
Dim myReadDataRequest As ReadDataRequest = new ReadDataRequest(eRegion.DataBlock,                           1,                                                                                  0,                                                                                  eDataType.BYTE,                                                                     10);                
'read
Dim res As ReadDataResult = Device.ReadData(myReadDataRequest)
 
'get the results
If res.Quality = OperationResult.eQuality.GOOD Then
   For Each item As ReadValue In res.FetchValues()
        Console.WriteLine("read " + item.ToString())
   Next
Else
    Console.WriteLine("error " + res.ToString())
End If

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", 0, 2, ePLCType.S7_300_400_compatibel);
 
//read 10 Bytes from DB1
ReadDataRequest myReadDataRequest = new ReadDataRequest(eRegion.DataBlock,  //Region
                1, //DB only for datablock operations otherwise 0
                0, //read start adress
                eDataType.BYTE,  //desired datatype
                10); //Quantity of reading values
 
ReadDataResult res = Device.readData(myReadDataRequest);
 
//evaluate results
if (res.getQuality() == OperationResult.eQuality.GOOD) {
   int Position = 0;
   for (Object item : res.getValues()) {
     System.out.println("read " + item.toString());
   }
}
else
{
    System.out.println("error " + res.toString());
}

Example: simple reading of values

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", 0, 2, 
ePLCType.S7_300_400_compatibel);
 
//declare a WriteRequest object and
//set the request parameters
WriteDataRequest myWriteRequest = new WriteDataRequest(eRegion.DataBlock, //Region
                100,               //DB
                0);                //startaddress
                 
//add writable Data here
//in  this case => write 4 bytes in DB100
myWriteRequest.addByte(new byte[] { 11, 12, 13, 14 });
 
 
//write
WriteDataResult res = Device.WriteData(myWriteRequest);
 
//evaluate results
Console.WriteLine("Write successfull! Message: " + res.Message);

Dim Device As PLCcomDevice = New TCP_ISO_Device("192.168.1.100", 0, 2, ePLCType.S7_300_400_compatibel
 
'declare a WriteRequest object and
'set the request parameters
Dim myWriteRequest As New WriteDataRequest(eRegion.DataBlock, _
                                           100, _
                                           0)
 
'add writable Data here
'in  this case => write 4 bytes in DB100 at addres 0
myWriteRequest.addByte(New Byte() {11, 12, 13, 14})
 
 
'write
Dim res As WriteDataResult = Device.WriteData(myWriteRequest)
 
'evaluate results
Console.WriteLine("Write successfull! Message: " + res.Message)

PLCcomDevice Device = new TCP_ISO_Device("192.168.1.100", 0, 2, ePLCType.S7_300_400_compatibel);
 
//declare a WriteRequest object and
//set the request parameters
WriteDataRequest myWriteRequest = new WriteDataRequest(eRegion.DataBlock,  //Region
                100,           //DB
                0);                 //write start address
             
//add writable Data here
//in  this case => write 4 bytes in DB100
myWriteRequest.addByte(new byte[]{11, 12, 13, 14});
 
//write
System.out.println("begin write...");
WriteDataResult res = Device.writeData(myWriteRequest);
 
//evaluate results
 System.out.println("Write successfull! Message: " + res.getMessage());

Example: simple writing of values

PLCcom for S7 is available in two versions:

  1. Net version
    The .Net version supports classic .Net Framework programming. Furthermore, the delivery package contains a version for .Net-Standard Version 2.1 and a version for .Net 5.0. This component can be used to develop .Net Core, Xamarin, UWP or Unity applications. In addition, a NuGet package is made available via nuget.org.
  2. Java version
    The Java version provides developers with a Java component for Java application development, e.g. with Eclipse or Netbeans.
    Since version 9, the development of Android apps is also supported.

Effective optimization options

PLCcom for S7 was equipped with various internal optimization options. The developer can specify in which way read or write optimizations can be performed internally. So it is e.g. possible to summarize the same data areas in shared read accesses when reading (COMBINE_AREAS) or read or write different data areas in a shared access (mix access CROSS_AREAS).

In addition, the Expert-Edition provides the additional feature of internally identifying and automatically applying the best optimization method (AUTO). Due to these implemented optimization algorithms, only the minimum necessary accesses to the PLC are performed. As a result, a sensitive and measurable processing acceleration can be achieved.

Editions and features

Feature Professional Expert

For commercial or commercial use

Top Level Support

Connection to S7 controllers
200, 300, 400, 1200, 1500 series, SoftPLC WinAC RTX and CPUs of other manufacturers

Connection to S7 controllers Logo!
0BA7 und 0BA8

Reading and writing data

High performance access

TCP/IP access

MPI/PPI access

Multiple read and write accesses in a common function call

Reading or writing multiple values simultaneously in different areas

Provide several effective optimization methods for effective concurrent reading and writing of values

Automatic detection of the best optimization method

Starting and stopping the CPU

Reading and setting the PLC system time

Read information like model, order number, firmware etc.

Get mode and state from CPU

Get LEDs mode from PLC
(on, off, indicating)

Reading system status list SSL

Query of the diagnostic data of PLC

Send password
to unlock connection of
password-protected PLCs

Read a list of created PLC objects. (All or specific block type e.g. only OBs)

Read length of
a specific block

Read a specific block in
MC7-format and save to a select file
(Backup)

Get specific block properties version, author, create language and many more

Restore block data
from a selectable MC7-file
(Restore)

Restore in different block number

Delete blocks

Data server for event controlled variable monitoring on the SPS

Progressive logging of SPS data to file system or SQL database

Progressive logging of SPS data to SQL database

Writing the latest image of SPS data to file system

Writing the latest image of SPS data to SQL database

Encoded data storage to filesystem

Free database choice by developer

Feature
S7-300
S7-400
S7-200
S7-1200
S7-1500
WinAC RTX (from version 2010) Logo (from version 0BA7)

Read data

Write data

Reading data from multiple areas combined

Multiple read and write accesses in a common function call

Reading or writing multiple values simultaneously in different areas

Starting and stopping the CPU

Reading and setting the PLC system time

Get basic info from PLC e.g. Modell, ordernumber, Firmware etc.

Get mode and state from CPU

Get LEDs mode from PLC
(on, off, indicating)

Reading system status list SSL
(if existing)

Get diagnostic data

Send password
to unlock connection of
password-protected PLCs

Read a list of created PLC objects
(All or specific block type
e.g. only OBs)

Read length of
a specific block

Read a specific block in
MC7-format and save to a select file
(Backup)

Get specific
block properties e.g.
(version, author,
Create language and many more)

Restore block data
from a selectable MC7-file
(Restore)

Restore in
different blocks

Delete blocks

Simple license model, top-level support available

PLCcom is licensed for the creation of individual software per developer, and subsequent runtime licenses do not result. Try out PLCcom with a 30-day trial version, before you license PLCcom.

We want you to be satisfied with our product; even after purchase we will not leave you all alone!
If you encounter any unexpected problems or issues related to our product, we will be unbureaucratically and promptly available and assist you in solving the problem.