1.0.6 • Published 3 years ago

node-red-contrib-redplc v1.0.6

Weekly downloads
38
License
Apache-2.0
Repository
github
Last release
3 years ago

node-red-contrib-redplc

Node-Red nodes for Software Programmable Logic Controller (PLC)

Install

Install with Node-Red Palette Manager or npm command:

npm install node-red-contrib-redplc

Usage

redPlc nodes implements Software PLC functionality in Node-Red. The control logic is realized as ladder logic (LD) according standard IEC 61131-3.

redPlc nodes use the graphical environment of Node-Red for programming the control logic tasks.

redPlc is written in pure Javascript and works on all platforms where Node-Red runs.

Module nodes maps hardware or communication data to global variables. Module nodes must installed depends of used hardware or communication.

Global variables use predefined unique names and format. Each variable are unique with subsequent address number. Address range is 0..999. For easy handling, redPlc has only datatypes UINT32, LREAL and WSTRING.

Global variables:

VarFunctionDatatypeArray
IDigital InputUINT32
QDigital OutputUINT32
MDigital MemoryUINT32
FFFlip-FlopUINT32
CCounterUINT32
TTimerUINT32
IAAnalog InputLREAL16
QAAnalog OutputLREAL16
MAAnalog MemoryLREAL
ISString InputWSTRING16
QSString OutputWSTRING16
MSString MemoryWSTRING

Example

Example2 Ladder Logic with Raspberry Pi GPIO module. Contacts are used for latch coil.

Nodes

- CPU Node -

Is the main engine of redPlc. It performs a cyclical sequential operation. Module nodes are wired to first output. Ladder logic nodes are wired to second and next outputs.

- Sys-Start Node -

Sends one message on start. It can be used for initializing.

- Contact Node -

Implements a ladder contact. If closed, input power (true or false) is send to output. If open, no power (false) is send to output. Wiring contact node in series works as AND logic. Wiring contact node parallel works as OR logic. Any logical wiring combination are possible.

- Coil Node -

Implements a ladder coil. Energized if input condition is true. Deenergized if input condition is false.

- Function Node -

Implements digital functions. These are NOP, NOT, OR, AND and XOR. P_TRIGGER and N_TRIGGER for edge detection

- Flip Flop Node -

Sets output with dominant reset/set inputs.

- Counter Node -

CTU counts up. CTD counts down. CTUD counts up/down.

- Timer Node -

TON delays on. TOF delays off. TP produce an on/off pulse. TPI produce an on/off pulse interval. TONR is a retentive on timer.

Donate

If you like my work please support it with donate:

Donate