110,537
社区成员
发帖
与我相关
我的任务
分享
//读输入寄存器
DWORD __stdcall ZMB_ReadInputReg( HANDLE hand,
BYTE serID,
int nStart,
int nCount,
WORD * bRet/*arr of reg*/,
WORD TranID);
//读输入寄存器,读AI
[DllImport("ZModbusSdk.dll")]
static extern UInt32 ZMB_ReadInputReg(UInt32 hand,
byte serID,
int nStart,
int nCount,
ref short bRet,
ushort TranID);
short tem = 0;
ZMB_ReadInputReg(hand, 3, 0x40, 1, ref tem, 0)
ZMB_ReadInputReg(m_hEthMaster,3,0x40,1,&temp,0);
//读输入寄存器,读AI
[DllImport("ZModbusSdk.dll")]
static extern UInt32 ZMB_ReadInputReg(UInt32 hand,
byte serID,
int nStart,
int nCount,
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 这里初始化大小)]
ref short[] bRet,
ushort TranID);
//读输入寄存器,读AI
[DllImport("ZModbusSdk.dll")]
static extern UInt32 ZMB_ReadInputReg(UInt32 hand,
byte serID,
int nStart,
int nCount,
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 这里初始化大小)]
ref short bRet,
ushort TranID);
//读输入寄存器,读AI
[DllImport("ZModbusSdk.dll")]
static extern UInt32 ZMB_ReadInputReg(UInt32 hand, byte serID, int nStart, int nCount, ref short bRet, short TranID);