Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PFI12 gives error 200284

Hi,

I'm porting a Windows/NIDAQmx program to Linux/NIDAQmxBase, using a PCIe NI-6259 card. I'm receiving error 200284 on the example code below (distilled from the original program).

I do get a 4 MHz clock on the relevant external pin (P2.4) when specifying NULL as the source terminal in CfgSampClkTiming (though I know that the M series does not have an onboard clock), but when using PFI12 (which should be the ctr0 output) the program stops after the timeout specified in WriteDigitalU32 with "Some or all of the samples requested have not yet been acquired (etc)".  What I am doing wrong?

#include <NIDAQmxBase.h>
#include <stdio.h>

void ErrChk(int32 status)
{
  char buf[2048];
  if (DAQmxFailed(status)) {
    DAQmxBaseGetExtendedErrorInfo(buf, 2048);
    printf("DAQmxBase Error: %s\n", buf);
  }
}

int main()
{
  TaskHandle clkTask = 0;
  TaskHandle ddoTask = 0;
  uInt32 data[10000]; /* pulse train */

  ErrChk(DAQmxBaseCreateTask("SystemClock", &clkTask));
  ErrChk(DAQmxBaseCreateCOPulseChanFreq(clkTask,"Dev1/ctr0","", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 4000000, 0.50));
  ErrChk(DAQmxBaseCfgImplicitTiming(clkTask, DAQmx_Val_ContSamps, 1000));

  ErrChk(DAQmxBaseCreateTask("Dynamic Digital", &ddoTask));
  ErrChk(DAQmxBaseCreateDOChan(ddoTask, "Dev1/port0/line9:0", "", DAQmx_Val_ChanForAllLines));
  ErrChk(DAQmxBaseCfgSampClkTiming(ddoTask, "/Dev1/PFI12", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));
  ErrChk(DAQmxBaseWriteDigitalU32(ddoTask, 10000, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL));

  ErrChk(DAQmxBaseStartTask(clkTask));
  ErrChk(DAQmxBaseStartTask(ddoTask));

  sleep(1000);
  return 0;
}

Built with gcc -I/usr/local/natinst/nidaqmxbase/include -L/usr/local/natinst/nidaqmxbase/lib -lnidaqmxbase test.c -o test.

I read the knowledge base article on error 200284, and either it doesn't apply here since I'm not doing any reading, or  things happen behind the scenes that I'm not aware of.

Thanks in advance,
Orjan
Message Edited by Support on 10-06-2008 08:50 AM
0 Kudos
Message 1 of 2
(2,500 Views)

Since I'm in the mood for posting, let me see if I can help you with this one too.  When you set up a counter it creates a ouput task on the PFI line.  However, when you set up a task to use this same PFI it is trying to use this as an input.  I don't believe NI-DAQmx Base supports this.  You should try wiring the PFI line to a different terminal to input to the card.  Obviously this is not ideal, and I am sure that the error doesn't make sense. I'll set up something similar in a bit if I get a chance and see if I can reproduce the error.

 

Whether we get this working or not, as I mentioned in my other post, it may make sense to explore using NI-DAQmx rather than NI-DAQmx Base.  I'll let that discussion continue in your other thread:

 

http://forums.ni.com/ni/board/message?board.id=250&thread.id=42978

 

Regards,

 

Neil S.

Message 2 of 2
(2,492 Views)