Function transmits data through the serial interface (Interface setting). For transmitting, data is taken from the TXD buffer from 0
to send_size - 1
.
Next, the function waits for a response for the time (setting Timeout) or until the RXD buffer receives data of length >= require_size
.
For the function to work, the corresponding interface must be configured in the device configuration:
Confirguration > RS-232/RS-485 > Device X > Сomplex Events (Transaction).
Function menu | Block diagram |
---|---|
![]() |
![]() |
Name | Type | Description |
---|---|---|
start |
bool | If True, function tries to start a transaction |
send_size |
int32 | Size of data array from TXD buffer to send |
require_size |
int32 | Expected response size |
Name | Type | Description |
---|---|---|
ended |
bool | Transaction completion signal The signal is not set if the interface is not configured ( state = -1 ). |
state |
int32 | Transaction state: 0 — no activity; 1 — waiting for interface access; 2 — interface accessed; 3 — transaction in progress; 4 — transaction completed successfully; -1 — interface unavailable (not configured); -2 – response timeout expired; -3 – unknown error. |
recv_size |
int32 | Size of the received data array Received data is immediately placed in the RXD buffer. |
Name | Description |
---|---|
Interface | Digital interface controlled by the function. If the selected interface is not configured, the function will generate a state = -1 error. |
Timeout | Time during which the function waits for a response after sending the data. If the number of bytes <= require size is received within the allotted time, then the transaction ends with the error state = -2 . |