PLCPanel
- Last UpdatedNov 04, 2024
- 4 minute read
You can build the sample Communication Driver solution provided by the Communication Drivers SDK to create a Communication Driver. Most of the sample Communication Driver are designed to communicate with a PLC emulator called PLCPanel. PLCPanel supports communication by serial port, TCP, UDP, and shared memory, all at one time. Except for shared memory, all the protocols work on the same computer or a different computer from the Communication Driver. Using shared memory, PLCPanel must run on the same computer as the Communication Driver.
PLCPanel emulates the bus controller for a distributed I/O system. The bus controller communicates with the actual I/O devices, and copies information gathered from the devices into a RAM buffer inside the bus controller.
The figure above shows one version of the bus controller that PLCPanel emulates, communicating with I/O devices over its proprietary I/O bus. This version of the bus controller is designed to plug in to a computer, and share its internal RAM buffer directly as dual port RAM. Other versions of the bus controller (all emulated by PLCPanel, all the time) include one that shares its internal RAM buffer with the host computer using TCP, another that uses UDP, and one that uses a serial port.
Note: The PLCPanel communicates with the COM1 serial port.
At all times, the Communication Driver simply references PLCPanel’s internal RAM buffer. It is up to the bus controller (as emulated by PLCPanel) to map the inputs and outputs to the internal RAM buffer. The mapping is controlled by configuring the PLCPanel.
There are four types of I/O devices. Each of the four types inherently supports one or more items. Up to 128 each of Discrete Input, Discrete Output, Analog Input, and Analog Output devices may be configured. Each configured device has a unique name.
Each of the four device types supports a specific set of items. Every device of a specific type supports the same item set, always with the same name, type, and access rights.
Discrete Input (DI), devices support only one item:
-
Input, VT_BOOL, Read-Only, Offset+0.
Discrete Output (DO), devices support only one item:
-
Output, VT_BOOL, Read/Write, Offset+0.
Analog Input (AI), devices support three items:
-
Input, VT_R8, Read-Only, Offset+0.
-
HighLimit, VT_BOOL, Read-Only, Offset+8.
-
LowLimit, VT_BOOL, Read-Only, Offset+9.
Analog Output (AO), devices support three items:
-
Output, VT_R8, Read/Write, Offset+0.
-
HighLimit, VT_BOOL, Read/Write, Offset+8.
-
LowLimit, VT_BOOL, Read/Write, Offset+9.
Each I/O Device must be configured with a base offset into the bus controller’s internal RAM buffer. This base offset is referred to as "Offset" in the list above. The individual items supported by each device are found at "Offset" plus a constant, as indicated.

A sample configuration is shown here. In this simple example, the bus controller is named "Adapter", and only one instance of each device type exists. The DI device is named "Button", the DO is named "LED", the AI is named "Temp", and the AO is named "OTemp".
The fully-qualified item names for these items is generated by concatenating the name of the adapter, the name of the device, and one of the valid item names for that device. For the example configuration shown above, some examples are:
-
Adapter.Button.Input
-
Adapter.Temp.HighLimit
-
Adapter.OTemp.Output
This configuration is supported by the installed PLCPanel configuration file; so it is commonly used as a starting point when configuring each of the Communication Drivers in this guide. The following table relates the Communication Driver item names to their base offsets, and the names as configured into PLCPanel.
|
I/O Device |
Item Name Adapter |
Base Offset |
Final Offset |
Type |
PLCPanel Name |
|---|---|---|---|---|---|
|
Button |
1 |
||||
|
Button.Input |
1 |
VT_BOOL |
Button |
||
|
LED |
5 |
||||
|
LED.Output |
5 |
VT_BOOL |
LED1 |
||
|
Temp |
10 |
||||
|
Temp.Input |
10 |
VT_R8 |
TempInput |
||
|
Temp.HighLimit |
18 |
VT_BOOL |
TempHiLimit |
||
|
Temp.Lowlimit |
19 |
VT_BOOL |
TempLoLimit |
||
|
OTemp |
20 |
||||
|
OTemp.output |
20 |
VT_R8 |
TempSPOutput |
||
|
OTemp.HighLimit |
28 |
VT_BOOL |
TempSPHiLimit |
||
|
OTemp.LowLimit |
29 |
VT_BOOL |
TempSPLoLimit |
PLCPanel is available under:
Sample -> Utilities folder
It can be run directly from this location or copied to some other location. If you copy it, be sure to copy its configuration file (PLCItems.dat) and its shared memory file (Sharedmemory.h) into the same location.
