Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQ M-seried 6230 Analog Output, AI_FIFO, AI_FIFO always returns 0x07FF , please help

Hi
What should be the difference in address space for BAR0 and BAR1 in board 6519?
 
When I run the driver program in debugger and look at the addreses for BAR0 and BAR1, the difference is 0x2000?? Is this correct?
 
for example, BAR0 = 0xc1400000, BAR1 = 0xc1402000
 
When I tested a different board (DAQ 6230) the BAR0 and BAR1 had only 0x1000 difference in address space?
 
We do not have any experience with this 6519 board, can you please provide some help in making the driver work for this board?
 
The driver code is for 6509 which has 11 ports and this driver code as it is does not work with our board 6519.
Please help
 
Thanks very much
Lee Khadii
Curtiss Wright
0 Kudos
Message 11 of 30
(6,847 Views)
Hi
Is there something I need to do with the DSUB connector to make the board work?
I am looking at the signal connection document and looks like you have to connect a external power suply???
 
What is this SInking and Soursing all about? 6519 is a Sinking device and I do not understand what we need to do for connection?
 
The connection Diagram shows pins 1,14 and 19 are connected to external power suplay???
How does this work?
 
The connection diagram shows pin 14 as GND but my 6519 diagram shows pin 14 is P2.6?
The connection diagram has pins 1(P0.0), 14(P2.6) and pin 19(OUT.COM) connected to external power supply and GND.
 
Can you please provide soem help?
Thanks very much
 
Lee Khadivi
Curtiss Wright
0 Kudos
Message 12 of 30
(6,841 Views)

Hello Lee,

Regarding your previous questions:

1) You are wondering how the example code knows that the board is not a 6509 so that it doesn't try to configure more ports than are present on the 6519.  Which example are you using?  Of those 5 examples downloaded from the MHDDK page for this board, all but 1 example configures only one port.  The 5th example configures 3 ports.  Are you using a different set of examples?  Based on these examples, you should be able to put together a simple example that writes to two ports and reads from two ports.

2) You are curious about the difference in the base addresses.  When I get my hands on a board, I can respond to this.

3) It sounds like you are unsure about how to physically connect this device.  If so, I recommend switching over to a Windows machine so you can install the NI-DAQmx driver (link below) in order to help you figure out the physical connections.  NI-DAQmx provides very simple tools like test panels that will allow you to test the functionality of your board and verify your signal connections before we try to develop your own driver.  At this point, we don't know if the problem is in your code or with your physical connections.  Using NI-DAQmx would allow you to focus on the physical connection part.  Once you understand that, then we can focus on your software.

NI-DAQmx 8.3.1

http://digital.ni.com/softlib.nsf/websearch/11D505B7B355EBD68625722D006A6B97?opendocument&node=13206...

Jeremy

0 Kudos
Message 13 of 30
(6,828 Views)

Hi Jeremy and thanks.

I will try the windows application and try to get the board working.

As for the 5 examples you mentioned, you are correct that 4 write to only 2 ports. The problem is that the code during initialization actually initializes 11 ports which means assumes 6509  board. I verified this with debugger doing single step. I am pretty sure my code is correct and I am not sure what impact the code has on 6519 board when it initializes 11 ports. Doing that obviously will be writing to memory locations beyong the 4 ports and who knows what happens when it does that.

I commented out the driver code for ports 4 thru 11 but then the program crashes. This may have to do with C++ classes that exists for all 11 ports.

Can you check into this and maybe talk to someone who worked or developed code for driver and maybe you can poit me to the right direction so I have a starting point to get going and know where in code I need to focus and change? At this poit I don't really know where to start in DDHK code to make it work for 6519.

I am curious as how come the developers didn't put in a FLAG and initialize the board for the correct board that is running or some kind of switch statement to see what board they need to initialize. This would have been very easy checking the device ID.

Thanks and I will wait for your response.

Lee Khadivi

Curtiss Wright Embedded Control

0 Kudos
Message 14 of 30
(6,824 Views)

Lee,

I now understand the initialization code you are referring to is the _initialize function that is called in the constructor of the chip object (tstaticDIO.cpp).  Yes, this (and the reset function) does appear to address non-existent ports when used with the 6519.  The thing to keep in mind here is these functions are simply resetting the individual objects to a known value.  These objects are the soft copies of the actual registers on the board.  Resetting the soft copies has no effect if the corresponding registers do not exist on that particular board.  So, for these examples, it doesn't matter that we reset the soft copy of ports 4-11.  With that said, you should be able to yank out the references to the extra ports if you really want to.  These chip object files are auto generated, so I wouldn't necessarily recommend modifying them manually unless you had a good reason to do so. 

