Serial port

BrowseName: SerialPort
SuperType: Object (BaseObjectType)
TypeView path: Tipi > Driver di comunicazione > Porta seriale

Represents a serial communication channel, configurable according to the protocol used by the PLC, to create request/response-type or event-type protocols.

Applications

Used to configure the communication with PLCs whose protocols are not natively supported in UNIQO.

Configuring the object

Set the object

  1. Set the properties of the object with the appropriate values for the protocol you want to implement.

    Note

    the properties of the object can be set with both fixed and dynamic values, via dynamic links. In this way, the object can be reconfigured at runtime via the interface as needed. For example, to reconfigure unknown data in the design phase, it is useful to set a page in the interface that makes it possible to change the values of the object’s properties at runtime.

  2. Inside the object, create a NetLogic that implements the protocol logic using the APIs shown by the object (see Serial Port APIs).

Configuration of protocols in request/response and event mode

See examples in Serial Port APIs.

Properties

Name

BrowseName

DataType

Description

Port name

PortName

String

Number of the COM serial port to use for the Bridging service on which the modem is connected.

Baudrate

Baudrate

UInt32

Serial communication speed (Baud Rate). The communication speed value should be set to match that of the device with which you intend to communicate.

Data size

DataSize

Byte

Number of bytes required by the communication protocol concerned.

Parity

Parity

Parity type required by the communication protocol concerned.

StopBits

StopBits

Number of Stop bits required by the communication protocol concerned.

FlowControl

FlowControl

Data flow control type for the communication type used. In particular, it makes it possible to adapt the communication according to the needs required at low level by the serial port of the connected device. By default, the driver sets “None”, i.e., no flow control; however, depending on the device, it may be necessary to select a type of Flow Control (for example, in the event of an error message with code “1”). The possible selections are: None: No flow control. The control is not required by the protocol. Hardware: The Flow control is managed by the serial line electrical signals (e.g. RTS, CTS, etc.). XON/XOFF: the data flow control is XON/XOFF.

Timeout

Timeout

Duration

Maximum wait time in milliseconds to receive a response from the PLC.

LowLatency

LowLatency

Boolean

If enabled, minimizes the receive latency of an FTDI serial device

Communication status

CommunicationStatus

CommunicationStatus

Methods

Open

BrowseName: Open

Close

BrowseName: Close

Read

BrowseName: Read

InputArguments

Name

DataType

Description

Count

UInt32

Byte number

OutputArguments

Name

DataType

Description

Buffer

Byte

Buffer

Read

BrowseName: ReadUntil

InputArguments

Name

DataType

Description

Delimiter

String

Delimiter

OutputArguments

Name

DataType

Description

Buffer

Byte

Buffer

Write

BrowseName: Write

InputArguments

Name

DataType

Description

Buffer

Byte

Buffer

Cancel read

BrowseName: CancelRead

See also

Concetti correlati

Communication driver