Setup Example

image\head10.gif VB.NET

Dim Ret, Srlen, Cmd(31) As Integer

Dim Srbuf As String

Cmd(0) = 3  ' Number of talkers and listeners (in master mode)

Cmd(1) = 1  ' Talker address

Cmd(2) = 3  ' Listener address

Cmd(3) = 7  ' Listener address

Srbuf ="*IDN?"  ' Data of Send

Srlen = Len(Srbuf)  ' Length of Data

Ret = GpTalkEx(Cmd, Srlen, Srbuf)

 

image\head10.gif C

DWORD Ret, Srlen, Cmd[31];

BYTE Srbuf[10];

Cmd[0] = 3; /* Number of talkers and listeners (in master mode)*/

Cmd[1] = 1; /* Talker address */

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

Cmd[3] = 7; /* Listener address */

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, Srlen;

uint[] Cmd = new uintd[31];

string Srbuf;

Cmd[0] = 3; /* Number of talkers and listeners (in master mode)*/

Cmd[1] = 1; /* Talker address */

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

Cmd[3] = 7; /* Listener address */

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

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

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

 

image\head10.gif Python

Ret, Srlen, Cmd = ctypes.c_ulong(), ctypes.c_ulong(), (ctypes.c_ulong * 31)()

Srbuf = (ctypes.c_ubyte * 10)()

Cmd[0] = 3 # Number of talkers and listeners (in master mode)

Cmd[1] = 1 # Talker address

Cmd[2] = 3 # Listener address

Cmd[3] = 7 # Listener address

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)