GpListenBinary

image\BLTLRGSQ.gifBoards that Support the Function image\SETUP.gif image\SANBTN.gif

 

 

image\head10.gif Operation            Receives data. When receives binary data by VB, use GpListenBinary.

 

image\head10.gif Format                 

(VB.NET)

Dim Srlen, Ret As Integer

Dim Cmd(xxxx) As Integer ' (xxxx specifies the maximum number of command arrays)

Dim Srbuf(xxxx) As Byte ' (xxxx specifies the maximum amount of data)

Ret = GpListen(Cmd, Srlen, Srbuf)

 

(C)

DWORD Srlen, Ret;

DWORD * Cmd;

char * Srbuf;

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

 

(C#)

uint Srlen, Ret;

uint[] Cmd = new uint[xxxx]; /* (xxxx specifies the maximum number of command arrays) */

StringBuilder Srbuf = new StringBuilder(xxxx); /* (xxxx specifies the maximum amount of data) */

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

 

(Python)

Srlen, Ret = ctypes.c_ulong(), ctypes.c_ulong()

Cmd = (ctypes.c_ulong * xxxx)() # (xxxx specifies the maximum number of command arrays)

Srbuf = (ctypes.c_ubyte * xxxx)() # (xxxx specifies the maximum amount of data)

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

 

image\head10.gif Mode                   Master mode/Slave mode

 

image\head10.gif Parameters          Cmd     :   Command array

[0] Number of talkers and listeners ( = Number of listeners+1)

(Slave mode = 0)

[1] Talker address

[2] Listener address

image\CONTINUE.gif

 

Srlen     :    (Input value) Maximum data length in bytes that can be received(Max 1Mbytes)

(Return value) Receive data length in bytes

Srbuf     :     Receive buffer

SrbufB   :     Receive buffer(for binary)

Ret       :     Return value

0       :  Normal completion (Delimiter received)

1       :  Normal completion (Delimiter and EOI received)

2       :  Normal completion (EOI received)

80     :  GpIni() hasn't execute

128   :  Receive data overflow

140   :  Asynchronous function is executing now

240   :  ESC key pressed

242   :  Miss in address specified

243   :  Miss in buffers

252   :  GP-IB error

253   :  There is no receive data.

254   :  Timeout

255   :  Illegal call

(See "Return Values" for details.)

 

image\head10.gif Notes                   1  Receive buffer and receive data length in bytes:

Enter the number of arrays specified for Srbuf in Srlen. The output value in Srlen cannot exceed the input value in Srlen. If data exceeding that length arrives, Srlen (input value) becomes equal to Srlen (output value) and data up to bytes of Srlen (output value) will be put in Srbuf. Consequently, the program may not operate successfully if you enter for Srlen a value greater than the number of arrays in Srbuf.

2  When receive data overflow error(Master mode):
The remainder of the data is follows.
(1) Set cmd(0)=0 and GpListen again.
(2) Repeat (1) until return value (lower byte) turned 0.

3  Command array:
Since the number of commands to be sent is given to Cmd[0], specify 0 for Cmd[0] in slave mode.

4  1 byte data with EOI cannot be received in slave mode.

5  To determine whether the quantity of data is 0 or 1Mbyte, check the termination information (253).

Srlen=0, Ret=0 -->Quantity of receive data=1 MKbyte

Srlen=0, Ret=253 -->Quantity of receive data=0 Kbyte (Only delimiter code is received.)

6  If you have already used DOS-Version, there is no need to execute Dmainuse function when using FIFO.