EEVblog Electronics Community Forum

Electronics => Repair => Topic started by: Tantratron on December 19, 2019, 04:52:40 am

Title: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 19, 2019, 04:52:40 am
After many trials and problems, I've finally made successful preliminary connection between my Macintosh (MacBook Air with OS 10.12.6), one National Instruments GPIB-USB-HS interface and the NI software suite.

For those who are owners of Macintosh and might be interested, see attached some screenshots where I either use the NI-Terminal mode (not practical) and the VISA Interactive Control (much practical).

So far I've only got the *IND? query to work, later my hope is to learn how to do for example NVRAM dumping and other applications.

I did loose lot of time initially where GPIB0 should be the GPIB-USB-HS declaration via the NI-MAX software but it is important to apply another GPIB number ID inside the TDS540C, in my case I did choose GPIB2 otherwise there will be communication errors.

How could you teach me what are the exact chain of GIPB commands to access the internal flags of different options (1M 2M 2F...) address, values then upload the new flags to enable options like 2M or 2F through VISA Interactive Control software.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on December 19, 2019, 03:44:46 pm
source-code  and   tekfwtool.exe for using (run only with NI-VISA  and Windows)
https://stackframe.org/tekfwtool/

how using of tekfwtool or tektool   (Link show only tektool, but tekfwtool is newer and use same commando)
https://web.archive.org/web/20131212025232/https://stackframe.org/tektool.shtml
(pleas don't write  0x0100 0000, it can make it to a brick) 
But again,  dont programm and flashing  0x0100 000 adress.   NVSRAm Adress is 0x0400 0000 (archivied link explain you, how use it.)


But you use  MAC, this is a problem. You must make executable file from tekfwtool.c or take a  computer with windows
(It runs with win 7 and win98SE)

Regards
matt
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 20, 2019, 08:15:38 am
For the moment, I'd like to first try a simple task to enable some options (2M, 1F) which are stored on ??? via the Macintosh Visa-GPIB utility.

From viewing different threads, unless I'm wrong it seems based on this step by step process:

However do you know a meta-GPIB command to read some address (what is opposite of ATPUT commandand know what are the specific address for TDS540C to switch the bit...

It would help to have a database or thread listing the main option address versus TDS500-700 serie, what option...

Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on December 20, 2019, 09:24:32 am
You can checking option. Press  "shift" and then "help(status)" . you see "banner" below at display. Press pleas display-Button to" banner".

Honestly, i don't know read commando. I haven't trying  hacking with pitbull-tricks, but i know, this tricks is not fake.

Tekfwtool is much besser for dumping of NVSRAM.
But i cannot give tip for make of executable tekfwtool for MAC.



BTW: 1F Option is Floppy-Disc,  i think, you mean 2F (advanced mathematics)

Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 20, 2019, 09:48:57 am
Oups... yes I've meant 2F to do FFT and so

Thanks for confirming the PITBULL trick is real where now let's hope some other EEVblog members have reversed engineer the precise address where these options (2F, 2M) are stored for this TDS540C or best for other TDS series.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 21, 2019, 03:30:45 pm
I confirm that typing "PASSWORD PITBULL",  followed by "WORDCONSTANT:ATPUT 327689,1", up the GPIB connector, with the cal-switch enabled, will enable the 2F maths option on a TDS540C. This was done from my Macintosh computer connected to NI-GPIB-USB with VISA Interactive Control of NI.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 22, 2019, 11:22:28 am
On a side note, it seems from VISA interface typing "WORDCONSTANT:ATPUT 327689,1" is the equivalent of "libManagerWordAtPut(0x50009, 1)" to write. It worked fine with my two TDS540C where now I've enabled the 2F option hence using FFT for free.

Does anywone knows what are the VISA or GPIB command equivalent to "libManagerWordAt()" to read a give address, for example reading the value stored at 327689 address ?

As a reference, I did find this partially from https://forum.tek.com/viewtopic.php?t=138100#p279044 (https://forum.tek.com/viewtopic.php?t=138100#p279044), in particular this extract

Another question, what is stored or what option is stored specifically at "0x5000B" so in decimal at 327691 address ?
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on December 23, 2019, 03:40:26 pm
For those of you using Macintosh, another command *OPT? which will report all the installed options. In this case, it shows indeed my TDS540C has option 13 (RS232-Centronics), Floppy drive (1F), 1M memory option and 2F math option.

Upon inspecting the queried format (look between each comas), there seems to be a total of 12 options on TDS500-700 serie C which I think start from address 0x50000 (decimal from address 327680).
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: analogRF on December 31, 2019, 08:11:47 pm
does the tekfwtool work with agilent 82357A GPIB-USB on windows 7?

Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 06:22:53 am
does the tekfwtool work with agilent 82357A GPIB-USB on windows 7?

If someone leaving near Toulouse (France) owns a agilent 82357A or 82357B interface, I'd be interested to try it with my Macintosh and my TDS540C.

What is certain, the NI GPIB-USB seems to be best technical choice (covering most change) but more expensive so if Agilent works, I'm interested to purchase one if price OK
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on January 01, 2020, 06:23:58 am
I haven't checking, but  few people (inlc. autor of tekfwtool.exe) tell: It works only with NI-VISA.

But of coruse, i am glad, if it works with agilent.  But it must be make from c-sorucefile.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 06:29:11 am
I'd like to compile the C files of tekfwtool on my Macintosh, for the moment I've only found this archive https://stackframe.org/tekfwtool/ but dates are 2013.

Does anybody has the complete C files, H files and MAKE file of more recent date, where can we find the most recent files of tekfwtool so I'll compile them on my Macintosh ?
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on January 01, 2020, 06:35:10 am
file from 2013 is  actual.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 06:45:44 am
file from 2013 is  actual.

It would be nice to have the author of tekfwtool to comment or help... there are different versions if you look https://stackframe.org/tekfwtool/ (https://stackframe.org/tekfwtool/) then https://stackframe.org/tekfwtool/tekfwtool.c (https://stackframe.org/tekfwtool/tekfwtool.c) whereas this other archive is slightly different https://web.archive.org/web/20131212025232/https://stackframe.org/tektool.shtml (https://web.archive.org/web/20131212025232/https://stackframe.org/tektool.shtml) then https://web.archive.org/web/20130403195440/http://stackframe.org/tektool.c (https://web.archive.org/web/20130403195440/http://stackframe.org/tektool.c)

On a side, it seems required also the C file https://stackframe.org/tekfwtool/target.c (https://stackframe.org/tekfwtool/target.c)
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on January 01, 2020, 07:09:49 am
tekfwtool and tektool is not same.   tektool supports only  28F016SA
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 07:21:28 am
tekfwtool and tektool is not same.   tektool supports only  28F016SA

Who wrote tektool ?
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: madao on January 01, 2020, 08:13:31 am
same author. (stackframe.org)
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: analogRF on January 01, 2020, 11:58:45 am
I haven't checking, but  few people (inlc. autor of tekfwtool.exe) tell: It works only with NI-VISA.

But of coruse, i am glad, if it works with agilent.  But it must be make from c-sorucefile.

my understanding is that if the agilent 82357A can work with NI VISA libraries then tekfwtool will work. Based on both Agilent and NI websites
the 82357A does work with NI VISA (there is an option that must be enabled in NI software?) If that is the case, tekfwtool should have no problem I think. It needs to see the NI VISA libraries
I have never had NI VISA on my computers (Only agilent I/O libraries) but I will install it and see if my 82357A works with it
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 12:09:07 pm
I haven't checking, but  few people (inlc. autor of tekfwtool.exe) tell: It works only with NI-VISA.

But of coruse, i am glad, if it works with agilent.  But it must be make from c-sorucefile.

my understanding is that if the agilent 82357A can work with NI VISA libraries then tekfwtool will work. Based on both Agilent and NI websites
the 82357A does work with NI VISA (there is an option that must be enabled in NI software?) If that is the case, tekfwtool should have no problem I think. It needs to see the NI VISA libraries
I have never had NI VISA on my computers (Only agilent I/O libraries) but I will install it and see if my 82357A works with it

When you state NI VISA, do you mean the paid option software suite or the free simplified communicator (attached the one I use on my Mac which should be the same for Windows or linux) ?

From what I've heard, the NI is more versatile hence will work always with tektronix, Agilent,X or Y... no free lunch, pay mor ethen you get more
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: analogRF on January 01, 2020, 12:36:13 pm
Tentratron

honestly I dont know because I do not have NI VISA. I only quoted from Keysight and NI website. They talk about enabling "Passport for tulip" (or enabling NIVISATulip.dll) in NI VISA settings and also enabling NI 488.2 from withing the Keysight connection expert.
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: ragge on January 01, 2020, 04:23:37 pm
Hi Tantratron,

I believe it should be no big deal to convert tekfwtool to the VISA API instead of the NI-488.2 API if you want to, see for example:
https://documentation.help/NI-VISA/ComparisonNI-VISAandNI-488APIs.html (https://documentation.help/NI-VISA/ComparisonNI-VISAandNI-488APIs.html).

I actually just today published a kit with versions of tekfwtool, tektool and getcaldata with minor modifications to make them run on Linux (and ARM, for Raspberry Pi).

I believe it should be easy to make them usable on MacOS too if you just find a NI-488.2 API, macosx_gpib_lib could work, but I haven't tried it. Maybe the NI VISA kit has NI-488.2 compatibility as well, I have not checked.

You can find them here:
https://github.com/ragges/tektools (https://github.com/ragges/tektools)

Regards,

Ragnar
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 05:06:05 pm
Hi Tantratron,

I believe it should be no big deal to convert tekfwtool to the VISA API instead of the NI-488.2 API if you want to, see for example:
https://documentation.help/NI-VISA/ComparisonNI-VISAandNI-488APIs.html (https://documentation.help/NI-VISA/ComparisonNI-VISAandNI-488APIs.html).

I actually just today published a kit with versions of tekfwtool, tektool and getcaldata with minor modifications to make them run on Linux (and ARM, for Raspberry Pi).

I believe it should be easy to make them usable on MacOS too if you just find a NI-488.2 API, macosx_gpib_lib could work, but I haven't tried it. Maybe the NI VISA kit has NI-488.2 compatibility as well, I have not checked.

You can find them here:
https://github.com/ragges/tektools (https://github.com/ragges/tektools)

Regards,

Ragnar

Many thanks Ragnar, just checked your repository on github which will tremendously help the community.

Many thanks for mentioning macosx_gpib_lib  which I did not know of https://www.youtube.com/watch?v=hmSB9rRCrkc (https://www.youtube.com/watch?v=hmSB9rRCrkc)

then https://www.eevblog.com/forum/testgear/agilentbeiming-82357-usb-gpib-support-for-osx/ (https://www.eevblog.com/forum/testgear/agilentbeiming-82357-usb-gpib-support-for-osx/)

Let us see if it can work as well with GPIB-USB-HS of National Instruments.

Quick question first, what is the purpose or idea of using Raspberry Pi or say arduino DUE ?

Happy New Year, Albert
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: ragge on January 01, 2020, 06:43:09 pm
Hi Tantratron,

Quick question first, what is the purpose or idea of using Raspberry Pi or say arduino DUE ?

The Raspberry Pi is a full fledged Linux box for less than about Euro 50-70 (with accessories), and if the programs work there they should work with more or less any Linux machine, as well as any other Unix (as MacOS) with GPIB support, which is a real bonus. I just log in to it (wirelessly) from my laptop (Mac) and do this stuff there, that way I don't have to physically tie my laptop to the instruments. Also, modifications to make the programs work on Linux/Unix where trivial.

The Arduino Due is a microcontroller with no more OS than the Ardino libraries really, that is (normally) programmed with the Arduino IDE and API:s which are not POSIX compliant. It should of course be possible to port tektool/tekfwtool/getcaldata to Arduino too, but it would be much more work, and I don't really see the use case.

Happy new year to you too!

Ragnar
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 01, 2020, 06:59:15 pm
Hi Tantratron,

Quick question first, what is the purpose or idea of using Raspberry Pi or say arduino DUE ?

The Raspberry Pi is a full fledged Linux box for less than about Euro 50-70 (with accessories), and if the programs work there they should work with more or less any Linux machine, as well as any other Unix (as MacOS) with GPIB support, which is a real bonus. I just log in to it (wirelessly) from my laptop (Mac) and do this stuff there, that way I don't have to physically tie my laptop to the instruments. Also, modifications to make the programs work on Linux/Unix where trivial.

OK thanks it is clear now what you've done.

On my side with my MacBookAir and the NI software applications, please find attached screenshots of what i'm using. Could provide suggestions, guidance on would be best approach (staying HMI, use Xcode to code in C, go Terminal or Python) to implement the tektfwtool, in my case interfacing my TDS540C with my Mac via GPIB-USB-HS of NI ?

One thing which is still not clear, the libraries of GPIB  but I'm on my learning curve

Thank you, Albert
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: ragge on January 01, 2020, 08:59:31 pm
For tekfwtool, you don't need anything but the command line.
You need to have Xcode installed to have the compiler and the other development tools (if you don't want to install some other tool chain for some reason).
You seem to have already installed the NI libraries for 488, which is what it will use in this case.

I think this should pretty much work:
Code: [Select]
# get a copy of the kit from github
git clone https://github.com/ragges/tektools.git
# go to the tekfwtool directory
cd tektools/tekfwtool

Then with your favourite editor, in tekfwtool.c, to include the NI headers instead, replace
Code: [Select]
    #include <gpib/ib.h>
with
Code: [Select]
    #include <ni4882.h>

Then it SEEMS this is the NI recommended way to compile the program (not very MacOS-/NextSTEP-ish, but...):
Code: [Select]
cc -g -fsigned-char tekfwtool.c /Library/Frameworks/NI4882.framework/Resources/ni4882.o -framework CoreFoundation -I/Library/Frameworks/NI4882.framework/Headers -o tekfwtool

You should now have a working program, check that it runs with e.g.:
Code: [Select]
./tekfwtool --help

I have not tried this myself, I'd prefer not to install all the NI cruft on my machine if I don't really need it, since they have split it into ~20 packages that all will put stuff in a bunch of places and it will be some work to get rid of it again.

For new programs, I would definitely consider PyVISA, depending on what you want to do.

Ragnar
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 02, 2020, 05:29:30 am
Hello Ragnar,

I've another question which might know the answer since you operate a TDS6xx oscilloscope

Much before in this thread, I was mentioning 2 methods to enable some options (i.e. 2F) so this is some kind of hacking https://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2839268/#msg2839268 (https://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2839268/#msg2839268) which worked fine with my two TDS540C. Now I have FFT's, integral and derivate mathematics from my Oscope. I did try to some enabling-disabling options which are not dependent on HW and it works fine.

On some other threads, members state that we can flash or rewrite the NVRAM to obtain the same effect, namely to flip the bit value in charge of enabling the 2F option. The thing which I do not understand, the NVRAM address zoning starts at 0x04000000 which is totally different than address 0x50009 used by VISA-GPIB command https://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2840286/#msg2840286 (https://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2840286/#msg2840286)

Another question, do you know what is the equivalent Visa-GPIB inline command of "libManagerWordAt()" ?

Albert
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: ragge on January 02, 2020, 03:55:00 pm
Hi Albert,

Another question, do you know what is the equivalent Visa-GPIB inline command of "libManagerWordAt()" ?

No, I sadly have no idea how you get that information. It may have something to do with console access, which I still have not fixed.
I you find out, please post it here!

Regards,
Ragnar
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 02, 2020, 05:04:54 pm
Hi Ragnar,

I guess we need to find out in EEVblog forum or tekforum the member (genius) who found that method, these specific Visa-GPIB console of first "PASSWORD PITBULL" then followed by "WORDCONSTANT:ATPUT 327689,1" to enable the FFT.

Another way to understand how this works, at what address the PITBULL password is captured by the TDS then the address mechanism for the options https://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889412/#msg889412 (https://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889412/#msg889412) and https://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889461/#msg889461 (https://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889461/#msg889461)

Maybe worth deepen the C coding information provided by Andy Watson or maybe he could join this thread

Albert
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Tantratron on January 04, 2020, 04:29:17 am
For tekfwtool, you don't need anything but the command line.
You need to have Xcode installed to have the compiler and the other development tools (if you don't want to install some other tool chain for some reason).
You seem to have already installed the NI libraries for 488, which is what it will use in this case.

I think this should pretty much work:
Code: [Select]
# get a copy of the kit from github
git clone [url]https://github.com/ragges/tektools.git[/url]
# go to the tekfwtool directory
cd tektools/tekfwtool

Then with your favourite editor, in tekfwtool.c, to include the NI headers instead, replace
Code: [Select]
    #include <gpib/ib.h>
with
Code: [Select]
    #include <ni4882.h>

Then it SEEMS this is the NI recommended way to compile the program (not very MacOS-/NextSTEP-ish, but...):
Code: [Select]
cc -g -fsigned-char tekfwtool.c /Library/Frameworks/NI4882.framework/Resources/ni4882.o -framework CoreFoundation -I/Library/Frameworks/NI4882.framework/Headers -o tekfwtool

You should now have a working program, check that it runs with e.g.:
Code: [Select]
./tekfwtool --help

For those very few who have a Macintosh (Mac OS X) with GPIB-USB-HS National Instruments interface, I confirm the tekfwtool compiles and runs OK when communicating with my TDS540C (see attached screen shot of reading the 1486 NVSRAM).

For the moment, it is not clear if this C version works for erasing then flashing the firmware on all TDS 5xx/6xx/7xx/8xx so extra care and verification are needed due to different C versions on the internet https://www.eevblog.com/forum/repair/tekfwtool-for-tds540c-firmware-upgrade/msg2855192/#msg2855192 (https://www.eevblog.com/forum/repair/tekfwtool-for-tds540c-firmware-upgrade/msg2855192/#msg2855192)

If there is some interest, we could update the complete set.

Albert
Title: Re: GPIB-USB control between MacBook Air (Macintosh) and TDS540C
Post by: Andy Watson on January 10, 2020, 07:42:56 pm
I don't think I can add anything to what's already been said. All the information I have has been gleened from the web. There used to be a Tektronix forum that had useful information available - I don't know if it's still active.  https://forum.tek.com/index.php?sid=0a9094a730452c52c480a67c30d1300f  Looks like it is still active, but I think you have to register to get at the manuals.