PLCSQL explainer
Following up on an earlier post...
PLCSQL, my attempt at a SQL based data logger running under Linux, currently operates in a triggered mode. This basically means that ANY PLC on the network (currently, only Ethernet) can send a simple MSG to the logger, causing the logger to read pre-configured data registers and record the values along with a timestamp.
In detail, PLCSQL sets itself up to look like an Ethernet based PLC5, implementing enough of the DF1 command structure to allow it to be the receiver of typed write MSG commands.
When a msg command is received, the index value of the register is stripped off and interpreted to be the "trigger" index. For example, say you send a typed write msg to PLCSQL for register N7:4 - the 4 (being the index value) is interpreted to mean "trigger #4" in PLCSQL; the "N7" segment is ignored. Once received, PLCSQL then does a couple of database lookups to see what registers from what PLC's it has to retrieve and then retrieves the contents of those defined registers. The register data is then stored in the database along with the id of the PLC that provided the data, the actual register itself, and a timestamp. Once the contents of the trigger is processed, then a "no error" response is sent back to the triggering PLC, setting the DN bit on the original msg and confirming that the data has been recorded.
I use a typed-write msg to keep things simple - it only expects a result code back as opposed to actual data. The actual data transmitted by the trigger generating PLC is actually irrelevent and ignored - the only important part is that index value. Thus, a "trigger" to "N7:4" and "F6:4" cause the same data to be collected - the index value is identical (4).
PLCSQL is also capable of receiving signals from ANY plc on the network. I use programmatic forks to handle the actual processing of the received data, much like Apache 1.3. This allows me to handle several connections at once.
The back end is a standard MySQL instance, ODBC drivers for MySQL are freely available for people in the Windows World as well as multiple other computer platforms (HP/UX, Solaris, etc). This allows the end-user to send the data into an Excel spreadsheet, into an Access front end, or whatever their heart desires.
Of course, the front-end I am going to work on will deal with things like system initialization, configuration of the triggers, and will also allow for recorded data display and/or extraction. I'm still not sure if I am going to do the front-end GUI or CLI, but the whole thing WILL be very user friendly and simple to operate once finished. The front-end will be Linux based.
Finally, PLCSQL will initially be based on the ABEL library I wrote many moons ago. I plan to eventually also support the CELL library, allowing PLCSQL to also work with ControlLogix PLCs.
Any questions?