From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

New to NI-DAQmx? Check out the new Getting Started with NI-DAQmx Series!

Hi Matt;
 
Thanks for the detailed reply......I had just downloaded the readme file for version 8.5 of the driver so I guess I was on the right track.  However, it's nice to get clarification from a proven regular!  Regards,
 
ajwalsh
0 Kudos
Message 11 of 35
(3,496 Views)

hi, i using ni daq for voltage generation. I used an example for ANSI C and changed some things but in general is the same

int32 res;
 int n;
 CString cadena;
 int32 indice;
 float64 data[2500], f;

 f = m_frec * 1000.0;
 n = 250000/f ;
 
///Genera la señal de salida/////////////////////////////////////


 for(indice=0; indice<2500; indice++)
 {
  data[indice] = Amplitud*sin((double)indice*2.0*PI/n);
 }

 res=DAQmxCreateTask("",&Genera);
 //cadena.Format("%d", res);
 //AfxMessageBox(cadena,MB_OK, 0);
 
 DAQmxCreateAOVoltageChan(Genera,"Dev3/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL);
 //cadena.Format("%d", res);
 //AfxMessageBox(cadena, MB_OK, 0);

 DAQmxCfgSampClkTiming(Genera,"",250000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,2500);
 //cadena.Format("%d", res);
 //AfxMessageBox(cadena, MB_OK, 0);

 DAQmxWriteAnalogF64(Genera,2500,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL);
 //cadena.Format("%d", res);
 //AfxMessageBox(cadena, MB_OK, 0);

 res=DAQmxStartTask(Genera);

 if (res!=0)
 {
  DAQmxStopTask(Genera);
        DAQmxClearTask(Genera);
 }
 
   cadena.Format("%d", res);
   AfxMessageBox(cadena, MB_OK, 0);
 

the message box gave me an idea of the process  now i want to eliminate them, but if i put off all the message the program don't work, then how can i put off the message ?

0 Kudos
Message 12 of 35
(3,398 Views)

Hi alberick,

What do you mean that your program is not working?  Are you receiving an error when you run this program?  Are you able to generate an analog voltage? 

There is still one Message Box that is not commented out.  Is this the message box that is showing up?  Is this why the program is not working correctly?

 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 13 of 35
(3,363 Views)
hello everyone,

i`m using daq 6251 for voltage measurement  and port scanning. i achieved  this  by  attaching new channel to new task, but this is quite brutal solution (i think).  so i need help, because i`m going to scan matrix's which consists from 40000 point and now takes about 6h to do this, so even millisecond is important 😉 and for the bigger pleasure i do all this with Delphi language, but those, who have done this in c/c++ should be able to help me. so does anyone know how can i carry out more than one measuring procedure in one task ? now my code looks like that:

DAQmxCreateTask('',@AnTask);
DAQmxCreateAIVoltageChan(AnTask,'Dev1/ai0','',DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_VoltageUnits1_Volts,NIL);
DAQmxCfgSampClkTiming(AnTask,'',10000.0,DAQmx_Val_Rising,DAQ_Val_AcquisitionType_FiniteSamps,konstanta);
DAQmxStartTask(AnTask);
DAQmxReadAnaloF64(AnTask,konstanta,5.0,DAQmx_Val_GroupByChannel,@data1,konstanta,@read1,NIL);
//konstanta is integer value of points, i need

then i read and output acquired values, stop and clear task, and repeat all this with Dev1/ai1 instead of Dev1/ai0. Similar things with ports. Then i tried Dev1/ai0: Dev1/ai1 programe gave me strange values and i don`t really understand how data1 array is organized... so if any suggestions or information, i would be very grateful.

p.s.: i have read help and examples many times, but it was little help

regards justas   

Message Edited by kaimietiz on 07-10-2007 04:17 AM

0 Kudos
Message 14 of 35
(3,177 Views)

Hello Kaimietiz,

It is recommended to set your data acquisition into three steps.  The first step will be creating and configuring the task.  The second step will be reading the data from the NI-6251.  The last step will be stopping and clearing the task.  You would only want to create and configure as well as stopping the task once.  When you actually read or acquire the data, you would want this section of your code inside a loop.  The first and last steps should be outside the loop and should only be executed once. 

In order to read from two channels at the same time, you would want to set your device name like this: “Dev1/a1:a2”.  Your data will be put into a 1-D array that is either interleaved or not.  The “fillmode” parameter in the DAQmxReadAnaloF64 function will determine if the data is interleaved. 

If the data is interleaved then the data will look like the following.

A1   Sample 0

A2   Sample 0

A1   Sample 1

A2   Sample 1

A1   Sample 2

A2   Sample 2

If the data is not interleaved then the data will look like the following.

A1   Sample 0

A1   Sample 1

A1   Sample 2

A2   Sample 0

A2   Sample 1

A2   Sample 2

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 15 of 35
(3,147 Views)
Thank You Robert F,
I did one stupid mistake and so my code didn`t work, but now it`s ok Smiley Wink still it was nice to have some support;)

Thankfully,
Justas
0 Kudos
Message 16 of 35
(3,117 Views)
I am a french student. I am a problem for my  labview program. when I launch my source code labview, labview is not able to launch me my front face. But on the PC it only the runtime of labview 8.2 which is install. Labview posts there also the lack of VI DAQmx.create channel (AI voltage-BASIC).

                                               think you
0 Kudos
Message 17 of 35
(3,085 Views)

Hi Stebio,

It sounds like you do not have DAQmx installed on the deployment computer. You can download DAQmx 8.5 here. When developing an application, all drivers and run-time engines used on the development machine also need to be installed on the deployment machine.

Also, I would like to ask that new threads be started for any new questions. This not only keeps issues separate, but helps when searching the forums for answers.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 18 of 35
(3,060 Views)

Hi everyone,

I'm using NI PCI-6221. First I installed the NI-DAQmx 8.5 and then I turned off the PC and plug in the NI 6221 to the PCI slot. Then when I re-boot the PC detected the new hardware (the NI 6221).

Unfortunately, when I run the Measurement and Automation program (version 4.2), I could not found "NI-DAQmx Device" under "Devices and Interfaces". The NI 6221 appears under "PXI System" instead. When I run LabView Signal Express, the program doesn't detect any DAQ device.

I'm using Windows 2000 Profesional.

 

Thanks

0 Kudos
Message 19 of 35
(2,868 Views)
Hi nasrul,

Thank you for posting on the National Instruments forums.
If you go into Device Manager in Windows, do you see the card show up as a Data Acquisition Devices?  To get to the Device Manager, press Start and Pause on your keyboard or right click on My Computer and click on Properties.  In the Hardware tab, click on Device Manager.  One thing you might try is to right click on the device in Device Manager and click on Update Driver... and follow the steps.
If you see the device in Device Manager then it should show up in MAX.

As a last resort, I have seen this issue fixed by removing the MAX database.  Are there any other cards that are not showing up? 
Follow the steps in this knowledge base article:  Why Do I Get a Measurement & Automation Explorer (MAX) Database Connection Error?
This is not the error that you are seeing, but I have seen renaming the data folder fix the issue before.  Make sure and just rename the data folder, not delete it, so that you can revert to it if needed.


Message Edited by Nick F on 08-15-2007 04:32 PM

Thank You,

Nick F.
Applications Engineer
Message 20 of 35
(2,852 Views)