FieldTalk Modbus® Master Protocol Library C++ Editions |
The functions provided by this base class apply to all protocol flavours via inheritance. For a more detailed description see section Data and Control Functions for all Protocol Flavours.
Class 0 Modbus Functions | |
int | writeMultipleRegisters (int slaveAddr, int startRef, const short regArr[], int refCnt) |
Modbus function 16 (10 hex), Preset Multiple Registers/Write Multiple Registers. | |
int | writeMultipleLongInts (int slaveAddr, int startRef, const long int32Arr[], int refCnt) |
Modbus function 16 (10 hex) for 32-bit long int data types, Preset Multiple Registers/Write Multiple Registers with long int data. | |
int | writeMultipleMod10000 (int slaveAddr, int startRef, const long int32Arr[], int refCnt) |
Modbus function 16 (10 hex) for 32-bit modulo-10000 long int data types, Preset Multiple Registers/Write Multiple Registers with modulo-10000 long int data. | |
int | writeMultipleFloats (int slaveAddr, int startRef, const float float32Arr[], int refCnt) |
Modbus function 16 (10 hex) for 32-bit float data types, Preset Multiple Registers/Write Multiple Registers with float data. | |
int | readMultipleRegisters (int slaveAddr, int startRef, short regArr[], int refCnt) |
Modbus function 3 (03 hex), Read Holding Registers/Read Multiple Registers. | |
int | readMultipleLongInts (int slaveAddr, int startRef, long int32Arr[], int refCnt) |
Modbus function 3 (03 hex) for 32-bit long int data types, Read Holding Registers/Read Multiple Registers as long int data. | |
int | readMultipleMod10000 (int slaveAddr, int startRef, long int32Arr[], int refCnt) |
Modbus function 3 (03 hex) for 32-bit modulo-10000 long int data types, Read Holding Registers/Read Multiple Registers as modulo-10000 long int data. | |
int | readMultipleFloats (int slaveAddr, int startRef, float float32Arr[], int refCnt) |
Modbus function 3 (03 hex) for 32-bit float data types, Read Holding Registers/Read Multiple Registers as float data. | |
Class 1 Modbus Functions | |
int | readCoils (int slaveAddr, int startRef, int bitArr[], int refCnt) |
Modbus function 1 (01 hex), Read Coil Status/Read Coils. | |
int | readInputDiscretes (int slaveAddr, int startRef, int bitArr[], int refCnt) |
Modbus function 2 (02 hex), Read Inputs Status/Read Input Discretes. | |
int | readInputRegisters (int slaveAddr, int startRef, short regArr[], int refCnt) |
Modbus function 4 (04 hex), Read Input Registers. | |
int | readInputLongInts (int slaveAddr, int startRef, long int32Arr[], int refCnt) |
Modbus function 4 (04 hex) for 32-bit long int data types, Read Input Registers as long int data. | |
int | readInputMod10000 (int slaveAddr, int startRef, long int32Arr[], int refCnt) |
Modbus function 4 (04 hex) for 32-bit modulo-10000 long int data types, Read Input Registers as modulo-10000 long int data. | |
int | readInputFloats (int slaveAddr, int startRef, float float32Arr[], int refCnt) |
Modbus function 4 (04 hex) for 32-bit float data types, Read Input Registers as float data. | |
int | writeCoil (int slaveAddr, int bitAddr, int bitVal) |
Modbus function 5 (05 hex), Force Single Coil/Write Coil. | |
int | writeSingleRegister (int slaveAddr, int regAddr, short regVal) |
Modbus function 6 (06 hex), Preset Single Register/Write Single Register. | |
int | readExceptionStatus (int slaveAddr, unsigned char *statusByte) |
Modbus function 7 (07 hex), Read Exception Status. | |
Class 2 Modbus Functions | |
int | forceMultipleCoils (int slaveAddr, int startRef, const int bitArr[], int refCnt) |
Modbus function 15 (0F hex), Force Multiple Coils. | |
int | maskWriteRegister (int slaveAddr, int regAddr, unsigned short andMask, unsigned short orMask) |
Modbus function 22 (16 hex), Mask Write Register. | |
int | readWriteRegisters (int slaveAddr, int readRef, short readArr[], int readCnt, int writeRef, const short writeArr[], int writeCnt) |
Modbus function 23 (17 hex), Read/Write Registers. | |
Protocol Configuration | |
int | setTimeout (int timeOut) |
Configures time-out. | |
int | getTimeout () |
Returns the time-out value. | |
int | setPollDelay (int pollDelay) |
Configures poll delay. | |
int | getPollDelay () |
Returns the poll delay time. | |
int | setRetryCnt (int retryCnt) |
Configures the automatic retry setting. | |
int | getRetryCnt () |
Returns the automatic retry count. | |
Transmission Statistic Functions | |
unsigned long | getTotalCounter () |
Returns how often a message transfer has been executed. | |
void | resetTotalCounter () |
Resets total message transfer counter. | |
unsigned long | getSuccessCounter () |
Returns how often a message transfer was successful. | |
void | resetSuccessCounter () |
Resets successful message transfer counter. | |
Word Order Configuration | |
void | configureBigEndianInts () |
Configures int data type functions to do a word swap. | |
void | configureSwappedFloats () |
Configures float data type functions to do a word swap. | |
void | configureLittleEndianInts () |
Configures int data type functions not to do a word swap. | |
void | configureIeeeFloats () |
Configures float data type functions not to do a word swap. | |
Public Member Functions | |
virtual | ~MbusMasterFunctions () |
Destructor. | |
virtual int | isOpen () |
Returns whether the protocol is open or not. | |
virtual void | closeProtocol () |
Closes an open protocol including any associated communication resources (com ports or sockets). | |
Static Public Member Functions | |
char * | getPackageVersion () |
Returns the package version number. | |
Protected Member Functions | |
MbusMasterFunctions () | |
Constructs a MbusMasterFunctions object and initialises its data. |
|
Constructs a MbusMasterFunctions object and initialises its data. It also detects the endianess of the machine it's running on and configures byte swapping if necessary. |
|
Destructor. Does clean-up and closes an open protocol including any associated communication resources (serial ports or sockets). |
|
Returns whether the protocol is open or not.
Reimplemented in MbusTcpMasterProtocol, and MbusSerialMasterProtocol. |
Copyright © 2002-2004
FOCUS Software Engineering Pty Ltd, Australia.
All rights reserved.
Please see the Notices page for trademark notices. Last updated: 26 May 2004 |