Author Topic: Would some kind soul post a sample EZGPIB program  (Read 2162 times)

0 Members and 1 Guest are viewing this topic.

Offline rob.mandersonTopic starter

  • Regular Contributor
  • *
  • Posts: 100
  • Country: us
Would some kind soul post a sample EZGPIB program
« on: August 20, 2018, 12:41:09 am »
that logs multiple readings from an HP 3456?  Just logging to the console window will be fine.

The further I get into my GPIB code the more confusing it gets.  I can see the individual bytes go by on the GPIB Analyser and sometimes they appear on the USB data stream.  So it's obviously something in my code but since I'm never quite sure exactly what EZGPIB is doing it makes sense to me to ask for a sample that someone else knows works correctly within that environment.

How embarassing!  :-DD  I do .NET code for a living!
 

Offline guido

  • Regular Contributor
  • *
  • Posts: 207
  • Country: nl
Re: Would some kind soul post a sample EZGPIB program
« Reply #1 on: August 21, 2018, 10:27:09 pm »
Hi,

I am using this with a Prologix USB adapter:

Code: [Select]
Program HP3456A;
   
Const Device  = 6;                                                              // GPIB address
         Timeout = 5;                                                             // timeout
         
Var   Answer:string;                                                           
             
begin;                                                                                // main   
  EZGPIB_BusEnableEoi;                                                     // enable EOI
  EZGPIB_BusSetEos(0);                                                     // Append CR+LF to instrument commands; MODE 4
  EZGPIB_ScreenClear;

  repeat
    EZGPIB_BusWaitForData(Device,Answer,Timeout);          // Wait for data
    EZGPIB_ScreenWriteLn(Answer);                                   // Write data to screen
  until ezgpib_kbdKeyPressed;
 
  EZGPIB_ScreenWriteLn('End');       
end.

Warning, i do not write code for a living  :)
 
The following users thanked this post: rob.manderson

Offline rob.mandersonTopic starter

  • Regular Contributor
  • *
  • Posts: 100
  • Country: us
Re: Would some kind soul post a sample EZGPIB program
« Reply #2 on: August 21, 2018, 11:42:55 pm »
Thanks.  Now I'll have something that lets me blame my own code!  :-DD
 

Online edpalmer42

  • Super Contributor
  • ***
  • Posts: 2269
  • Country: ca
Re: Would some kind soul post a sample EZGPIB program
« Reply #3 on: August 21, 2018, 11:56:07 pm »
Were the HP3457 example files no help?

Ed
 

Offline rob.mandersonTopic starter

  • Regular Contributor
  • *
  • Posts: 100
  • Country: us
Re: Would some kind soul post a sample EZGPIB program
« Reply #4 on: August 22, 2018, 01:09:15 am »
I gave them a try but the command language to the meter itself is quite different so it was difficult to figure out what was being sent to trigger a reply.  Though now you say it I wonder I didn't think to download a manual and actually (gasp) read it to see what means what to the 3457.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Would some kind soul post a sample EZGPIB program
« Reply #5 on: August 22, 2018, 05:53:05 am »
What GPIB adapter do you have?
 

Offline rob.mandersonTopic starter

  • Regular Contributor
  • *
  • Posts: 100
  • Country: us
Re: Would some kind soul post a sample EZGPIB program
« Reply #6 on: August 22, 2018, 12:48:27 pm »
Home developed - based on Emanuelle Girlando's code but with extensions (control of buffer chips etc).  Hence the confusion.  Is the problem in my extensions, or in the base code, or something else.  The plan, once it's working as a basic controller, is to add spoll functionality etc.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf