PM6666: Cannot read/write  via GPIB - Page 1
Forum section: electronics / testgear

author: rachdatu
author_rank: Regular Contributor
timestamp: May 07, 2019, 08:28:18 pm
content: HelloI am using an old PCI computer to connect to a PM6666 counter.My interface is a NI PCI GPIB board.Output of the lspci command:Code:03:0b.0 Communication controller: National Instruments PCI-GPIB (rev 02)Subsystem: National Instruments PCI-GPIBFlags: bus master, medium devsel, latency 64, IRQ 23Memory at feaff000 (32-bit, non-prefetchable) [size=2K]Memory at feaf8000 (32-bit, non-prefetchable) [size=16K]Kernel modules: tnt4882I have tried to get its model with this script:Code:import sysimport timeimport Gpibinst = Gpib.Gpib(0,6) # Device address 6time.sleep(1)inst.write("ID?\n")time.sleep(1)str = inst.read(40)print strThe counter switches to remote but then issue an error:Code:Traceback (most recent call last):File "test_gpib.py", line 14, in <module>inst.write('ID?\n')File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 49, in writegpib.write(self.id, str)gpib.GpibError: write() failed: A read or write of data bytes has been aborted, possibly due to a timeout or reception of a device clear command.Here is my gpib.conf:Code:interface {minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */board_type = "ni_pci" /* type of interface board being used */name = "violet" /* optional name, allows you to get a board descriptor using ibfind() */pad = 6 /* primary address of interface */sad = 0 /* secondary address of interface */timeout = T10s /* timeout for commands */eos = 0x0a /* EOS Byte, 0xa is newline and 0xd is carriage return */set-reos = yes /* Terminate read if EOS */set-bin = no /* Compare EOS 8-bit */set-xeos = no /* Assert EOI whenever EOS byte is sent */set-eot = yes /* Assert EOI with last byte on writes */master = yes /* interface board is system controller */}I tried as well with ibtest command and write RL1, but there is still an errorCode:: wenter a string to send to your device: RL1sending string: RL1gpib status is:ibsta = 0xc100 < ERR TIMO CMPL >iberr= 6EABO 6: Operation abortedibcntl = 0I am now stuck! Anything else I could try?Thanks in advanceWalter

author: Andy Watson
author_rank: Super Contributor
timestamp: May 07, 2019, 09:07:44 pm
content: Do you need to explicitly send the carraige return ? "inst.write('ID?\n')" Also, depending on your OS, "\n" is sometimes expanded into carraige return and line feed, or vice-versa.

author: rachdatu
author_rank: Regular Contributor
timestamp: May 08, 2019, 09:49:18 am
content: HelloThanks for your answer.I have tried more or less all possibilities, still without success.The only script that works is the following:Code:import sysimport timeimport Gpibinst = Gpib.Gpib(0,6) # Device address 6inst.write("")It did not return any errors !Walter

author: Andy Watson
author_rank: Super Contributor
timestamp: May 08, 2019, 03:56:11 pm
content: Does your GPIB card work with other devices ? I recall having to build libraries when I wanted to interface it with C.

author: rachdatu
author_rank: Regular Contributor
timestamp: May 08, 2019, 05:05:39 pm
content: I don't have any other equipments and I am just starting using GPIB.According to this document (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LSwSAM&l=en-CH) my PCI-GPIB board may have been manufactured with different chips.My assembly number is 188513E-01L which has the "TNT5004" GPIB chip on board. Does this corresponds to the driver of the board?In my folder where I built the GPIB binaries, I can't find it.So now, I am using "TNT4882" which "seems" to be somehow identical to the TNT5004 chip.I did not have any issue loading this driver. This is why I assumed it's the right one.But I have seen in different forums people asking for the differences and other people looking for the TNT5004.I am kinda confused.Walter

author: rachdatu
author_rank: Regular Contributor
timestamp: May 21, 2019, 10:04:14 am
content: I finally managed to talk to this counter. However, I replaced my PCI board by an AR488 based on an Arduino Uno.That works a treat!It takes no more than a couple of hours to build one...once you have all the items.By the way, the right command to get the device model is id?Walter