Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use VISA for handling interrupts on NI-DAQ 6259?

Hi all,

 

I'm new to this forum, to VISA drivers and to the PCI/PXI bus. I have a PXIe-8130 embedded controller with a NI-DAQ 6259 card with NI drivers installed. The card is visible in MAX.

 

 

Ultimately, I would like to make a "hello world" interrupt handler and a "hello world" DMA transfer using VISA and this device. 

 

 

Is it possible to set-up and handle interrupts using VISA even though there is an existing driver installed on the machine? 

 

I can read and write to registers via VISA peek and poke, but when I try to enable PXI interrupts using the "enable event" vi, I get the following error: -1073807302, Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state).

 

 My flow is as folows:

 

1. get VISA reference (using "visa find resources" and matching the model ID) 

2. open VISA session 

3. VISA enable event - PXI interrupt (here is where I get the error)

4. VISA wait for event (here I expect a timeout because some configuration is needed on the card to start emitting events)

.

.

.

 

  

The error message is not too informative and I have searched the forum for help without luck. 

 

 

Is it possible to do things with VISA which the already installed driver is supposed to do? I don't want to uninstall the driver and write my own .inf file (using VISA driver dev. wizard) for the DAQ card bacause I do not have all the necessary information. 

 

Does anyone have a suggestion?  

 

Cheers,

 

Rok Tavcar 

 

0 Kudos
Message 1 of 5
(6,955 Views)

It's OK! I just uninstalled the device driver and wrote my own configuration file to make the device visible to MAX and VISA. It just required me to enter vendor and model IDs.

 

Note one thing - I had to tell MITE to enable BAR1 before I was able to read any device registers. This was not obvious to me - I found the note here: 

 

http://forums.ni.com/ni/board/message?board.id=90&message.id=293&query.id=8135512#M293

 

I've managed to configure the onboard general purpose counter GP0 using the Measurement Hardware Driver Development Kit (MHDDK) examples.

 

The documentation for this device is POOR. The register map available under MHDDK (http://digital.ni.com/express.nsf/bycode/exyv4w?opendocument&lang=en&node=seminar_US) is incomplete. I had to scavenge various example source files to get most of the register addresses needed.

0 Kudos
Message 2 of 5
(6,900 Views)

Dear Rov Tavkar,

 

 First of all, sorry for not responding for so long! 

 

I guess you found the following KB, if not check it out, it has useful information:

 

http://zone.ni.com/devzone/cda/tut/p/id/4713

 

 

 

You might have found the documentation "POOR", because this device is not ment to be used with register level programming. There is the DAQmx driver developed that is good documented, out of the box, free and supports number of development environments. Please check it, it might be suitable for you and keep in mind that using DAQmx is the recommended way if working with multifunctional daq boards.

 

Let me know if you need guidence with DAQmx!

 

Useful link to get started:

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/202291

 

 Best regards,

 

David Varga

Applications Engineer

NIH 

Message Edited by DavidVr on 06-08-2010 08:42 AM
Message Edited by DavidVr on 06-08-2010 08:43 AM
Message Edited by DavidVr on 06-08-2010 08:43 AM
0 Kudos
Message 3 of 5
(6,899 Views)

Hi David,

 

Thank you for your response. In fact, I was only using the DAQ device to learn register level programming. The goal was to setup DMA transfers and interrupt handling as I was waiting for a third party device to arrive. I have to write LV support for the latter device and the DAQ was the only device I had on my hands to play with... It turned out that configuring the AI data acquisition (and then setting DMA) was a lot more work than expected. So I just configured the onboard counters to get the hang of register programming a bit. 

 

I complained about the documentation because I was struggling to pull all the pieces together (understanding how to configure the device and find the needed register addresses)... And I got frustrated...

 

I won't be needing further guidance on this particular device, as I've finished using it for now as I got the card I was waiting for. But thank you anyway!

 

I have a  new question though...

 

Does viMoveOut implement data transfer from host to target as a burst, or is it done as a sequence of single accesses? I haven't found that information yet and would appreciate if you can point me in the right direction.

 

Best regards,

 

Rok 

 

0 Kudos
Message 4 of 5
(6,860 Views)

Hello,

 

I am solving an fundamental issue with M series card. For our application, we have received NI6221 card.  This device is going to replace an old Advantech DAQ card. The task is to keep an old software and change only what is needed to make whole machine working.  Old Advantech card used dual DMA transfer for continous acquisition with some registered events.

I have made sample AI code with NI6221 using MHDDK, but now I have stopped on the following:

- how can I find out if there was some change in device's input buffer (something like OnChangeEvent)

- is there any difference in acquisition speed using DMA transfer when using NI-DAQmx or plain NI-DAQ

 

Thank you very much for the response.

 

Sincerely

 

R.Vlcek

 

0 Kudos
Message 5 of 5
(6,735 Views)