Discussion:
Driver or Example code for DAQ 6230 device
(too old to reply)
CW_Ca
2007-01-12 23:40:16 UTC
Permalink
Hello
 
Would you please provide some example/Driver code for DAQ 6230 device to do A/D conversion?
We have been successful in getting the D/A to work but no luck with A/D.
We have tried everything and always get 0x7FFF in AI_FIFO or sometimes the test for FIFO data avalable in while loop gets stuck because no data is avalable.
 
This is very urgent and we need this ASAP. Please help.
Also, please provide any detail Register programming documentation that you may have.
 
We have acptured the PCI BUS data and found there is a difference in the way some of the registers are being set between the Windows program the way it sets up the DAQ and the driver for other OSs.
 
Here is what we have found so far thru a Bus Analyzer below:
 
Register name                 Register offset                PC/Window write this value             Other IOS Drivers writes
-------------------                 -------------------                 -----------------------------------              -------------------------------
Analog Trigger                       0x8C                                          0x01                                         0x03
AI Command                          0x110                                         0x1540                                    0x1440       
AI_Mode_1                             0x118                                          0x0C                                 0x08, 0x09, 0x0B
AI_Mode_2                             0x11A                                          0x
CW_Ca
2007-01-15 19:40:11 UTC
Permalink
Thanks a lot everyone to everyone for providing the correct settings for Analog Input.
I changed the values and we got the correct AI output data in AI_FIFO.
Thanks again
Lee Khadivi
 
CW_Ca
2007-01-15 21:40:11 UTC
Permalink
Hello Jesse and thank you
 
I checked into the information you provided regarding the PCI 6519 and and NI-DAQmx-8.0.
Since I do not have Linux OS here I am not able to install the .ISO image therefore I can not see the 'C' source driver files for Linux.
 
I am only interested in the 'C' driver files and example files that are in Linux 8.0 .ISO image.
 
Would it be possible for you to just zip ONLY the 'C' source files for drivers and example code so I can just use them as a guide for development?
 
I can download and install the Windows XP image instead but then would I be able to see and view the 'C' source files only?
 
I need 'C' souce files and example code that I can use as a guide to do I/O on NI PCI 6519 board.
Can you just provide me with such a 'C' code?
 
Thanks very much Jesse and I am waiting for this ASAP.
 
Regards
Lee Khadivi
Curtiss Wright Embedded Controls
CW_Ca
2007-01-18 01:10:10 UTC
Permalink
Hello Jesse
I have downloaded and installed the latest DAQmx windows software but this is not going to help us since we are using the DIO 6519 under VxWorks OS.
 
