EZGPIB and TelNet failing - Page 1
Forum section: electronics / testgear

author: DeepLink
author_rank: Regular Contributor
timestamp: August 28, 2024, 01:59:45 pm
content: HiI'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-232Now I also have some equipment only with LAN, which work over TelNetWhen I try to connect to my Keysight 34461A over ethernet, using PuTTY, no problem. The DDM works fine***Welcome to Keysights's 34460A Digital Multimeter34460A> *IDN?Keysight Technologies,34461A,MY60003833,A.03.02-03.15-03.02-00.52-04-0334460A> MEAS:VOLT:DC?+3.24852284E-0534460A>***Trying to connect and ask the 34461A using EZGPIB - it failsProgram 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 Multimeter34460A> *IDN?***Unfortunately the developer is longer among usAnybody had luck with EZGPIB and TelNet?/Hans

author: Kean
author_rank: Unknown
timestamp: August 28, 2024, 03:01:34 pm
content: 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:Function EZGPIB_TelnetConnect(Name:string;IPAddress:string;Port:LongInt):BooleanThe 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: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.

author: DeepLink
author_rank: Regular Contributor
timestamp: August 28, 2024, 06:37:17 pm
content: Tried that, but that won't compileIn EZGPIB's own samples, it is written as my test codeI'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 meAlso I have written many programs now, so it's easy for me to put something togetherI took a look at Python (for something else) a while ago, but it didn't catch me a firstMaybe its time for this old dog to learn some new tricksOr try the Visa approach in EZGPIB

author: edpalmer42
author_rank: Super Contributor
timestamp: August 28, 2024, 07:17:10 pm
content: 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.

author: aeg
author_rank: Regular Contributor
timestamp: August 28, 2024, 10:46:58 pm
content: You're not sending a newline character. Try:Code:EZGPIB_TelNetWrite('192.168.0.76','*IDN?'+#13);

author: DeepLink
author_rank: Regular Contributor
timestamp: August 29, 2024, 01:39:40 pm
content: BINGO - and yet so simpleThank you for being the extra set of eyes