Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib not responding

I have vb6 sp5 and NI PCI-GPIB board

My program:

Private Sub test()

Dim data1 As String

Call ibdev(0, 12, 0, 10, 0, 0, 0)
Call ibwrt(0, "TF\n")
Call ibrd(0, data1)

MsgBox (data1)
End Sub

I give the same command to the IBIC there is no problem
Is anything wrong in my program ?

Thank you for Help
0 Kudos
Message 1 of 7
(4,075 Views)

@TuY wrote:
I have vb6 sp5 and NI PCI-GPIB board

My program:

Private Sub test()

Dim data1 As String

Call ibdev(0, 12, 0, 10, 0, 0, 0)
Call ibwrt(0, "TF\n")
Call ibrd(0, data1)

MsgBox (data1)
End Sub

I give the same command to the IBIC there is no problem
Is anything wrong in my program ?

Thank you for Help




The first parameter of the ibwrt and ibrd calls should not be zero. They should be the return value from ibdev (In VB, this is the last parameter passed to ibdev). Therefore, you need to change the last parameter of ibdev to be a variable and pass the variable as the first parameter of ibwrt and ibrd.
0 Kudos
Message 2 of 7
(4,054 Views)
Hello Gpib Guru,

I tried it but its the same

dim ud as integer
dim data as string

data = space(20)

ibdev(0,12,0,10,0,0,ud)

ibwrt(ud,"TF\n")
ibrd(ud,data)


msgbox(data)


there is nothing in data and NI Spy give me a EABO(6) error
0 Kudos
Message 3 of 7
(4,033 Views)
Can you attach the NI Spy output?
0 Kudos
Message 4 of 7
(4,029 Views)
Try increase the timeout value so the device has more time to respond. Code in IBIC executes slower than VB because you have to type in the commands, this gives the device enough time to send back data.
0 Kudos
Message 5 of 7
(4,021 Views)
Hello Guru,

I tried with a another buttun click to read from device but here are the messages from NI Spy:

with command: ibrd --> 0x8128 EARG(4)
with command: receive --> 0xC164 EABO(6)


there i no problem with ibwrt or send...


THX
Tuy
0 Kudos
Message 6 of 7
(3,984 Views)
hello,

THX everybody...I can communicate with the device


my send string was wrong

send(0,12,"TF",1)
0 Kudos
Message 7 of 7
(3,978 Views)