If you have the VxWorks OS layer working, you should have everything you need to get an example working.  I used VISA to communicate with the hardware on Windows, but the chip objects and examples are the same as you are using.  Without modifying tstaticDIO.cpp, I modified digex1.cpp to reference my particular board, commented out the line to configure the port direction (since that isn't necessary for these boards with unidirectional ports), and changed IOPort0Data.writeRegister to IOPort2Data.writeRegister to write to port 2.  That was enough to successfully toggle some digital lines on port 2.  I hope this helps.  Let me know if you have any specific questions.

0 Kudos
Message 15 of 30
(6,814 Views)
Hi Jeremy
I understand and thank you for good explanation. I liked that. I think you are right. The only thing I have not done to comment out the port2 direction for output which I will do in a minute and I think I can get this thing working.
 
One important question I have is this: Can you tell me how to connect the board with DSUB connector and the cable that we goty from you guys? I have the DSUP 37 pin connector and the right cable hooked up to the PCI-6519 board. I think that there are some power supply or something like that that I need to connect to the board thru DSUB also. Do I need a external power supply? How do I connect the external power supply?
 
What is IN.COM and OUT.COM used for? What connection do I need to do for IN.COm and OUT.COM?
 
I think one problem I had that things didn't work was that I did not have external power supply connection and did not have any thing connected to IN.COM and OUT.COM ither.
 
Can you tell me how you connected the board for wiring and external power supply using DAQmx?
 
I have installed DAQmx LAB View and tried to send all 1's to PORT 2 thru the Window LAB View software but did not get any voltage from pin 11 which is bit 0 of PORT2.
 
If you have a wiring diagram that shows how to wire the DSUB wiring with board that would be excellent.
I thank you in advance.
 
Hope all the bad inclement weather is gone. We even had some snow here in southern California yesterday.
 
Thanks again
 
Lee Khadivi
 
Curtiss Wright
0 Kudos
Message 16 of 30
(6,810 Views)

Lee,

I was able to find all of the information I needed regarding physical connections in the help manual (link below).  You will need an external power supply, and there is a diagram that shows how to connect it.  I hope this helps.

http://digital.ni.com/manuals.nsf/websearch/54DE1448077BB2228625706D004EB0F9

0 Kudos
Message 17 of 30
(6,803 Views)
Hello everyone. Before I describe my problem with DIO 6519, I want to say that I ganed experience making DAQ 6230 board working last week so I can describe the problem with 6519 DIO board better since these board use pretty much the same DDHK code. I also want to say that I had success making the board 6519 Input and Output ports to work using DAQmx WIndows software ( By the way, is this the software you call LabView?)
 
Here is what my problem is so far with 6519 board
 
I basically took the board out of the PCI slot in PC and placed it in a PCI slot in VxWorks environment.
I have build the HHDK code changing example 1 that writes to port0(changed it to port2) and I also added code to osiUserCode.cpp adding PCI code for aquireboard function. The code is not working when I write to port 2 just like the example 1 code does. I get no output from the port. (same wiring configuration works under windows with DAQmx software measurement and automation.
 
What is the problem? I don't know where to look other than the code I added which is exactly same as the code for 8230 DAQ for aquireboard.
 
I did xome diffs on osibud.h code between the 8230 code and 8519 code and they are somewhat different. First, there is an extra ',' in typedef enum in

tBusWindowType right after the last declaration of KPCI_BAR5. Is this a bug? or intentional?

I also noticed all of the calls to sysnInWord and sysOutWord has been replaced by plain memory I/O in the file for DIO.

and the most important thing I have found that is different between these 2 boards (8230 and 8519) is that the BAR0 and BAR1 addresses don't map similarly either. By that I mean the following:

Board 8230 : BAR0 = 0x1C400000                 BAR1 = 0x1C401000

board 8519 : BAR0 = 0x1C400000                 BAR1 = 0x1C402000

Notice that the address space between BAR0 and BAR1 for 8230 board is 0x1000 different (4k) which is specified by documentation that this is MITE address and has 4k space. (good so far)

Notice that for board 8519, I am getting BAR0 and BAR1 address space difference of 0x2000 (8k), which seems to be wrong because BAR0 is MITE address space and should be only 4k (also according to 8519 documentation).

After all these explanation clearly, can you tell me what is going on on this 8519 board and why I am not able to make it work? 

Is there a problem with the HHDK code? Is the 8230 code newer and therefore correct?

Is there any issues with HHDK code for 8519 ?

Why is the BAR0 address space is 8k in 8219?

Help!!!

Thanks

Lee Khadivi

Curtiss Wrights Embedded Controls

 

0 Kudos
Message 18 of 30
(6,790 Views)

Lee,

Where did you get the osibus files?  Why do have two different copies of the osibus.h?  I will look into the base addresses tomorrow.

0 Kudos
Message 19 of 30
(6,776 Views)
Hi Jeremy
It is alright. I got the board working now.
The code was okay except that there was no mention of the fact when you store the BAR! address in offset 0xc0 of the BAR0 address you need to sawp the PowerPC Big Endian word to Little Endian before you try to store it. It was not seeing the BAR1 addresses where the registers of the board are located.
 
It is working fine now.
 
Thanks very much for the help so far.
 
Lee Khadivi
Curtiss Wright
0 Kudos
Message 20 of 30
(6,773 Views)