LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where should I start from to use HP4145B with LabView?

Hi agentnikoli,

 

I'm trying to talk to 4145B using Matlab. As far as finiding, opening and identifying, it's ok. I'm looking for a manual to see how to write and read, specifically changing SMU voltage and currents. Only the general commands like gpib, fprintf and fscanf are available. I'm looking for specific switches to talk to 4145. There is also one more issue that sometimes during fscanf, I get time-out message and it's resolved by connecting and disconnecting the tool. Why is that?

I'll appreciate it if you send me some sample code for talking to 4145 using matlab. anything that shows read/write commands.

Thanks.

 

0 Kudos
Message 11 of 22
(2,129 Views)

Hi Min Yoon,

 

As said by  Smootastic did you try to 'play' with wait function, I experienced same problems with old instrument, there was no problem running in a computer with a GPIB card and experienced communication problem with other PC and other GPIB card due to the speed. I put some wait function and was perfect. Perhaps it can be changed in GPIB parameter too but work good for me coding so I didn't look further.

 

Regards.

Greg S.
CNRS
LV 7.1 8.2 8.6 2009 2011 2012 2013 2014
LPMC - CNRS
N'oubliez pas de complimenter cela fait toujours plaisir.
0 Kudos
Message 12 of 22
(2,114 Views)
hi Greg answered it ... you should give a delay when u issue DO command .I pause for like 5 secs b4 issuing new command .Also make sure ur gpib controller is set to read 
0 Kudos
Message 13 of 22
(2,102 Views)

The main problem is with matlab. I could not yet figure out sending commands other than *iden to the instrument.  fprintf and fscanf have a lot of issues, also I need to know the arguments for these functions. Do you have a manual of communicating with 4541 using matlab? or a sample code?

Thanks a lot in advance.

0 Kudos
Message 14 of 22
(2,099 Views)

Unfortunately as a part of NDA I can't give you sample code.

But try this

 

fprint(serial,'COMMAND');

 

where serial is the serial port you have defined.

 

Also u can search for the HP4145 manual online .I know its avaible online .

Its HP4145A operation and service manual .

 

fscanf(serial,'%s') is the format to be used because after the DO command HP4145 sends out data in string format.

Btw this is not the forum to discuss MATLAB prog (the mods might ban us)

 

Wishing you luck

0 Kudos
Message 15 of 22
(2,091 Views)

Thanks for the help. I don't actually get anythign back from fscanf, always get time-out error message. So, I still don't have access to the commands. the operation manual doesn't help that much, the commands are for ibasic controller and it doesn't have the arguments for printf and scanf. If you know any reference for programming with matlab or higher level languages, I would highly appreciate it if you let me know about it.

 

Sorry everybody for posting this in this forum. I should start a new forum about matlab programming.

 

Thanks!

0 Kudos
Message 16 of 22
(2,084 Views)

Ok so which GPIB controller r u using?

 

Because since u r not getting the data or u r getting ' ' data it means ur gpib is not reading the data

 

Try this give ++read command to gpib and then check

0 Kudos
Message 17 of 22
(2,072 Views)

it's an agilent gpib0 interface. I belive it writes and reads, since i execute iden: fprintf(g, '*IDN?')
>> idn = fscanf(g)

idn =

ID HP4145B 1.1,1.2

 

and it works fine. however, I could not find the list of other acceptable commands other than that, such as 'COMMAND' to see the list, if you mean this.

 

Thanks.

0 Kudos
Message 18 of 22
(2,066 Views)
I think it's time you took this conversation off line or to a different forum. You are not using LabVIEW and aren't even using an NI controller.
0 Kudos
Message 19 of 22
(2,061 Views)

Hi Folks,

 

Here it goes what I have got so far regarding the communication between HP4145b and Agillent GPIB:

 

When I first started using the HP4145b_example.vi that I downloaded from NI I was unable to use it just like Jin aforementioned. To get it working properly all I have done is to change the GPIB VIs by VISA VIs (basically the Write and Read VIs). Doing that I am now able to communicate with HP4145b. Note that all other HP4145b library files MUST be changed accordingly.

 

However, I am still experiencing some issue regarding the reading process. When I run the program I canNOT acquire the data from HP4145b. On the other hand, when I set my Labview program to run on Debug Mode, which runs in such a slow motion way, I acquire the data properly. So, I figured out, as many people around have discussed, that a delay is needed before the Reading in order to have HP4145b communicating properly. HOWEVER, even setting a huge of delay such as over 20 secs I cannot acquire the data.

 

Any idea about how to sort out that problem?

 

Even I used the Status Byte VISA VI in order to get a signal from device before reading its data but this signal never arrives. So I imagine that the issue is around here. Note that Variable Settings, Set Up enviroments and Meas and Disp Settings work properly. The only thing is not working is data acquiring process.

0 Kudos
Message 20 of 22
(1,895 Views)