Author Topic: EZGPIB and TelNet failing  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline DeepLinkTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: dk
EZGPIB and TelNet failing
« on: August 28, 2024, 01:59:45 pm »
Hi

I've been using EZGPIB to control my equipment for a while now.
It works like a charm over GPIB (using a genuine NI USB GPIB adapter) and with simple RS-232

Now I also have some equipment only with LAN, which work over TelNet

When I try to connect to my Keysight 34461A over ethernet, using PuTTY, no problem. The DDM works fine
***
Welcome to Keysights's 34460A Digital Multimeter
34460A> *IDN?
Keysight Technologies,34461A,MY60003833,A.03.02-03.15-03.02-00.52-04-03
34460A> MEAS:VOLT:DC?
+3.24852284E-05
34460A>
***

Trying to connect and ask the 34461A using EZGPIB - it fails

Program pretty simple
***
Program New;

var answer:string;

begin;
  EZGPIB_ScreenClear;
  EZGPIB_TelNetConnect('192.168.0.76',5024);
  EZGPIB_TimeSleep(1);
  EZGPIB_TelNetWrite('192.168.0.76','*IDN?');
  EZGPIB_TimeSleep(1);
  answer:=EZGPIB_TelNetRead('192.168.0.76');
  EZGPIB_ScreenWriteLn(answer);
end.
***

The DMM goes into remote, but only replies my request:
***
Welcome to Keysights's 34460A Digital Multimeter
34460A> *IDN?
***

Unfortunately the developer is longer among us

Anybody had luck with EZGPIB and TelNet?

/Hans
 

Offline Kean

  • Supporter
  • ****
  • Posts: 2305
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: EZGPIB and TelNet failing
« Reply #1 on: August 28, 2024, 03:01:34 pm »
I'm not familiar with EZGPIB, but I took a quick look at the manual for it that is hosted at the xdevs site (dated 20121217).

I see an immediate syntax error in your sample code, you are missing a parameter when calling EZGPIB_TelnetConnect().

It is defined as:
Code: [Select]
Function EZGPIB_TelnetConnect(Name:string;IPAddress:string;Port:LongInt):Boolean
The first parameter should be a name of the device (I believe this is something you nominate, e.g. "DMM1"), and that is what you then pass as the parameter to TelnetRead() or TelnetWrite() instead of the IP address.

So, something like:
Code: [Select]
Program New;

var answer:string;

begin;
  EZGPIB_ScreenClear;
  EZGPIB_TelNetConnect('DMM1','192.168.0.76',5024);
  EZGPIB_TimeSleep(1);
  EZGPIB_TelNetWrite('DMM1','*IDN?');
  EZGPIB_TimeSleep(1);
  answer:=EZGPIB_TelNetRead('DMM1');
  EZGPIB_ScreenWriteLn(answer);
end.

Give that a go and see if it works.

Honestly, you might want to try moving to Python going forward considering EZGPIB is no longer supported.  There are a few topics here about how to use Python, with or without pyvisa.
 

Offline DeepLinkTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: dk
Re: EZGPIB and TelNet failing
« Reply #2 on: August 28, 2024, 06:37:17 pm »
Tried that, but that won't compile  :(
In EZGPIB's own samples, it is written as my test code

I've been looking for a more modern alternative, but I'm an old fart, who grew up with Basic and later Pascal, so EZGPIB was perfect for me
Also I have written many programs now, so it's easy for me to put something together

I took a look at Python (for something else) a while ago, but it didn't catch me a first
Maybe its time for this old dog to learn some new tricks
Or try the Visa approach in EZGPIB
 
The following users thanked this post: Kean

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 2332
  • Country: ca
Re: EZGPIB and TelNet failing
« Reply #3 on: August 28, 2024, 07:17:10 pm »
I've found multiple instances where EZGPIB's documentation and the sample programs don't agree.  The documentation often shows semicolons between parameters but it doesn't work until I change them to commas.  This applies to both built-in and EZGPIB functions.  Maybe in this case, you have to use semicolons rather than the commas shown in the samples.  :-//
 

Offline aeg

  • Regular Contributor
  • *
  • Posts: 112
  • Country: us
Re: EZGPIB and TelNet failing
« Reply #4 on: August 28, 2024, 10:46:58 pm »
You're not sending a newline character. Try:

Code: [Select]
EZGPIB_TelNetWrite('192.168.0.76','*IDN?'+#13);
 
The following users thanked this post: Kean

Offline DeepLinkTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: dk
Re: EZGPIB and TelNet failing
« Reply #5 on: August 29, 2024, 01:39:40 pm »
BINGO - and yet so simple

Thank you for being the extra set of eyes
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf