Linux/UNIX to PLC API Library
Search
   Home
About CTI and PLCIO
How to Purchase
FAQ
Documentation
Contact CTI
Custom Development
News / Blog
Did You Know?
Although originally written
for UNIX, PLCIO has been ported to the Windows operating system since version 4.1.
 
 
 
Frequently Asked Questions
 
Q: Can the PLCIO API be extended to support different communications?
A: Yes – the tool kit includes a simple example for extending the library.
Q: Can I use a different timeout than the default when opening a PLC with plc_open()?
A: Yes, only if you use a soft PLC open and specify the timeout in the plcio.cfg configuration file. An associated point configuration file is not necessary.
Q: Can PLCIO be run with only the shared libraries and no data files?
A: Yes. The plcio.cfg and point configuration files are both optional.
Q: What is the maximum length of a tag name in PLCIO?
A: The 'cip' module only matches ControlLogix tag names up to 63 characters long. Other than that, a tag name is only restricted by the 250-character line limit in the point configuration file.
Q: Can I still use tag names if I do a physical open to a ControlLogix PLC, instead of a soft open?
A: Yes. PLCIO does not handle numerical addresses with ControlLogix--only tag names.
Q: Can I download a trial version of the PLCIO software so that I can confirm it works with my application?
A: No. We do not have a trial version, since we require an NDA and distribute our product in source code form. However you are more than welcome to review the manuals and other material on this website prior to making your decision.
Q: Regarding the "virtual" module, there are only two tags: RAW1 and RAW2. What if I need more addresses to store data?
A: You can use the "tagname(offset)" syntax with these tags. As shipped, RAW1 is 200 bytes in size and RAW2 is 2000 bytes in size. Therefore if you were working with 16-bit integers, you can store 100 integers in RAW1 and reference them as RAW1(0), RAW1(2), RAW1(4), and so on. If you need to increase the size of the tags, you can edit the VIRT_RAW1_SIZE and VIRT_RAW2_SIZE #defines in so/virtual.c and recompile the library.
Q: plc_read() returns the number of bytes read from the PLC. plc_write() seems to always return 0 regardless of what I send. Any idea what might be wrong?
A: This is correct behavior. plc_write() fails if it is not able to send the complete message or receive a positive verification from the PLC within the specified timeout. Therefore plc_write() only returns 0 on success or -1 on error.
Q: I would like to have separate PLCIO applications listen for messages from separate Allen-Bradley PLCs. How can I do that on the same server?
A: Only one process can listen on the same TCP/IP port per server. Given that, there are two ways to work around this restriction:

First, you can write a separate PLCIO application that listens for all incoming PLC messages. Based on the message contents or source IP Address, you can then forward the message to the correct process using conventional means (socket or pipe communication). Unfortunately, your original two processes are no longer communicating via PLCIO and extra work is required to send a reply back to the PLC.

The other approach is to enable IP Address aliasing on your server. If you configure the server's network interface to have multiple IP Addresses, then each process can listen on the same TCP/IP port but also on a different IP Address. It is then up to the PLC to send the message to the correct IP Address destination. To listen on a single IP Address in PLCIO, set the j_plcio_ipaddr global variable prior to your plc_open() call.
Q: What is the minimum Linux kernel that PLCIO library requires?
A: Any Linux kernel version 2.0 or later should work fine.
Q: My application produces a segmentation fault any time I call plc_open(). What could be the problem?
A: Chances are that you have two different versions of the PLCIO library installed in two different lib/ directories, and one version is dynamically loading PLC modules from another version. Locate all occurrances of libplc*.so* in your filesystem and delete them, then reinstall PLCIO.
Q: plc_open() takes too long to open a ControlLogix PLC. How can I get a quicker response time with a standalone application?
A: The "cip" module reads all tags from a ControlLogix PLC upon plc_open(). If there are upwards of 1000 tags present, it can take longer than 10 seconds to complete.

To alleviate this problem, use the supplied "plciod" daemon program to initiate a persistent connection to the PLC. Then change plc_open() in your application to use the "remote" module along with your chosen plciod port. Your plc_open() call should now happen instantaneously. Don't forget to restart the "plciod" daemon every time you download a new program to the PLC.
Q: I am waiting on other socket or keyboard input in addition to a message from a PLC. Can I use select() directly on PLCIO file descriptors?
A: No. In unsolicited mode, PLCIO internally manages a table of file descriptors that can grow or shrink based on the number of PLCs currently connected to your application. The API is not capable of providing you with this list of file descriptors.

We recommend cycling between select() and plc_receive() in your application, with a short (30 milliseconds or less) timeout for each.
Q: Can I install a new version of PLCIO while PLCIO applications are running in the background?

Yes, only on UNIX. The 'make install' process removes old libraries and modules (technically unlinks them from the filesystem) before copying the new ones to the same location. This allows running applications to continue using the old libraries as long as the process stays active. If the application is stopped and restarted, it will begin using the newly installed libraries.

On Windows, libraries cannot be deleted when in use, so this is not possible.

Q: What is the warranty on PLCIO?
A: There is a one year warranty on PLCIO, see our Warranty and Licensing page to learn more.
Q: The runtime for PLCIO is sold by CPU license. What is a CPU?
A: For PLCIO, we define a CPU as an active production computer running PLCIO. If this computer is one small Pentium 3 or a huge four CPU Quad Core Xeon processor box, both are defined as One CPU. If there are two computers are running as a cluster, one CPU license is needed for a failover cluster; two (or more) are needed as a “load balanced” cluster. The spirit of our CPU license is “active production” computers.
Q: While installing PLCIO, the following errors appear:

                ldconfig was not "found" (make[1]: ldconfig: Command not found)

                /sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~:
      Permission denied

A: The install process is intended to be run as root. If that is not possible in your case, you may need to make adjustments to either the /etc/ld.so.conf file or your $LD_LIBRARY_PATH shell variable in order to run PLCIO programs.

This depends on the system install location you chose during the 'configure' step. If for instance you chose /usr/local or /usr , then no changes are necessary since the /usr/local/lib and /usr/lib directories are already in the library search path.

But if you chose /usr/local/cti for instance, then the directory /usr/local/cti/lib must be added to /etc/ld.so.conf , and then ldconfig needs to be run afterwards. If you don't have access to /etc/ld.so.conf , then you will need to add this path to your LD_LIBRARY_PATH variable instead by typing this into the shell before running any PLCIO programs:

        export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/cti/lib

Can't find an answer to your question? Please contact us with any inquiries that you have.
© 2011 Commercial Timesharing, Inc. (CTI) All Rights Reserved      |     PLCIO is product of CTI      |     www.comtime.com     |     ph: 330.644.3059