Setup Example

image\head10.gif VB.NET

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

Dim Srbuf As String

 

Reg = &H8 ' Board status(My Address) specification

Ret = GpBoardsts(Reg, Preg)

Cmd(0) = 2 ' Talker + Listener

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

Cmd(2) = 3 ' Listener

Srbuf = "Send Data" ' Send Data

Srlen = Len(SrBuf) ' Length of Data

Ret = GpTalk(Cmd, Srlen, Srbuf)

 

image\head10.gif C

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

CHAR Srbuf[256];

Reg = 0x0; /* Register(Data in) specification */

Ret = GpBoardsts(Reg, &Preg);

 

Reg = 0x8; /* Board status(My Address) specification */

Ret = GpBoardsts(Reg, &Preg);

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

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

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

lstrcpy(Srbuf, "Send Data"); /* Send Data */

Ret = GpTalk(Cmd, Srlen, Srbuf);

 

image\head10.gif C#

uint Ret, Reg, Preg, Srlen;

uint[] Cmd = new uint[3];

string Srbuf;

 

Reg = 0x8; /* Board status(My Address) specification */

Ret = gpib.Boardsts(Reg, out Preg);

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

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

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

Srbuf = "Send Data"; /* Send Data */

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

Ret = gpib.Talk(Cmd, Srlen, Srbuf);

 

image\head10.gif Python

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

Srbuf = (ctypes.c_ubyte * 256)()

Reg.value = 0x0 # Register(Data in) specification

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

 

Reg.value = 0x8 # Board status(My Address) specification

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

Cmd[0] = 2 # Talker + Listener

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

Cmd[2] = 3 # Listener

Srlen.value = len("Send Data".encode('UTF-8')) # Data Length

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

Ret.value = GpibPy.GpTalk(Cmd, Srlen, Srbuf)