LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where should I start from to use HP4145B with LabView?

I am not familiar with LabView, but I have to set up LabView to make it work with HP4145B.
 
I downloaded the driver from NI, placed it at the correct directory, and can see VI's in function palette.
 
Also, when I run MAX, it shows "Instrument 0" under GPIB0.
 
When I click on "Scan for Instrument", it says something about IDN query, but now I know HP4145B is too old to understand IDN query.
 
I saw a lot of posts that say they can write to the instrument but cannot read.
 
However, I don't even know how to test whether my labview can write to 4145B or not.
 
My questions are....
 
 
1. 4145B manual says it has "ID"  code.
I tried testing it by using "Interactive Control"
And I got this by NI Spy
 
1.  ibsic(GPIB0)
Process ID: 0x00000C1C         Thread ID: 0x00000EB4
Start Time: 15:23:22.485       Duration 00:00:00.000
ibsta: 0x160       iberr: 0             ibcntl: 0(0x0)
2.  ibsre(GPIB0, 1)
Process ID: 0x00000C1C         Thread ID: 0x00000EB4
Start Time: 15:23:26.070       Duration 00:00:00.000
ibsta: 0x160       iberr: 1             ibcntl: 0(0x0)
3.  ibcmd(GPIB0, "@?1", 3 (0x3))
Process ID: 0x00000C1C         Thread ID: 0x00000EB4
Start Time: 15:24:18.606       Duration 00:00:00.000
ibsta: 0x178       iberr: 0             ibcntl: 3(0x3)
4.  ibwrt(GPIB0, "ID", 2 (0x2))
Process ID: 0x00000C1C         Thread ID: 0x00000EB4
Start Time: 15:24:30.242       Duration 00:00:00.010
ibsta: 0x168       iberr: 0             ibcntl: 2(0x2)
5.  ibcmd(GPIB0, "? Q", 3 (0x3))
Process ID: 0x00000C1C         Thread ID: 0x00000EB4
Start Time: 15:25:12.333       Duration 00:00:00.010
ibsta: 0x174       iberr: 0             ibcntl: 3(0x3)
> 6.  ibrd(GPIB0, "", 20 (0x14))
> Process ID: 0x00000C1C         Thread ID: 0x00000EB4
> Start Time: 15:25:23.289       Duration 00:00:16.784
> ibsta: 0xc164       iberr: 6             ibcntl: 0(0x0)
 
