Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

how to setup PXI 6534 output digital pattern

Hello,
 
In my project there is a need of ~500k data points output using PXI 6534, before calling NIDAQMakeBuffer(..), I malloc() or using data[] array to setup output data, program seems running correctly, in fact, only first 8 or 10 data output, it is 0,2047,...., pair pattern, why this happen?
 
When I try to use static array to hold the data, no matter the array size is 20, 40, 100, or 200, after NIDAQMakeBuffer(..), the array contains some kind of 0,2047,2047,0, data pattern, I have no way to put in my data. any advice,suggestions is appreciate.
 
TF
0 Kudos
Message 1 of 3
(3,427 Views)

Hello Export Signal,

The NIDAQMakeBuffer is a function that allows you quickly output a specific signal. The reason you are seeing the 0,2047 pattern is because of data type you selected.  I am assuming that you are using WFM_DATA_I16, and this creates a 10 period square wave between 0 and 2047.  Please have a look at the help file that is attached (Reference>>NI-DAQ Examples Utility Functions) NIDAQEX.help

I have also linked another form post that is related to your issue and might help be of use.

http://forums.ni.com/ni/board/message?board.id=250&message.id=2895&requireLogin=False

As for your application, the driver you are using is our Traditional (Legacy) driver, which is no longer being upgraded and is much more complex to use than our newer driver DAQmx.  We strongly suggest using our new driver (which is free) for developing new code so that the code can be upgraded with new versions of the driver as it comes out.  The Traditional DAQ driver will not be supported on new operating systems, and our new hardware cannot be used with the old driver.  The new driver also has much more documentation and example programs written for it, to the point that a majority of applications require little or no modification of an example.

You can find the latest DAQmx driver at, http://joule.ni.com/nidu/cds/view/p/id/950/lang/en and upon installation full examples will be installed for many programming languages, and you can easily use and modify these to suit your specific applications.  If there is a reason that requires you to use Traditional NI-DAQ please refer to Start>>All Programs>>National Instruments>>NI-DAQ>>Traditional NI-DAQ function reference help.  This help file will contain lots of information about using the traditional NI-DAQ driver. 

If you still need assistance can you also provide some additional information.  What programming language are you using, what version of the NI-DAQ driver are you using, and can you give us a more detailed explanation of what you are trying to accomplish with your application.  This information will help lead to a better solution.

Have a good evening

Chris_K

0 Kudos
Message 2 of 3
(3,412 Views)

Hi Chris_K,

Thank you ! As I stand behind the project, and the PXI 6534 really takes me too much time. And up to today I cannot let the card output data correctly.

first let me explain more about my project. I use pxi 1042 chassis which has 6 NI cards( 6602,5412,5122,6723,6220,6534) and may add another one later. all the cards have to be sychronized to output/input. PXI 6534 is response to output 16bit digital data which then input a DAC board to generat high voltage. all code is compiled in MS VC++ 6.0 in Windows XP.

Infact, I spent more a week try to program 6534 using DAQmx 8.6 C API . However, the data output is completely ignore trigger, though the code works great on other daq board, the same code does not work on PXI 6534, I read PXI 653x manual and related documents, examples, cannot let PXI 6534 tke care of trigger, the code is shown as follows.

have a problem to trigger PXI 6534 to do digital output. The trigger is come from Counter PXI 6602.  the key part is list as follows:

 
err = DAQmxCreateTask("",&digtask);
 err = DAQmxCreateTask("",&counter1);
  err = DAQmxCreateDOChan(digtask,"dev1/port2_16","",DAQmx_Val_ChanForAllLines);
  err = DAQmxCfgSampClkTiming(digtask,NULL,1000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,2);
  err = DAQmxWriteDigitalU16 (digtask, 2,0,10, DAQmx_Val_GroupByChannel,data,&Written, NULL);
  err = DAQmxGetErrorString (err,errbuff, 2048);
   err = DAQmxCfgDigEdgeStartTrig (digtask,"/dev1/PXI_Trig1", DAQmx_Val_Rising );
  err = DAQmxStartTask(digtask);
  err = DAQmxGetErrorString (err,errbuff, 2048);
   
  err = DAQmxCreateCOPulseChanTime(counter1,"dev2/ctr1","",
          DAQmx_Val_Seconds,DAQmx_Val_Low,0.001,0.005,0.01);
  err = DAQmxGetErrorString (err, errbuff, 400);
  err = DAQmxExportSignal(counter1, DAQmx_Val_CounterOutputEvent, "/DigitalIO/PXI_Trig1");
 // err = DAQmxConnectTerms ("/dev2/Ctr1InternalOutput", "/dev2/RTSI1",DAQmx_Val_DoNotInvertPolarity );
 // err = DAQmxConnectTerms ("/dev1/RTSI1", "/dev1/PFI3",DAQmx_Val_DoNotInvertPolarity );
  err = DAQmxGetErrorString (err,errbuff, 2048);
  err = DAQmxStartTask (counter1);
 
 

Would you tell me what's wrong with the code? a Application enginner suggest my code has order problem, the result is his idea does not work. finally, I believe the API does not support PXI 6534 and decide to use ild version of API DAQ 6.9, which leads the result I put in the above post, it require NIDAQMakeBuffer functiona call, I real the function specification and the code like:

i16 reampdata,

...

rampdata = (i16*)malloc(total*sizeof(i16)); //total is the data number

iStatus = NIDAQMakeBuffer(rampdata,total, WFM_DATA_I16).

after the function call, if I check the rampdata, all change to 0,2047,.. pair pattern. You are right, the function tells It will generate 10 sqaure wave . I am confused the specification, it means no matter what the buffer size, the function will convert to 10 square wave, right? if so, how to setup output data? If I do not call the function, get a error of " there is no DMA channel", What to do? Please help, any suggestion may solve the problem. Thanks.

TF

0 Kudos
Message 3 of 3
(3,406 Views)