beautypg.com

B&B Electronics MODSCAN32 - Manual User Manual

Page 90

background image

90


CreateModbusData (LONG Address, SHORT Size, SHORT *pData)

The CreateModbusData() method exposes user data for access by a
connected modbus master. The supplied Address and Size parameters
define how the data is to be addessed according to the modbus protocol.
The current value of the NodeAddress property determines which slave
node is associated with the defined data.

Address Range

Data Type


00000-09999

COIL STATUS

10000-19999

INPUT STATUS

30000-39999

INPUT REGISTERS

40000-49999

HOLDING REGISTERS


CreateModbusData() returns a LONG value which identifies the handle to
the specified block of data. This handle should be maintained by the
controlling application to use as an input parameter to the
DeleteModbusData() method or to identify data which may be written
written from the master. The DataHandle is returned as a parameter with
the DataWrittenFromMaster Event.

DeleteModbusData (LONG DataHandle)

The DeleteModbusData() method removes the specified block of data
from the control. The DataHandle parameter must match the value
returned from a previous CreateModbusData method. Normally, blocks of
data would be created during startup, (Form Load), of an application and
deleted during shutdown. A FALSE return value from DeleteModbusData
signifies that the referenced DataHandle was not contained within the
control.

MessageCounter (LONG InterfaceHandle)

The control maintains a counter of message transactions which occur over
each connection. These counters are accessible by the controlling
application via the MessageCounter() method. The control only
increments the counter for a connection whenever a valid data message is
received from a connected master device.