There are four LED's on the front panel of HP4145B.
It shows status of HP4145B whether it is talker or listener.
LED changes properly to my command. (So I don't think there is any problem with harware connection)
But, I still get nothing but EABO error when I want to read something.
What am I doing wrong?
How can I test "ID" code?
(I do not have ultra-fast typing speed so I think I gave 4145 enough time to respond before I typed new command)
 
 
2. I tried to use driver I downloaded from NI.
Other posts say that people used "HP 4145 Example.vi" for testing.
However when I put "HP 4145 Example.vi" on the block diagram, I cannot run it.
How do I test with "HP 4145 Examble.vi"?
 
 
3. I tried testing other vi's such as "HP 4145 source setup.vi".
I put that vi on the block diagram window, added constant of 17 to GPIB address,
and other constants to other inputs and run it.
A new window popped up, so I ran it again.
However it does not seem to work since I see no change when I go into source set up menu directly from HP4145 front panel.
Again, LED indicator changes to LTN(which means HP4145B is in listener mode) when I run vi.
What would be the problem?
 
 
I'm experiencing a lot of trouble with this HP4145B, and I know too little to solve this by myself.
Somebody please help me with this.
Thanks in advance.
0 Kudos
Message 1 of 22
(6,618 Views)
Hi Min Yoon,

You can run the HP 4145 Example.vi by opening up directly in LabVIEW. You can find the example by going to Help > Find Examples > Hardware Input and Output > Instrument Drivers > HP 4145.

Let us know if that works for you.
Rasheel
0 Kudos
Message 2 of 22
(6,595 Views)
Thanks to you, now I know how to execute HP4145 example.vi.
However it still does not bring any change.
I opened the vi, executed, and clicked on "Channel Definition Page".
A new panel pops up, so I changed the setting, and clicked on execute again, and clicked on the button next to execute to return to the original window.
I did bunch of other setting too and clicked on Take Measurement, and nothing happens.
So I clicked on STOP button to exit and checked HP4145B whether any change has been made.
Nothing is changed.
 
On MAX, I tried default setting and modified setting - which uses 1 msec for parallel poll duration and 2 usec for bus timing.
None of them worked.
For HP4145B side, I use address 17, with EOI.
There is on setting I don't understand - which says on the manual of 4145B that "Bit switch 6 (Data Form Bit) determines the output data delimiter. When the bit switch is set to 0, the delimiter is a comma(,); when set to 1, the delimiter is a carriage return and line feed(CR/LF).
I also tried both, and still it does not work.
 
If I manually control HP4145B, it works fine.
Also, as I mentioned before, LED's indicating GPIB communication respond to my command.
 
Still, I can't figure out how I can ever 'write' to HP4145B.
I would greatly appreciate for your advice.
0 Kudos
Message 3 of 22
(6,564 Views)
Hi Min Yoon,

Do you know what the GPIB address of the instrument is? Are there any error messages that come up when you try and communicate with the device?
Rasheel
0 Kudos
Message 4 of 22
(6,541 Views)

My 4145b uses address 17.

I checked switch setting on the backpanel of 4145b and CRT on the front panel says "HPIB(17, COMMA, EOI)". Also, when I change address to 16 and execute vi file, it gives me an error message of "HP 4145 Define Channel; HP 4145 Send Message"

When I change back to 17 and execute, error message disappears(and no more error message comes in when I send command to 4145b), but nothing happens on 4145b.

As I said eariler, LEDs on 4145b seems to be saying that 4145b understands basic command such as "change to listener" or "change to talker".

In addition, when I try to read from 4145b from "HP4145 example.vi", for example by clicking on "Display Graphics and Plot" and execute, I get error message "HP 4145 Take Measurement; Wait for Interrrupt (GPIB)". However, reading is not the problem to think right now because I don't even know how to read.

 

I have Newport 1830-C with me, and I checked this instrument with same GPIB-USB-HS and same PC I am using with HP4145b.

It works with 1830C. Therefore, it doesn't look like there is something wrong with  my PC and GPIB-USB-HS.

Anyway, thank you for your attention.



메시지가 06-25-2008 01:28 AM에 Min Yoon에 의해 편집되었음

메시지가 06-25-2008 01:36 AM에 Min Yoon에 의해 편집되었음
0 Kudos
Message 5 of 22
(6,524 Views)
Hi Min Yoon,

Unfortunately I have never worked with this device before. I would recommend that you contact HP to see if they can help you further with this. Let us know how it goes!
Rasheel
0 Kudos
Message 6 of 22
(6,379 Views)

Hi Rasheel

 

You mentioned in your reply that  an example for how to drive HP 4145 can be found at "Help > Find Examples > Hardware Input and Output > Instrument Drivers > HP 4145". However, i can do find "instrument Drivers" under "hardware input and output". I am using Labview 7.1. Is this because the older version does not have it or something else?

 

Thank you very much!

 

Jin

0 Kudos
Message 7 of 22
(6,248 Views)
In order to see the example in the example finder, you need to have LabVIEW 8.x and have installed the project type driver. You have neither. There is usually an example in the driver llb. Did you look there?
0 Kudos
Message 8 of 22
(6,246 Views)

Hi folks I am using MATLAB to control the HP4145 via GPIB interface 

Now , i am able to successfully communicate with the instrument and get the data back when I have keeping VGS constant.

 

If I am setting Vgs as VAR2 , then I am getting problems in taking the readings and nothing given back to the PC from the output buffer of the instrument.

 

Has anyone encountered the same problem ?  

0 Kudos
Message 9 of 22
(5,546 Views)

Hi agentnikoli,

 

You may be better off asking the MATLAB folks if they've experienced this issue.

 

When you say "I am setting Vgs as VAR2", do you mean that instead of keeping it constant, you're changing the value?  I wonder if you maybe added some wait functions to slow down the communication if it would help.

0 Kudos
Message 10 of 22
(5,496 Views)