GPIB-USB control between MacBook Air (Macintosh) and TDS540C - Page 1
Forum section: electronics / repair

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 19, 2019, 04:52:40 am
content: 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.

author: madao
author_rank: Frequent Contributor
timestamp: December 19, 2019, 03:44:46 pm
content: 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)Regardsmatt

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 20, 2019, 08:15:38 am
content: For the moment, I'd like to first try a simple task to enable some options (2M, 1F) which are stored onvia the Macintosh Visa-GPIB utility.From viewing different threads, unless I'm wrong it seems based on this step by step process:toggle the safety switch on A11 boardsend PASSWORD "PITBULL"WORDCONSTANT:ATPUT address,1toggle back the safety switch on A11 boardHowever 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...

author: madao
author_rank: Frequent Contributor
timestamp: December 20, 2019, 09:24:32 am
content: 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)

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 20, 2019, 09:48:57 am
content: Oups... yes I've meant 2F to do FFT and soThanks 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.

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 21, 2019, 03:30:45 pm
content: 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.

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 22, 2019, 11:22:28 am
content: 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 fromhttps://forum.tek.com/viewtopic.php?t=138100#p279044, in particular this extractyou can use libManagerWordAtPut call to "set" values (to be tested!)you can use libManagerWordAt to read the actual value.Another question, what is stored or what option is stored specifically at "0x5000B" so in decimal at 327691 address?

author: Tantratron
author_rank: Frequent Contributor
timestamp: December 23, 2019, 03:40:26 pm
content: 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).

author: analogRF
author_rank: Super Contributor
timestamp: December 31, 2019, 08:11:47 pm
content: does the tekfwtool work with agilent 82357A GPIB-USB on windows 7?

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:22:53 am
content: Quote from: analogRF on December 31, 2019, 08:11:47 pmIf 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

author: madao
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:23:58 am
content: 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.

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:29:11 am
content: I'd like to compile the C files of tekfwtool on my Macintosh, for the moment I've only found this archivehttps://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 ?

author: madao
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:35:10 am
content: file from 2013 is actual.

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:45:44 am
content: Quote from: madao on January 01, 2020, 06:35:10 amIt would be nice to have the author of tekfwtool to comment or help... there are different versions if you lookhttps://stackframe.org/tekfwtool/thenhttps://stackframe.org/tekfwtool/tekfwtool.cwhereas this other archive is slightly differenthttps://web.archive.org/web/20131212025232/https://stackframe.org/tektool.shtmlthenhttps://web.archive.org/web/20130403195440/http://stackframe.org/tektool.cOn a side, it seems required also the C filehttps://stackframe.org/tekfwtool/target.c

author: madao
author_rank: Frequent Contributor
timestamp: January 01, 2020, 07:09:49 am
content: tekfwtool and tektool is not same. tektool supports only 28F016SA

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 07:21:28 am
content: Quote from: madao on January 01, 2020, 07:09:49 amWho wrote tektool ?

author: madao
author_rank: Frequent Contributor
timestamp: January 01, 2020, 08:13:31 am
content: same author. (stackframe.org)

author: analogRF
author_rank: Super Contributor
timestamp: January 01, 2020, 11:58:45 am
content: Quote from: madao on January 01, 2020, 06:23:58 ammy understanding is that if the agilent 82357A can work with NI VISA libraries then tekfwtool will work. Based on both Agilent and NI websitesthe 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 librariesI 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

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 12:09:07 pm
content: Quote from: analogRF on January 01, 2020, 11:58:45 amWhen 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

author: analogRF
author_rank: Super Contributor
timestamp: January 01, 2020, 12:36:13 pm
content: Tentratronhonestly 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.

author: ragge
author_rank: Regular Contributor
timestamp: January 01, 2020, 04:23:37 pm
content: 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.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/tektoolsRegards,Ragnar

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 05:06:05 pm
content: Quote from: ragge on January 01, 2020, 04:23:37 pmMany thanks Ragnar, just checked your repository on github which will tremendously help the community.Many thanks for mentioningmacosx_gpib_libwhich I did not know ofthenhttps://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

author: ragge
author_rank: Regular Contributor
timestamp: January 01, 2020, 06:43:09 pm
content: Hi Tantratron,Quote from: Tantratron on January 01, 2020, 05:06:05 pmThe 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

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 01, 2020, 06:59:15 pm
content: Quote from: ragge on January 01, 2020, 06:43:09 pmOK 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 curveThank you, Albert

author: ragge
author_rank: Regular Contributor
timestamp: January 01, 2020, 08:59:31 pm
content: 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:# get a copy of the kit from githubgit clone https://github.com/ragges/tektools.git# go to the tekfwtool directorycd tektools/tekfwtoolThen with your favourite editor, intekfwtool.c, to include the NI headers instead, replaceCode:#include <gpib/ib.h>withCode:#include <ni4882.h>Then it SEEMS this is the NI recommended way to compile the program (not very MacOS-/NextSTEP-ish, but...):Code:cc -g -fsigned-char tekfwtool.c /Library/Frameworks/NI4882.framework/Resources/ni4882.o -framework CoreFoundation -I/Library/Frameworks/NI4882.framework/Headers -o tekfwtoolYou should now have a working program, check that it runs with e.g.:Code:./tekfwtool --helpI 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

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 02, 2020, 05:29:30 am
content: Hello Ragnar,I've another question which might know the answer since you operate a TDS6xx oscilloscopeMuch before in this thread, I was mentioning 2 methods to enable some options (i.e. 2F) so this is some kind of hackinghttps://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2839268/#msg2839268which 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 commandhttps://www.eevblog.com/forum/repair/gpib-usb-control-between-macbook-air-(macintosh)-and-tds540c/msg2840286/#msg2840286Another question, do you know what is the equivalent Visa-GPIB inline command of "libManagerWordAt()" ?Albert

author: ragge
author_rank: Regular Contributor
timestamp: January 02, 2020, 03:55:00 pm
content: Hi Albert,Quote from: Tantratron on January 02, 2020, 05:29:30 amNo, I sadly have no idea how you get that information. Itmayhave something to do with console access, which I still have not fixed.I you find out, please post it here!Regards,Ragnar

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 02, 2020, 05:04:54 pm
content: 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 optionshttps://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889412/#msg889412andhttps://www.eevblog.com/forum/testgear/tds420-with-lost-options/msg889461/#msg889461Maybe worth deepen the C coding information provided by Andy Watson or maybe he could join this threadAlbert

author: Tantratron
author_rank: Frequent Contributor
timestamp: January 04, 2020, 04:29:17 am
content: Quote from: ragge on January 01, 2020, 08:59:31 pmFor 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 internethttps://www.eevblog.com/forum/repair/tekfwtool-for-tds540c-firmware-upgrade/msg2855192/#msg2855192If there is some interest, we could update the complete set.Albert

author: Andy Watson
author_rank: Super Contributor
timestamp: January 10, 2020, 07:42:56 pm
content: 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=0a9094a730452c52c480a67c30d1300fLooks like it is still active, but I think you have to register to get at the manuals.