Setup Example

image\head10.gif VB.NET

Dim Ret, SetFlag, Reg, Preg, Cmd(3), Srlen As Integer

Dim Srbuf As String

 

SetFlag = 0 ' Require

Reg = &H8 ' MyAddress

Ret = GpBoardstsEx(SetFlag, Reg, Preg)

Cmd(0) = 2 ' Talker + Listener

Cmd(1) = Preg ' Talker(My Address)

Cmd(2) = 3 ' Listener

Srbuf = "*IDN?" ' Data of Send

Srlen = Len(SrBuf) ' Length of Data

Ret = GpTalkEx(Cmd, Srlen, Srbuf)

 

image\head10.gif C

DWORD Ret, SetFlag, Reg, Preg, Cmd[3], Srlen;

BYTE Srbuf[256];

 

SetFlag = 0; /* Require */

Reg = 0x8; /* MyAddress */

Ret = GpBoardstsEx(SetFlag, Reg, &Preg);

Cmd[0] = 2; /* Talker + Listener */

Cmd[1] = Preg; /* Talker(My Address) */

Cmd[2] = 3; /* Listener */

lstrcpy((char*)Srbuf, "*IDN?"); /* Data of Send */

Srlen = lstrlen((char*)SrBuf); /* Length of Data */

Ret = GpTalkEx(Cmd, &Srlen, Srbuf);

 

image\head10.gif C#

uint Ret, SetFlag, Reg, Preg, Srlen;

uint[] Cmd = new uint[3];

string Srbuf;

 

SetFlag = 0; /* Require */

Reg = 0x8; /* MyAddress */

Ret = gpib.BoardstsEx(SetFlag, Reg, out Preg);

Cmd[0] = 2; /* Talker + Listener */

Cmd[1] = Preg; /* Talker(My Address) */

Cmd[2] = 3; /* Listener */

Srbuf = "*IDN?"; /* Data of Send */

Srlen = Srbuf.Length; /* Length of Data */

Ret = gpib.TalkEx(Cmd, out Srlen, Srbuf);

 

image\head10.gif Python

Ret, SetFlag, Reg, Preg, Cmd, Srlen = ctypes.c_ulong(), ctypes.c_ulong(), ctypes.c_ulong(), ctypes.c_ulong(), (ctypes.c_ulong * 3)(), ctypes.c_ulong()

Srbuf = (ctypes.c_ubyte * 256)()

 

SetFlag.value = 0 # Require

Reg.value = 0x8 # MyAddress

Ret.value = GpibPy.GpBoardstsEx(SetFlag, Reg, ctypes.byref(Preg))

Cmd[0] = 2 # Talker + Listener

Cmd[1] = Preg.value # Talker(My Address)

Cmd[2] = 3 # Listener

Srlen.value = len("*IDN?".encode('UTF-8')) # Length of Data

ctypes.memmove(Srbuf, "*IDN?".encode('UTF-8'), Srlen.value) # Data of Send

Ret.value = GpibPy.GpTalkEx(Cmd, ctypes.byref(Srlen), Srbuf)