LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Basic works/Labview not !

I tried to communicate with GPIB-device with the Labview6.1 build in Functions GPIBwrt and I couldnt get a result. The device didn't answer!

This Code works with Visual Basic 4.0 16 Bit:
magctrl% = DLLibfind(mgctrl$, ibsta%, iberr%, ibcntl&)
Call IBWrt(magctrl%, Chr$(8))

where

Sub IBWrt(ByVal address%, ByRef word$)
Dim dummy%, länge%
länge% = Len(word$)
dummy% = DLLibwrt(address%, word$, länge%, ibsta%, iberr%, ibcntl&)
End Sub

Declare Function DLLibfind Lib "gpib.dll" (ByVal udname$, ibsta%, iberr%, ibcntl&) As Integer

Declare Function DLLibwrt Lib "gpib.dll" (ByVal ud%, ByVal wrt$, ByVal cnt&, ibsta%, iberr%, ibcntl&) As Integer

Why??????
0 Kudos
Message 1 of 5
(2,669 Views)
How id you Configure your GPIB Write in LAbView? Can you post an example.

If you are trying to use exact format of VB strings. This will not work. Please elaborate on what you are doing. Besides in LAbview you can wire and error handler to check what errors you are getting.

Regards,

Mache
Good Luck!

Mache
0 Kudos
Message 2 of 5
(2,669 Views)
O.K.
I made same more tests.
1. I used test2.vi to try the labview6.1 gpib-functions. this didn't work and produced the LV32bit-standard.spy file.(No Error occurd in Error handler!)

2. I tried to include the gpib-32.dll. (test.vi and ibwrt.vi) this didn't work and produced LV32bit-dll-included.spy

Then the Visual Basic 4.0 16Bit Example works:

3. The code is in VB.txt and the results in VB16bit.spy

If you compare LV32bit-dll-included.spy
and VB16bit.spy you'll see, tthat's exactly the same !!

So what are I'm trying to do is following:
Communication with an OXFORD Power Supply Controller OX2 ODX over an Rs232-IEE488 Converter (GPV24) from WILDER ELECTRONIC LTD.


Thanks for help!!
Christian
0 Kudos
Message 3 of 5
(2,669 Views)
I'm not quite clear on what problem you're having. I ran your test.vi and it worked fine on my computer. I used it to write the string "*idn?" to my instrument. Then I used the LabVIEW->GPIB example VI to read back from the instrument and everything worked fine. I'm not sure why you used test.vi to write twice to the instrument, but it seemed to work fine too.

I would suggest trying the GPIB or VISA VIs that come with LabVIEW. Have you tried running the LabVIEW GPIB example programs to see if they work? Try that and let me know if you see the same problems.
J.R. Allen
0 Kudos
Message 4 of 5
(2,669 Views)
That's exactly the problem:
Your instrument is not mine!
It seems that there are instruments that only work with the 16bit version of gpib.dll !
I've got lots of other instruments and the work fine. But this one does not (RS232-IEEE bridge; GPV24, WILDERN ELECTR.)
0 Kudos
Message 5 of 5
(2,669 Views)