beautypg.com

B&B Electronics MODSCAN32 - Manual User Manual

Page 84

background image

84

Mobuss OCX Implementation Notes


The following notes present programming details concerning operation of the Modbuss Data Control.

if Update() returns TRUE

guaranteed to get an UpdateFinished Event

NOT guaranteed to get Ready Event.

if Update() returns FALSE

UpdateFinished is NOT fired.

Update() may return FALSE under the following conditions:

DEMO_TIME_EXPIRED

OUT_OF_BUFFERS

OCX_OVERRUN

INVALID_PORT_DESIGNATION

INVALID_SLAVE_ADDRESS

INVALID_DATA_ADDRESS

INVALID_DATA_LENGTH

OCX_HELPER_FAILURE (MbOCXsvr Not Running)

If EnableBlockWrites is FALSE


Setting a data value, (modbuss1.register(0) = 1),

does NOT change the value of the data within the control.


if modbuss1.register(0) = 0 then

modbuss1.register(0) = 1

Text1.Text = modbuss1.register(0)

endif

'Text1.Text will be 0

Setting a data value instructs the control to issue a

write command to the designated slave device.


The data within the control will not be updated until

the next Update() request.


The control will automatically request the Update()

after receiving the write message acknowledgement

from the slave, (regardless of the success indication).