Porovnávané verzie
porovnané s
Kľúč
- Tento riadok sa pridal
- Riadok je odstránený.
- Formátovanie sa zmenilo.
Declaration
Blok kódu | ||||
---|---|---|---|---|
| ||||
unsigned int (_stdcall * WriteToLine)(HOBJ StID, void * Data, unsigned int Len); |
Parameters
StID | Communication station ID. |
Data | Pointer to a buffer of the data to send. |
Len | Number of bytes to send. |
Description
The function writes data with specified length into Serial, MOXA IP Serial Library, SerialOverUDP Device Redundant or TCP-IP/TCP, in case of first two lines with parameters defined according to specified mode of a particular station.
Return value
True / False according to the function success.
Note: The following applies to TCP-IP/TCP line:
- calling WriteToLine with a zero value of parameter Len just causes the TCP connection to be closed (this can be used, for example, in systems with instances of KOM processes or in redundant systems to close a TCP connection if the KOM process is passive or is connected to the SBS kernel)
- calling the WriteToLine function with a non-zero value of parameter Len triggers an attempt to establish a connection unless the connection is connected
- the WriteToLine function returns False if a write error has occurred (e.g., TCP connection was broken)
- subsequent calling of the WriteToLine or ReadFromLine functions will cause an attempt to re-established the connection
- if the connection is established, the requested operation is executed (WriteToLine - writing data, ReadFromLine- reading data)
- if multiple IP addresses (separated by a comma or semicolon) are configured in the line configuration, the KOM process cyclically attempts to establish a connection to these IP addresses