Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ->DAQmx matching

Solved!
Go to solution
Hello?
I have some DAQ functions to be converted for DAQmx. These are for PCI-6025E and USB-6218.
I'll test these for PCI-6025E first. Some of them works fine.
Is this list matching well?
DAQ                                                                                    DAQmx
---------------------------------------------------------------------------------------------------------------------------------------------------
1. To setup
----------------------------------------------------------------------------------------------------------------------------------------------------
Init_DA_Brds                                                                 -> DAQmxGetDevProductType and DAQmxGetSysDevNames
DAQ_Check                                                                   -> just check TaskHandler?
 
 
2. To use internal clock with external trigger.
-----------------------------------------------------------------------------------------------------------------------------------------------------
DAQ_Config                                                                  -> DAQmxCfgSampClkTiming
Select_Signal                                                                -> DAQmxCfgAnlgEdgeStartTrig

3. Scan setup
-----------------------------------------------------------------------------------------------------------------------------------------------------
SCAN_Setup                                                               ->?
 
4. Scan analog channels                                           (use this sequence)
-----------------------------------------------------------------------------------------------------------------------------------------------------
SCAN_Start                                                                  -> DAQmxCreateAIVoltageChan
                                                                                        DAQmxCfgSampClkTiming
                                                                                        DAQmxRegisterEveryNSamplesEvent
                                                                                        DAQmxRegisterDoneEvent
                                                                                        DAQmxReadAnalogF64
5. Counter (used this sequence in DAQ)                                        
----------------------------------------------------------------------------------------------------------------------------------------------------
GPCTR_Control( 1, ND_COUNTER_1, ND_RESET )     
GPCTR_Set_Application( 1, ND_COUNTER_1, ND_SIMPLE_EVENT_CNT )
GPCTR_Change_Parameter( 1, ND_COUNTER_1, ND_SOURCE, ND_PFI_3 );
GPCTR_Change_Parameter( 1, ND_COUNTER_1, ND_SOURCE_POLARITY, ND_HIGH_TO_LOW )
GPCTR_Control( 1, ND_COUNTER_1, ND_PROGRAM )

I counld find what matches with SCAN_Setup, for SCAN_Setup has 3 parameters such as number of channels,channel scan sequence, and gainVector.
 
Is there any DAQmx function has these parameters?
 
And as you see, DAQmxCfgSampClkTiming is used twice. Can I use it only once?
 
Final question is, what is equivalent function in DAQmx for that sequence counting in DAQ?

Thanks,
 
 

 


Message Edited by anarkie on 07-25-2008 08:11 AM

Message Edited by anarkie on 07-25-2008 08:13 AM
I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 1 of 5
(3,554 Views)
About the DAQ counter, is this code right for them?
 
 DAQmxErrChk(DAQmxCreateTask("", &handle));
 DAQmxErrChk(DAQmxCreateCOPulseChanTicks(handle,"Dev1/ctr0","","/Dev1/PFI3",DAQmx_Val_Low,0.0,50,5000));
 DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(handle,"/Dev1/RTSI0",DAQmx_Val_Falling));

 for(i=0;i<5;i++) {
  /*********************************************/
  // DAQmx Read Code
  /*********************************************/
  DAQmxErrChk (DAQmxReadCounterScalarU32(handle,10.0,&data,NULL));
  printf("\rCount: %d",data);
  getchar();
  getchar();
  fflush(stdout);
 }
 
It gave me an error; Status Code: -200460
Measurement: Read failed, because there are no channels in this task from which data can be read.
 
Thanks,
 
 
I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 2 of 5
(3,537 Views)

Hi anarkie,

A direct 1:1 correlation between the two driver functions doesn't exist but there are many example programs on how to properly construct DAQmx applications. You can find many of those at C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ after installing DAQmx with C support.

As far as your counter error, this is being caused because you are creating a counter output task. Since you are performing an output you are unable to read from this. For output tasks, simply setup you task and configure what you want to be output, and then start the task. There are great examples of this in the above file location.

I would also recommend using the following article for assistance in moving over from the Traditional DAQ driver.

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

PBear
NI RF
0 Kudos
Message 3 of 5
(3,514 Views)
Oh, thanks a lot!

Then in case of digital output, can I use the same function (DAQmxWriteBinary..) after creating a digital output with DAQmxCreateDOChan()?

Regards,


Message Edited by anarkie on 07-31-2008 09:35 PM
I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 4 of 5
(3,500 Views)
Solution
Accepted by topic author anarkie

Hi anarkie,

I would use the DAQmxWriteDigital set of functions for a digital output task. Try looking in C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values for some great examples.

PBear
NI RF
0 Kudos
Message 5 of 5
(3,479 Views)