Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication with HP4142B

Hello

I'm trying to write Matlab code to measure s-parameters at certain bias points. The code for the vna is completely finished and I can read all the data I need to. Now I also wanted to controll the HP4142B (a parameter analyzer) with Matlab to be able to set different bias points for the s-parameter sweeps.

It turns out, that I'm not able to communicate with the HP4142B, no mater what I try. I have the command reference book from the HP4142, but can't get the HP4142B to work. To eliminate the possibility that it doesn't work I attached it to an old 486 machine with NPTS (an old measurement and controll software) and set the new Pc with the NI PCI-GPIB+ card up as an analyzer. It appears that the old dos program can measure and read perfectly from the HP4142B.
When I try using the same commands as NPTS uses - nothing happens. I noticed, that the control sequences are slitely different, but can't change them to be the same as from the old NPTS machine.
What am I doing wrong? Why isn't the HP4142B responding? Is there a possibility to controll the HP4142B from Matlab?

Comamnds used below:
CN6   -   enables module 6 in the HP4142B
DI6     -   forces output current from module 6 with the output range set to AUTO and the current set tp 10mA. The compliance Voltage is set to 777mV
TV6    -   trigger command for high speed spot voltage measurement on channel 6 with the measurement range set to AUTO
All the commands can be found:    http://www.home.agilent.com/upload/cmc_upload/All/42B90110.pdf

Here's the analyzer data:

Working data from the HP4142 controlled with NPTS on a 486
 M        Timestamp      Data
      mi  s  ms  us  ns

       0  0   0   0  50  UNL ATN^   REN^    TA0  LA25
       0  0   0 127 850  ATNv
       0  0   0  18 700  C N 6 . . END  EOI^
       0  0   0 581 350  EOIv   ATN^
       0  0   0  41 400  UNT  UNL  UNT  UNL  SPE  TA25  LA0
       0  0  57 561 200  ATNv
       0  0   0  15 100  .
       0  0   0 106 350  ATN^
       0  0   0  61 200  SPD  UNT  UNL  UNL  TA0  LA25
       0  0   1 345 650  ATNv
       0  0   0  75 800  D I 6 , 0 ,   2 . 0 0 0 0 0 0 0 9 4 9 9 4 9 0 E - 0 0
       0  0   0 913 250  0 3 ,   7 . 7 7 0 0 0 0 1 0 0 1 3 5 8 0 E - 0 0 0 1 .
       0  0   0 760 350  . END  EOI^
       0  0   0 197 500  EOIv   ATN^
       0  0   0  45 600  UNT  UNL  UNT  UNL  SPE  TA25  LA0
       0  0  57 658 650  ATNv
       0  0   0  15 600  .
       0  0   0 107 550  ATN^
       0  0   0  59 500  SPD  UNT  UNL  UNL  LA25  TA0  GTL  UNT  UNL  UNL
       0  0   2 558 650  TA0  LA25
       0  0   0 126 250  ATNv
       0  0   0  21 850  T V 6 , 0 . . END  EOI^
       0  0   0 632 550  EOIv   ATN^
       0  0   0  41 250  UNT  UNL  UNT  UNL  SPE  TA25  LA0
       0  0  57 565 200  ATNv
       0  0   0  15 100  .
      
0  0   0 108 100  ATN^
       0  0   0  61   0  SPD  UNT  UNL  UNL  TA25  LA0
       0  0   0 496 500  ATNv
       0  0   0 159   0  N F V + 0 . 0 2 0 6 0 E + 0 0 . .
END  EOI^
       0  0   1  90 100  EOIv   ATN^
       0  0   0  64 800  UNT  UNL  UNL  LA25  TA0  GTL  UNT  UNL



Data entered with NI-488.2 Communicator from the new Pc with the NI PCI-GPIB+ card
without getting any response from the HP4142B

 M        Timestamp           Data
      mi  s  ms  us  ns

       0  0   0   0  50  ATN^   REN^
       0  0   0  11 400  TA3  UNL  LA25
       0  0   0  52 750  ATNv
       0  0   0   7 600  C N 6 END  EOI^
       0  0 993 337 650  EOIv   ATN^
       0  0   0  10 750  UNL  LA3  TA25
       0  0   0  53 400  ATNv
       0 19 318 787 700  ATN^
       0  0   0  10 800  TA3  UNL  LA25
       0  0   0  53 250  ATNv
       0  0   0  42   0  D I 6 , 0 ,   9 . 9 9 9 9 9 9 7 7 6 4 8 2 5 8 E - 0 0
       0  0   1  10 400  0 3 ,   5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E - 0 0 0
       0  0   0 703 750  1 END  EOI^
       0  1 297 442 250  EOIv   ATN^
       0  0   0  11 550  UNL  LA3  TA25
       0  0   0  54 150  ATNv
       0 21 648 452 700  ATN^
       0  0   0  11 950  TA3  UNL  LA25
       0  0   0  53 900  ATNv
       0  0   0   7 600  T V 6 , 0 END  EOI^
       0  0 812 566 300  EOIv   ATN^
       0  0   0  11 550  UNL  LA3  TA25
       0  0   0  49 750  ATNv

0 Kudos
Message 1 of 9
(3,994 Views)
This is probably the wrong place to ask people how to do things with Matlab.

Since this is a Labview forum- there are Labview drivers available for the 4155, which is almost this instrument but with a front panel.
0 Kudos
Message 2 of 9
(3,968 Views)
I don't have any idea how to communicate with GPIB from Matlab, but I could tell a couple things from the analyzer captures you provided.  First, your working application is using a different termination method.  It looks like it is probably adding a carriage return and a line feed, before asserting EOI.

I can not tell exactly what it is, since I can't tell the value of non-displayable bytes in the abbreviated analyzer view.  NI-488.2 only supports a single termination character, so probably the easiest thing to do is just add the \r\n sequence to your command strings.

The second difference is that the old program performs serial polls after each command, while your new one does not.  Once again, I cannot tell how the instrument is responding from the abbreviated analyzer capture you provided, but the instrument could require that serial poll to take place.  I am not familiar with the exact workings of this instrument, so it may or may not actually be important.

I would recommend that you make your string termination match the old application, and see where that gets you.

-tuba
0 Kudos
Message 3 of 9
(3,914 Views)
hello tuba. thank's alot.
I will have a look into both aspects. I realized that this isn't the perfekt place to ask about realizing code in matlab. Even more do I appreciate your help!

Best regards,
treas
0 Kudos
Message 4 of 9
(3,910 Views)

Hello Tube,

 

I am trying to write labview program for hp4142b and I wish if you could help me to get the drivers for that.

 

Thank you,

 

Pratik

 

0 Kudos
Message 5 of 9
(3,233 Views)

Old thread and as you learned in the other thread you posted to, there are no drivers available for the 4142. You will just have to write your own or modify the 4155 driver as mentioned above.

0 Kudos
Message 6 of 9
(3,208 Views)

Thanks.

 

Wish me luck.

0 Kudos
Message 7 of 9
(3,194 Views)

Oh I forgot to ask one thing.

Which is the best to start with, if I am modifying the code: HP 4145b, HP 4156b, or HP 4155?

 

Thanks.

0 Kudos
Message 8 of 9
(3,192 Views)

Personally, I have no idea. You might want to review the programming manuals for all of them. Agilent tech support may be able to help but as the 4142 is obsolete (and perhaps some of the others), there help may be limited. Reviewing the driver code would also be a good idea.

0 Kudos
Message 9 of 9
(3,185 Views)