I also have downloaded the driver code (ni_Static_dio which is the type of driver that we need but this driver is for DIO 6509. It doesn't work for the board we have.
We got help from you in getting the A/D, D/A working now we need some help in getting the DIO 6519 working.
Thank so much
 
Lee Khadivi
Curtiss Wright
CW_Ca
2007-01-18 17:10:11 UTC
Permalink
Hi Jesse
I have developed code and build a project for the DIO as you mentioned but I am not able to get any output from the port 2 which is a Output port. If you noticed, the code in HHDK is for 6509 DIO. 6509 DIO has 11 ports and 6519 has only 4 ports. The code initializes and writed to 11 data and select registers which is outside the 6519 memory area and who knows what happens when you write to areas of 6519 which is outside those 4 ports.
There must be some kind of a FLAG or some way to tell the code that it is running 6519 board and only initialize the 4 ports that it has. I commented out that section that initializes the 4 ports but the code crashes after that. This is a huge code and I am not sure what to change or where to look at this time. Can you talk to the Engineers who developed this code for HHDK and see what their thoughts are if you are using 6519 board? I am sure they would have good ideas at least to tell me where to look or what file I need to change or any thing that you can tell me would be very much helpful.
I will wait for your answer as I am not able to proceed unless I have some idea what code I need to change.
Thanks so much Jesse.
Lee Khadivi
Curtiss Wright Embedded Control
Jesse O
2007-01-19 17:10:13 UTC
Permalink
Lee,

The MHDDK forums, <a href="../board?board.id=90" target="_blank">here</a>,
are monitored by Engineers in the MHDDK group and by members of the community.&nbsp;
All register level programming (RLP) questions should be posted there.&nbsp;
Posts to this forum will be answered by them, or other community members
familiar with RLP.&nbsp; Perhaps they will be the best resource to support you.

Regards,

Jesse O.
CW_Ca
2007-01-22 19:10:12 UTC
Permalink
Hello
I am getting a 0x00 returned from ID register of the NI DAIO-6519?
What is going on here? I am doing everything right as far as I know.
Please look a this and see if it looks correct.
The similar functions for aquireboard&nbsp; worked for DAQ board.
Thanks so much
Lee Khadivi
Curtiss Wright
&nbsp;
I am using the digex1 example: Here is the code I am using for test and I am attaching the the file
osiUsercode.cpp that has the function aquireBoard()
&nbsp;
The BAR addresses that I am getting from PCI looks like this, does it look correct?
&nbsp;
BAR0 = 0xC1400000
BAR1 = 0xC1402000
&nbsp;
&nbsp;
example code I am using is below. First function is the test modified a little from digex1.cpp
the second function is aquireBoard.
&nbsp;

void test(iBus *bus){ tAddressSpace Bar1;tstaticDIO *board;int i;//Loop iteration variableint dev_id ;Bar1 = bus-&gt;createAddressSpace(kPCI_BAR1);board = new tstaticDIO(Bar1);dev_id = board-&gt;IDRegister. readRegister();printf( "The Device ID is 0x%x \n",dev_id);taskDelay( 200);//Configure Digital lines of Port 0 as Output//board-&gt;IOSelect2.writeDirection(board-&gt;IOSelect2.kDirectionOutput);//Write 0x00 to 0xFF to the digital lines, can be checked by putting a break point.printf( "Writing to Port 2...\n");for(i= 0 ;i&lt;=5 ;i++) { printf( "Writing to PORT 2= %2x \n",i);taskDelay( 200);board-&gt;IOPort2Data. writeRegister( 0xFF);} delete board;bus-&gt;destroyAddressSpace(Bar1);} and here is the code for aquireBoard (no attachment)
iBus* acquireBoard( const u32 devicePCI_ID){ UINT32 vxBAR0, vxBAR1; u32 devBAR0,BAR0sz,devBAR1,BAR1sz;int busno, device, function;void *mem0,*mem1;iBus *bus;//Find the PCI BAR memory rangesif ( pciFindDevice( NI_DAQ_VENDOR_ID,NI_DAQ_DEVICE_ID,0 , &amp;busno,&amp;device,&amp;function) == OK ){ pciConfigInLong( busno,device,function,PCI_CFG_BASE_ADDRESS_0,&amp;vxBAR0 ); pciConfigInLong( busno,device,function,PCI_CFG_BASE_ADDRESS_1,&amp;vxBAR1 );devBAR0 = (u32)vxBAR0;devBAR1 = (u32)vxBAR1;printf( "Found Device = %d Bus = %d Bar0 = %08x Bar1 = %08x\n", device, busno, devBAR0, devBAR1 );} else{ printf( "Could not locate NI_DAQ DEVICE\n" );} //Memory map the BARs to get access to the PCI card's memorymem0 = (void *)devBAR0;mem1 = (void *)devBAR1;//create a new iBus which uses the memory mapped addressesbus = new iBus( 0 , 0 , mem0, mem1);bus-&gt;_physBar[0 ] = (u32)devBAR0;bus-&gt;_physBar[1 ] = (u32)devBAR1;bus-&gt;_physBar[2 ] = (u32)NULL;bus-&gt;_physBar[3 ] = (u32)NULL;bus-&gt;_physBar[4 ] = (u32)NULL;bus-&gt;_physBar[5 ] = (u32)NULL;return bus;} void releaseBoard(iBus *&amp;bus){ //unmap the memory and close whatever system resources//were used to create the iBusdelete bus;}
&nbsp;

Loading...