Returns an error text string for a given error code.
Define Documentation
#define FTALK_SUCCESS 0
Operation was successful.
This return codes indicates no error.
#define FTALK_ILLEGAL_ARGUMENT_ERROR 1
Illegal argument error.
A parameter passed to the function returning this error code is invalid or out of range.
#define FTALK_ILLEGAL_STATE_ERROR 2
Illegal state error.
The function is called in a wrong state. This return code is returned by all functions if the protocol has not been opened succesfully yet.
#define FTALK_EVALUATION_EXPIRED 3
Evaluation expired.
This version of the library is a function limited evaluation version and has now expired.
#define FTALK_NO_DATA_TABLE_ERROR 4
No data table configured.
The slave has been started without adding a data table. A data table must be added by either calling addDataTable or passing it as a constructor argument.
#define FTALK_ILLEGAL_SLAVE_ADDRESS 5
Slave address 0 illegal for serial protocols.
A slave address or unit ID of 0 is used as broadcast address for ASCII and RTU protocol and therefor illegal.
#define FTALK_IO_ERROR_CLASS 0x40
I/O error class.
Errors of this class signal a problem in conjunction with the I/O system.
#define FTALK_IO_ERROR (FTALK_IO_ERROR_CLASS | 1)
I/O error.
The underlaying I/O system reported an error.
#define FTALK_OPEN_ERR (FTALK_IO_ERROR_CLASS | 2)
Port or socket open error.
The TCP/IP socket or the serial port could not be opened. In case of a serial port it indicates that the serial port does not exist on the system.
Signals that the TCP/IP connection could not be established. Typically this error occurs when a host does not exist on the network or the IP address or host name is wrong. The remote host must also listen on the appropriate port.
Indicates that the specified TCP port cannot be bound. The port might already be taken by another application or hasn't been released yet by the TCP/IP stack for re-use.
You don't have permission to access the serial port or TCP port. Run the program as root. If the error is related to a serial port, change the access privilege. If it is related to TCP/IP use TCP port number which is outside the IPPORT_RESERVED range.
The specified TCP port is not available on this machine.
#define FTALK_BUS_PROTOCOL_ERROR_CLASS 0x80
Fieldbus protocol error class.
Signals that a fieldbus protocol related error has occured. This class is the general class of errors produced by failed or interrupted data transfer functions. It is also produced when receiving invalid frames or exception responses.
Signals that a received frame does not correspond either by structure or content to the specification or does not match a previously sent query frame. A poor data link typically causes this error.
Signals that a fieldbus data transfer timed out. This can occur if the slave device does not reply in time or does not reply at all. A wrong unit adress will also cause this error. In some occasions this exception is also produced if the characters received don't constitute a complete frame.
Signals that a Modbus exception response was received. Exception responses are sent by a slave device instead of a normal response message if it received the query message correctly but cannot handle the query. This error usually occurs if a master queried an invalid or non-existing data address or if the master used a Modbus function, which is not supported by the slave device.
Signals that an Illegal Function exception response (code 01) was received. This exception response is sent by a slave device instead of a normal response message if a master sent a Modbus function, which is not supported by the slave device.
Signals that an Illegal Data Address exception response (code 02) was received. This exception response is sent by a slave device instead of a normal response message if a master queried an invalid or non-existing data address.
Signals that a Illegal Value exception response was (code 03) received. This exception response is sent by a slave device instead of a normal response message if a master sent a data value, which is not an allowable value for the slave device.
Signals that a Slave Device Failure exception response (code 04) was received. This exception response is sent by a slave device instead of a normal response message if an unrecoverable error occured while processing the requested action. This response is also sent if the request would generate a response whose size exceeds the allowable data size.
Function Documentation
TCHAR* getBusProtocolErrorText
(
int
errCode
)
Returns an error text string for a given error code.