Online Manual (PDF)
Code Samples
Performance Chart
Installation Guide
Building/Platform Compatability
Release Notes
Warranty and Licensing
Release Notes
PLCIO V4.5 (2015) PLCIO V4.4 (2013) PLCIO V4.3 (2011) PLCIO V4.2 (2009) PLCIO V4.1 (2007) PLCIO V4.0 (2005)

PLCIO 4.0 Release Notes


PLCIO 4.0 is a top-down rewrite of the original PLCIO library that CTI has provided for several years. This version continues to support dynamically- loadable modules for each PLC, while insuring identical API behavior independent of the module used. Although the PLCIO library remains mostly unchanged, binary compatibility is broken from previous versions of PLCIO. Programmers must recompile and link their applications to the new library.

New Features


PLCIO can now be compiled and operated on 64-bit architectures. It can be compiled with the GNU Compiler Collection (GCC) on any UNIX operating system. PLCIO continues to support HP-UX's native `cc' compiler as it has done in the past.

Hardened I/O:

PLCIO now sports an "industrially-hardened" I/O interface. All ethernet communication is now passed through special read/write functions. These functions will automatically restart if any interrupting signals are received, piece together broken TCP/IP frames, and obey the timeouts specified in the PLCIO function calls.

As a beneficial side-effect, PLCIO can now operate over relaying connections such as SSH tunnels and VPNs, where TCP/IP packets are usually fragmented and/or combined.


With PLC verbose mode set to level 4, all PLC-level communications between server and PLC are now logged to a file in hexadecimal format, 16 bytes per line.

A new config-file keyword, $LOGSIZE, allows the user to set the maximum file size for logging. When this size is exceeded, the file is renamed with a .1 suffix and a new log file begins.


A new error system is in place to address the shortcomings of PLCIO 3.x. The 'j_error' member of the PLC structure contains the error code of the last PLCIO API function, or 0 on success. PLCIO-specific errors use codes 1 through 99, and Module-specific errors use codes 200 and up.

Each part of PLCIO that produces an error logs a message to the 'ac_errmsg' structure member, up to 79 bytes long. This message contains information about the exact error that occurred, including actual error values returned by the PLC in some cases. It is no longer static, as in version 3.x.

Each PLCIO application can test for additional error values returned along with the PLCIO error by looking at the aj_errorval[0...7] structure member. Only specific PLCIO Errors fill in these values. Refer to the manual for the meanings of additional error values on a per-function and per-module basis.

The 'j_errno' member of the PLC structure contains the UNIX errno value at the time of the error.

With verbose mode set to 1 or greater, all PLCIO errors will automatically be logged with a detailed error message. This allows developers to easily view the errors of any PLCIO function call in the entire application.


Starting with PLCIO 4.0, all timeouts are specified in milliseconds. Earlier versions relied on a HZ value to specify the number of ticks per second. The use of HZ was unstable, since HZ can change from machine to machine depending on the UNIX kernel used. This had a tendency to break binaries that were either cross-compiled or copied between servers.

Timeouts now denote the total amount of time between a PLCIO function call and the return from that call, instead of the amount of time allowed for each individual I/O operation inside. Programmers may need to account for more time if many PLC transactions are required for a single function call (such as large read/write requests).

A timeout of 0 turns off the timer for that particular PLCIO function.

For backward compatibility, the value HZ is #defined in <plc.h> to be always 1000 regardless of OS or implementation.

Argument Validation:

All PLCIO function-call arguments are now validated in the PLCIO library proper before being passed to the modules. This makes module-writing extremely simple to program, as each module need only be written with the basic I/O tasks required to communicate with the PLC. This fixes many bugs where parameter checking was inconsistent (or missing) between modules.

In a similar fashion, all format conversion is now handled on the PLCIO-side and taken away from the modules. Modules have the option to override this.

The unsolicited (slave) version of the plc_read() call is now handled in PLCIO as a shortcut for plc_receive() and plc_reply(). This eliminates many lines of duplicated code per module that earlier handled those two cases separately. This led to correcting many bugs, most that were present in one version of the read/receive code but not in the other.

Serial I/O:

Support for opening a serial device is once again included in PLCIO 4.0. Users can select baud rates from 300 up through 460800, byte sizes from 5 to 8 bits, even/odd/no parity, and 1 or 2 stop bits. Users can also choose between hardware (RTS/CTS), software (XON/XOFF), or no flow control (provided the underlying hardware supports these options).

Library Changes

- The <plc.h> #include file no longer includes any system headers. Programmers are expected to #include all required headers for their applications.

- Unsolicited-only modules `enipab5' and `enipslc' have been integrated into a single module, 'enip'. Applications should use the new module name.

- Allen-Bradley modules 'abeth5' and 'abeth500' have been integrated into asingle module, 'abeth'. For solicited communication, programmers can select the PLC-5 or SLC500 version using plc_open("abeth plc5 hostname") and plc_open("abeth slc500 hostname"). The module supports unsolicited communication from both types of PLCs simultaneously.

- Module 'cipab5' has been renamed to 'cipab'.

- The PLCSLAVE structure was changed to store more information for the application during a plc_receive() call. In this version, the 'j_ipaddr' structure member was added to record the IP Address of the PLC sending the message. Using the "(sock_node *)plc_ptr->pavoid" structure to determine the IP Address is no longer valid and should not be used.

- The plc_status() function was dropped from the library.

- Physical PLC points can now be accessed with plc_read() or plc_write(), evenwhen the PLC is opened using logical access. This can be done by prefixing the function's 'pc_addr' argument with a ! symbol. This method is recommended only for diagnostic purposes.

© 2018 Commercial Timesharing, Inc. (CTI) All Rights Reserved      |     PLCIO is product of CTI      |     |     ph: 330.644.3059