02-17-2010 07:25 PM
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.
02-18-2010 01:51 AM
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.
02-18-2010 12:06 PM
02-18-2010 12:23 PM
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.
02-18-2010 01:41 PM
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
02-18-2010 03:06 PM
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!
02-18-2010 04:44 PM
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
02-18-2010 05:24 PM
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.
02-18-2010 06:53 PM
09-22-2010 11:43 AM
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.