Beijer Electronics (formerly QSI Corporation)
http://www.qsiforums.com/

set to only one register
http://www.qsiforums.com/viewtopic.php?f=6&t=4443
Page 1 of 1

Author:  ashishnainwal86 [ Tue Feb 28, 2012 4:31 am ]
Post subject:  set to only one register

hi,
I am trying to write only one register using Modbus but is is not happening.
like multiple register (modbuscomm.setmultipleregisters(default, idnum, wrsa + 1, wrqty, wrarray))
is it any function for set only one register?
in above function idnum=id number of instruments
wrsa=address o0f register
wrqty=quantity of registers
wrarray=array of registers.(byte)

Author:  Ron L. [ Tue Feb 28, 2012 9:47 am ]
Post subject:  Re: set to only one register

Yes, you can use the "SetRegister" function of the Modbus Comm or you can use a MBVirtualRegisterV2 object. If you are using the MBVirtualRegisterV2, then make sure the "registerType" is a 16 bit type and change the "value", "intValue" or "strValue" property to set the register.

Code:
MBVirtualRegister_1.intValue = 5


You can also make the object writeOnly.

Code:
'in MBVirtualRegister_1 "Code View"
init writeOnly := true

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/