Instruction Manual

59
OLE Automation
ModSim32 supports two OLE Automation functions which may be used to customize it’s operation for
automated testing applications. Using Visual Basic or similar Windows OLE Automation Client, the user
can access and modify modbus data points defined within a ModSim32 document.
OLE Automation Routines
short ReadValue (short NodeAddress, long PointAddress, short *pValue)
Arguments:
Node Address - refers to slave address associated with a ModSim32 document.
PointAddress - Specifies the address of the data point to be read,
(in modbus master (5 digit) format)
coil status addresses: 00000-09999
input status addresses: 10000-19999
input register addresses: 30000-39999
holding register addresses: 40000-49999
*pValue - is a pointer to a value to be returned.
Return Value:
Status - indicates whether or not the operation was completed successfully
Notes:
Status will be MBUS_OK, (0), if the data point was successfully read, otherwise, a non-zero value
indicates that the value could not be located.
Short WriteValue (short NodeAddress, long PointAddress, short Value)
Arguments:
Node Address - refers to slave address associated with a ModSim32 document.
PointAddress - Specifies the address of the data point to be read,
Value - is the data to be written.
Return Value:
Status - indicates whether or not the operation was completed successfully
Notes:
Status will be MBUS_OK, (0), if the data point was successfully written, otherwise non-zero.