FieldTalk Modbus® Slave Library C++ Editions |
![]() |
To create an application specific Data Provider derive a new class from MbusDataTableInterface and override the required data access methods.
Data Access Methods for Table 4:00000 (Holding Registers) | |
Data Access Methods to support read and write of output registers (holding registers) in table 4:00000. This table is accessed by the following Modbus functions:
| |
virtual int | readHoldingRegistersTable (int startRef, short regArr[], int refCnt) |
Override this method to implement a Data Provider function to read Holding Registers. | |
virtual int | writeHoldingRegistersTable (int startRef, const short regArr[], int refCnt) |
Override this method to implement a Data Provider function to write Holding Registers. | |
Data Access Methods for Table 3:00000 (Input Registers) | |
Data Access Methods to support read of input registers in table 3:00000. This table is accessed by the following Modbus functions:
| |
virtual int | readInputRegistersTable (int startRef, short regArr[], int refCnt) |
Override this method to implement a Data Provider function to read Input Registers. | |
Data Access Methods for Table 0:00000 (Coils) | |
Data Access Methods to support read and write of discrete outputs (coils) in table 0:00000. This table is accessed by the following Modbus functions:
| |
virtual int | readCoilsTable (int startRef, char bitArr[], int refCnt) |
Override this method to implement a Data Provider function to read Coils. | |
virtual int | writeCoilsTable (int startRef, const char bitArr[], int refCnt) |
Override this method to implement a Data Provider function to write Coils. | |
Data Access Methods for Table 1:00000 (Input Discretes) | |
Data Access Methods to support read discrete inputs (input status) in table 1:00000. This table is accessed by the following Modbus functions:
| |
virtual int | readInputDiscretesTable (int startRef, char bitArr[], int refCnt) |
Override this method to implement a Data Provider function to read Coils. | |
Data Access Synchronisation Functions | |
Implementation of these functions may only be required in multithreaded applications, if you are running the server loop in a separate thread and in addition require data consistency over a block of Modbus registers.
Data consistency within a single register is always maintained if the code executes on a 16-bit or 32-bit machine, because the CPU is accessing these data types atomically. | |
virtual void | lock () |
You can override this method to implement a semaphore locking mechanism to synchronise data access. | |
virtual void | unlock () |
You can override this method to implement a semaphore un-locking mechanism to synchronise data access. | |
Auxiliary Functions | |
virtual void | timeOutHandler () |
Override this method to implement a function to handle master poll time-outs. | |
virtual char | readExceptionStatus () |
Override this method to implement a function with reports the eight exception status coils (bits) within the slave device. |
Copyright © 2002-2006
FOCUS Software Engineering Pty Ltd, Australia.
All rights reserved.
Please see the Notices page for trademark notices. Last updated: 20 Oct 2006 |