Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to write gpib's 4882 regester ?

Hello,

I have some questions for  accessing the regesters of gpib(TNT5002),my platform as follow:

 

1 MPC8541;

2 VxWorks 5.5;

 

Some setting:

sysLib.c

...

PHYS_MEM_DESC sysPhysMemDesc [] =
{

...

#ifdef INCLUDE_PCI
    ,
    {
    (void *) PCI_MEM_ADRS,     //0x50000000
    (void *) PCI_MEM_ADRS,
    PCI_MEM_SIZE,                    //64M
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | \
    VM_STATE_MASK_GUARDED | VM_STATE_MASK_MEM_COHERENCY,
    VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT | \
    VM_STATE_GUARDED      | VM_STATE_MEM_COHERENCY
    }
    ,
    {
    (void *) PCI_MEMIO_ADRS,            //0x54000000
    (void *) PCI_MEMIO_ADRS,
    PCI_MEMIO_SIZE,                           //64M
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | \
    VM_STATE_MASK_GUARDED | VM_STATE_MASK_MEM_COHERENCY,
    VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT | \
    VM_STATE_GUARDED      | VM_STATE_MEM_COHERENCY
    }
    ,
    {
    (void *) PCI_IO_ADRS,                  //0x58000000
    (void *) PCI_IO_ADRS,
    PCI_IO_SIZE,                                //64M
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | \
    VM_STATE_MASK_GUARDED | VM_STATE_MASK_MEM_COHERENCY,
    VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT | \
    VM_STATE_GUARDED      | VM_STATE_MEM_COHERENCY
    }
...

}

 

After autoconfig pci,show the header of  the pci-gpib:

 

Word 0 Value c8501093    //device ID/vendor ID

Word 4 Value 2800006
Word 8 Value 7800002
Word 12 Value 4008
Word 16 Value 54000000  //PBAR0
Word 20 Value 54004000  //PBAR1
Word 24 Value 0
Word 28 Value 0
Word 32 Value 0
Word 36 Value 0
Word 40 Value 0
Word 44 Value 0
Word 48 Value 0
Word 52 Value 0
Word 56 Value 0
Word 60 Value 1ff
Word 64 Value b4a8
Word 68 Value 0
Word 72 Value c7000000
value = 23 = 0x17

 

 

Then, I write 0x54004080 to 0x540000c0,and 0x5400608c to 0x540000c4,but I read the address 0x54004117,the value is 0x00 not the 0x4c.

why?

 

What can I do?

 

Thank you!

Clover

0 Kudos
Message 1 of 18
(5,562 Views)

The question was about pci-gpib driver...

 

Thank you!

0 Kudos
Message 2 of 18
(5,551 Views)

Hello,

 

I'm afraid that our PCI-GPIB boards are only supported when used with the NI-488.2 driver.  If you are using the NI-488.2 driver, there is no need to handle any of the configuration registers yourself.

 

For VxWorks, we have a NI-488.2 DDK source code package that can be used to build a suitable driver for your VxWorks operating system.

 

I hope this helps,

Steven T.

Message 3 of 18
(5,515 Views)

Hello Steven T,

Thanks a lot for your help!I download the software you suggested,so I need to declare that my pci-gpib works on MPC8541 platform,and there is not vxworks driver for pci-gpib. I should complete the driver from datasheet.(There was a driver in c++ with the pci-gpib,which didn't catch us.)

 

This time,the device enumeration is ok.Gpib's(tnt5002) 4882 regester can be writen also.but the train of my thought is not clearly for gpib initialization.

 

If you give me some directions that is very good.

 

Thank you!

Regards.

 

clover.

 

0 Kudos
Message 4 of 18
(5,510 Views)

Steven T,

I am so sorry for my last reply.I read the manual of the NI-4882DDK "Developing Your Driver",but I can't found the source code. where?

thank you!

 

0 Kudos
Message 5 of 18
(5,501 Views)
As noted on link above, the cost is U$295. You have to order it.
0 Kudos
Message 6 of 18
(5,499 Views)

Oh,we bought the hw(pci-gpib board) from NI,there was a driver with it,but it is not suit our os.Why do we pay for it?

 

0 Kudos
Message 7 of 18
(5,495 Views)

Hello,

 

Please answer me from email,leftpoint.g@gmail.com.

thank you!

 

 

0 Kudos
Message 8 of 18
(5,491 Views)

Hello Clover,

 

Under normal circumstances, you are correct.  When you purchase a PCI-GPIB card it comes with a driver that will work with your OS.  As a matter of fact, on our website, the supported operating systems are even listed on the orderable part number.  There are special cases where we do not have a driver that will support a particular OS. 

 

Under those conditions, we provide a source code package that can be modified to suit your OS.  It comes with example operating system layers.  You have to modify the OS layer so that it builds on your OS.  You can then build the driver and install it manually.  In this case, you are not paying for a driver.  You are paying for a source code package.

 

Please be careful about putting your email on public forums.  

 

I hope this helps,

Steven T.

Message 9 of 18
(5,457 Views)

Hello Steven T,

 

     First,thank you for attention! I known that I just pay for the source code packet not the os driver.The point is that source code dosn't catch us,it write in c++ not the c. I am not familiar with the c++.Since that you have NI-488DDK which based c,just good for me.Why not copy it ?Though I will do it successful from the datasheet for little time,your help,the time halve.

 

Thank you!

 

Clover.

0 Kudos
Message 10 of 18
(5,442 Views)