Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read NI USB 6210 Datas in VC++ ?

Hi,
 
i bought a NI USB 6210 an i wanted to analyse the Datas from the Analog Inputs in my VC++ project. I am totaly new in that business  and don't know how to start it.
Question: How can i get the Datas from the Device and how can i configure it?
 
Michael
 
P.S. I want to do it without any NI Software
0 Kudos
Message 1 of 9
(9,115 Views)
hello michael,

you can find examples for DAQ programming on your machine, after you installed the driver NI-DAQmx.
you find further information here:
http://digital.ni.com/public.nsf/allkb/E0D14AB889CBF8E5862572B8006B22D3?OpenDocument

and a tutorial here:
http://zone.ni.com/devzone/cda/tut/p/id/5409

kind regards,

robert h
NI germany
0 Kudos
Message 2 of 9
(9,094 Views)

Thank you for the link!

 

I tried to run the exampleVC_Acq_IntClk_AnlgStart and at the point DAQmxCfgAnlgEdgeStartTrig . The following errormessage occurs on the console:

        Measurements: Requested value is not a supported value for this property.
        Property: DAQmx_StartTrig_Type
        You Have Requested: DAQmx_Val_AnlgEdge
        You Can Select: DAQmx_Val_DigEdge, DAQmx_Val_None

        Task Name: MyTask

        Status Code: -200077

I tried to follow the method with the debugger but he jumps directly to the errorhandling.

How can i change the DAQmx_StartTrig_Type ?

 

 DAQmxErrChk (DAQmxCreateTask("MyTask",&taskHandle));
 DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
 DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));
 DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig(taskHandle,"ai1",DAQmx_Val_Rising,1.0));  // => above Error occurs
 DAQmxErrChk (DAQmxSetAnlgEdgeStartTrigHyst(taskHandle, 1.0));



Message Edited by der_micha1981 on 05-23-2008 05:35 AM
0 Kudos
Message 3 of 9
(9,075 Views)

Sorry Multible Post



Message Edited by der_micha1981 on 05-23-2008 05:34 AM
0 Kudos
Message 4 of 9
(9,075 Views)
Sorry Multible Post


Message Edited by der_micha1981 on 05-23-2008 05:33 AM
0 Kudos
Message 5 of 9
(9,075 Views)
hello michael,

the error indicates, that you cannot use an analog starttrigger with the device you use.
you must use a digital trigger with:
DAQmxCfgDigEdgeStartTrig()

kind regards,

robert
0 Kudos
Message 6 of 9
(9,034 Views)

you are right. Analog triggering is not supported at NI-USB 621x . I made it with a digital trigger (for test aplication).

For our app we want to use something like a ring buffer: We want continuously read datas from 3 AIs and check the samples at the same time (or a little bit later ;-). There is an example "Software Circular Buffer Component" but its for LabVIEW Base Package 8.5. (I don't have that software)

Is it possible to make such an example for C or is there a special funktion witch i can use for it?

 

Michael

0 Kudos
Message 7 of 9
(9,006 Views)
hello michael,

could you describe a little bit more about your applicaction?
does the trigger event occur continuously?
or do you just acquire the data continuously?

kind regards,

robert
0 Kudos
Message 8 of 9
(9,004 Views)

wow! what a fast answer!

 

i wana read a pulse which is just some milliseconds long. Most time, the value is something around zero. I want to read continously the samples and if the mean of the value in a timespan is diffrent from zero i wana have e.g the last 1000 samples from the beginning of the increasing value and, of course, the samples from the pulse.

Regards

Michael

0 Kudos
Message 9 of 9
(9,000 Views)