PutPLC 2.3.0.4.10.0.0-147

Bundle
com.cloudera | nifi-cdf-plc4x-processors-nar
Description
Processor able to write data to industrial PLCs using Apache PLC4X
Tags
plc4x, sink, write
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
  • Additional Details for PutPLC 2.3.0.4.10.0.0-147

    PutPLC

    Purpose

    This processor is supposed to write new values to specific registers of a PLC device.

    General Concept

    This processor requires one or more input records, that specify the values to be written into the device. A minimum setup requires an enabled PLC4X Connection Pool, a Record Reader, and any number of registers defined in the Address Map (dynamic properties). During execution, it takes the next available FlowFile, connects to the device defined by the Connection Pool, and processes each record.

    Every record is a write operation. The record fields, that should be written to the device must be defined in the Address Map. Fields not mapped to any register address, are ignored.

    Address Map

    Address Map is defined as Dynamic Properties in the processor settings. Validation fails, if there is none defined. The generated record consists of fields, and the mapping defines which field should contain which PLC register’s value. The name (key) defines the record field, the value defines the PLC register’s address. (Please refer to the Driver documentation, to find the required address format.) You can define any number of fields, all of these are written in a single pass.

    If the input records have a hierarchical structure, you can select the fields you wish to use, by defining them as NiFi RecordPaths. It is also possible to refer specific record values in the register address, by enclosing RecordPath definitions in %{...} blocks, similarly to the use of NiFi Expression Language. For example, if your input records consist of a item and an address field, you can define a dynamic property with name /item (or simply item), and with value %{/address}, so you can write each of the records to different PLC registers, based on the input. Please note that register addresses cannot be validated, if they contain either EL or RecordPath expressions.

    Output

    The individual records are forwarded in new FlowFiles on ‘success’ and ‘failure’ relationships, based on their success status. The records are written by a Record Writer, which is required to be set. The original input is always forwarded as-is on the ‘original’ relationship, which is auto-terminated by default.

    Type Mapping

    Due to the limitations of Avro, some data types cannot be represented in the schema, and can not be mapped to the correct PLC4X value type. An unpleasant consequence is, that registers having incompatible data type, cannot be written by the processor. Please find the mapping below:

    Mapping of Avro field types to PLC4X data types

    Avro Type PLC Type Name Numeric Code (HEX)
    booleanType BOOL 0x01
    intType INT 0x22
    longType LINT 0x24
    floatType REAL 0x31
    doubleType LREAL 0x32
    stringType STRING 0x43
    array List (of first element type) 0x62
    bytesType RAW_BYTE_ARRAY 0x71

    PLC4X Documentation

    PLC4X Support

Properties
Dynamic Properties
Relationships
Name Description
failure An error occurred while processing
success Successfully processed
original The original FlowFile that was attempted to be sent to the PLC device.
Writes Attributes
Name Description
plc4x.write.row.count Number of rows from the input FlowFile, attempted to be written into the PLC
plc4x.write.error.count Number of rows from the input FlowFile, failed to be written into the PLC
See Also