Author Topic: PM6666: Cannot read/write via GPIB  (Read 1283 times)

0 Members and 1 Guest are viewing this topic.

Offline rachdatuTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
PM6666: Cannot read/write via GPIB
« on: May 07, 2019, 08:28:18 pm »
Hello

I 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: [Select]
03:0b.0 Communication controller: National Instruments PCI-GPIB (rev 02)
Subsystem: National Instruments PCI-GPIB
Flags: bus master, medium devsel, latency 64, IRQ 23
Memory at feaff000 (32-bit, non-prefetchable) [size=2K]
Memory at feaf8000 (32-bit, non-prefetchable) [size=16K]
Kernel modules: tnt4882

I have tried to get its model with this script:

Code: [Select]
import sys
import time
import Gpib

inst = Gpib.Gpib(0,6) # Device address 6
time.sleep(1)
inst.write("ID?\n")
time.sleep(1)
str =  inst.read(40)
print str

The counter switches to remote but then issue an error:
Code: [Select]
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 write
    gpib.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: [Select]
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 error

Code: [Select]
: w
enter a string to send to your device: RL1
sending string: RL1

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

I am now stuck! Anything else I could try?

Thanks in advance

Walter



 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2108
Re: PM6666: Cannot read/write via GPIB
« Reply #1 on: May 07, 2019, 09:07:44 pm »
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.
 

Offline rachdatuTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: PM6666: Cannot read/write via GPIB
« Reply #2 on: May 08, 2019, 09:49:18 am »
Hello

Thanks for your answer.
I have tried more or less all possibilities, still without success.
The only script that works is the following:  :-DD


Code: [Select]
import sys
import time
import Gpib

inst = Gpib.Gpib(0,6) # Device address 6
inst.write("")

It did not return any errors !

Walter
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2108
Re: PM6666: Cannot read/write via GPIB
« Reply #3 on: May 08, 2019, 03:56:11 pm »
Does your GPIB card work with other devices ? I recall having to build libraries when I wanted to interface it with C.
 

Offline rachdatuTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: PM6666: Cannot read/write via GPIB
« Reply #4 on: May 08, 2019, 05:05:39 pm »
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
 

Offline rachdatuTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: PM6666: Cannot read/write via GPIB
« Reply #5 on: May 21, 2019, 10:04:14 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf