One of the developers, Juan, has a physical demo accessible over the web. There is a tank with level control and a simple three-axis robotic arm, with a webcam so you can see what's happening. (The tank and the trend functions require Java; if you don't have Java, you'll only be able to play with the robot arm.)
This is because one of the purposes of the GPL is to protect the client, so the consultant is not allowed to restrict the client. There's no problem having the restriction the other way, protecting the client's IP.
See also the Module section of the manual.
1.0) Introduction 2.0) Using a Linux PC with IO modules to act as a PLC 2.1) Supported hardware 2.2) Kernel issues 2.3) Low level programming API 3.0) Programming languages for PLC 3.1) IEC 61131-3 3.1.1) Ladder logic (aka LD) 3.1.2) Instruction language (aka IL) 3.1.3) Structured language (aka ST) 3.1.4) Function Block (aka FBD) 3.2) MAT IL language 3.3) Language editors 4.0) Data acquisition 4.1) Simple historian 4.2) SCADA historian 4.3) Advanced historian 5.0) Man machine interface 5.1) Simple snapshot interface 5.2) Web interface 6.0) "Hardware discusion" 7.0) Comunications to PLC devices 7.1) Hardware communication methods 7.1.1) Serial communications 7.1.2) Ethernet communications 7.2) "Open protocols" 7.2.1) MODBUS 7.3) Proprietry procotols |
Old text (mostly belongs elsewhere)The MatPLC (previously also known as the PuffinPLC) is an effort to produce a working PLC-like program runing on Linux, with a GUI for configuring and viewing its current state. The GUI will not be limited to Linux, but hopefuly also run on Windows, Web browsers, etc... We intend to take advantage of the fact that we have an underlying Operating System (OS) and therefore we will use its features to try and make the MatPLC modular, allowing for parallel code development. A running MatPLC consists of modules runing in an infinite loop, and accessing the common MatPLC memory/state. The common MatPLC memory/state is limited to points that can be from 0 to 32 bits wide. One module could be a PID loop, using two points for its input, and a third point for its output. Another possible module could be a plc5 emulator, that executes plc5 code, but using MatPLC points as its variables. Yet another possible module would be an I/O board driver, that would copy the state of some MatPLC points to its outputs, and copy the state of its inputs to other MatPLC points. As already stated, taking advantage of the underlying OS, each module will run as an independent process. This means that each module can be developed independently of each other, in whatever programming language the coder chooses. Access to the common MatPLC memory/state is done through a matplc.a library of functions, written in C, and with C header files available. The plc_set() function that Jiri has just explained, falls into the group of functions that give access to this common memory/state. The matplc.a library currently also supports synchronisation between modules. For example, say we have an I/O module and a PID module running. For the PID module to produce correct results, it must run in lock-step with the I/O module. With the synchronisation between modules, we can guarantee that the PID and I/O modules will run their scanning loops intermingled (i.e. I/O - PID - I/O - PID - ...). This is achieved without any explicit programming effort on the part of the module programmer, other than calling a specific plc funtion at the begining of the scan, and another at the end. Although not yet implemented, we intend to support online changes to the PLC, such as adding a module, removing a module, replacing a module (and guaranteeing that the new module will only start executing once the module being replaced has finished its scan), etc... This has not yet been completely thought out, so the supported semantics may change compared to what I have described. As you may have already noticed, for the MatPLC to work it requires common resources so the modules/processes can communicate and synchronise between them. This is done using shared memmory and semaphores. The use of these IPC (inter-process communication) mechanisms is hidden from the module coders by the matplc.a library. The shared memories and semaphores need to be setup before any module can start executing. This is done by the matplc utility (previously named smm-mgr) with the -g parameter. To shutdown the MatPLC (i.e. delete the common shared memmory and semaphore resources) use the -s parameter. If you want to exercise the MatPLC at a very low level, you may use the plctest utility. The structure of the cvs server:
1.0) Introduction2.0) Using a Linux PC with IO modules to act as a PLC2.1) Supported hardware2.2) Kernel issues2.3) Low level programming API
3.0) Programming languages for PLC3.1) IEC 61131-3In the MatPLC CVS tree under the/logic/iec directory is the
first workings of a program to translate IEC 61131-3 Instruction list (IL) and
Structured Text (ST) files into a form that can be integrated with MatPLC.
The code at this stage is strictly "under-development", there is no
guarantee that even simple programs will even translate, let alone generate
correct code.
For more info on the IEC 61131-3 standard you could check
ftp://ftp.cle.ab.com/stds/iec/sc65bwg7tf3/document/ for an old draft
when they last revised the standard (eg: use this at your own risk).
3.1.1) Ladder logic (aka LD)3.1.2) Instruction List language (aka IL)Work in progress3.1.3) Structured Text language (aka ST)Work in progress3.1.4) Function Block (aka FBD)3.2) MAT IL language
3.3) Language editors4.0) Data acquisition (data historian)4.1) Simple historian ("snapshots")4.2) SCADA historian (snapshots, averages, archiving)4.3) Advanced historian (above + MMI + trending +...+
|
Layer | Description | FAQ Section |
Physical | Transmits and receives bits over the physical media | Hardware |
Data link | Adds error-checking information and organizes bits into frames | Hardware |
Network | Handles internetwork sequencing, addressing and routing | Hardware |
Transport | Adds identifiers to processes and deals with error-handling information | Protocol |
Session | Sets up and tears down connections or sessions. Administers sessions. | Protocol |
Presentation | Translates data formats and adds encryption | User Interface |
Application | Provides services that directly support user applications | User Interface |
Anyone interested in Modbus can find specifications at
http://www.modicon.com/techpubs/TechPubNew/index.html.
The serial protocols are described in
http://www.modicon.com/techpubs/TechPubNew/PI_MBUS_300.pdf
The Modbus/TCP protocol is described in
http://www.modicon.com/openmbus/
BTW: there are two serial protocols called ASCII and RTU. They differ only
at what you might call the data link layer. The higher layers are the same.
(Though you won't find any description of layers in the protocol
specification, it can be implemented as a layered protocol.)
ASCII is easier to implement, but RTU is about twice as efficient. As a
result most low bandwidth applications use the RTU protocol. I'd recommend
implementing both, but if you have to choose, pick the RTU protocol.
$Date: 2006/05/13 05:23:29 $