Download NAPOPC_CE5 DA Server

Transcript
NAPOPC_CE5 DA Server User’s Manual
MBGetReg_Long
The function can get a register value from a specific modbus address.
Syntax
[eVC++]
unsigned char MBGetReg_Long(unsigned short iMBAddress, long *iStatus,
unsigned char iAttr)
[VB.NET/VC#.NET]
byte MBGetReg_Long(ushort iMBAddress, out int iStatus, byte iAttr)
Parameters
iMBAddress
[in] The modbus address which you want to get from. The range of modbus address is
from 1001 to 20999.
iStatus
[out] The register value of specific modbus address.
iAttr
[in] Assign which kind of register you want get. 1 means input register which will be
requested by modbus function number 4. 0 means output register which will be
requested by modbus function number 3/6/16.
Return Values
0 indicates success. WCA_MBADDR_OVER means the iMBAddress over the range.
The legal range is from number 1001 to number 20999. WCA_MBATTR_ERROR means
the iAttr is neither 1 nor 0.
Remarks
Requirements
Runs on
Versions
Defined in
WinPAC 8000/5000 4.1.0.01 and later Quicker.lib
Example
[eVC++]
//Get input register value from address 1
long iSataus;
MBGetReg_Long(1,&iSatus,1);
Include
WinConAgent.h
[VB.NET]
Dim m_MBGetRegVal As Integer
Quicker.Modbus.MBGetReg_Long(1, m_MBGetRegVal, 1)
[VC#.NET]
int m_MBGetRegVal;
Quicker.Modbus.MBGeReg_Long(1,out m_MBGetRegVal, 1);
Ver: 2.30
Date: Aug-05 2011
Page: 101
Link to