08-03-2011 02:06 PM
This question has to do with SCXI-1162HV, DAQmx, and Digital Signal Acquisition, but I do this programming in CVI 2010 using the SCXI-1600 USB Digitizer and DAQmx, so I'll start here.
I have seawrched many discussion forums, the examples and tutorials, and cannot find much on setting up and using the SCXI-1162HV 32-Channel Digital Input module. I did find some example code in C:\Documents and Settings\All Users\Documents\National Instruments\CVI\samples\DAQmx\Digital.
What I want to do:
I have several Analog Input cards (voltage, thermocouple, etc) in my SCXI chassis, that will be scanned at 1000 samples/second. Using DAQmxRegisterEveryNSamplesEvent(...) a callback will be alerted every 100 milliseconds to read all the sampled data from the buffer into common memory. I have a number of digital timing events that must be captured at the same rate. It would be best if the 1162HV would supply 32-bit words into the buffer at the same scan rate. Is that possible?
So far I have not found anything in DAQmx that would support such a thing. I can create a task that scans multiple analog boards, but it does not appear that I can add the 1162HV board to that task. No matter what I select in the DAQmx task generator, the generated code is always:
int32 CreateDINTask(TaskHandle *taskOut1)
{
int32 DAQmxError = DAQmxSuccess;
TaskHandle taskOut;
DAQmxErrChk(DAQmxCreateTask("DINTask", &taskOut));
DAQmxErrChk(DAQmxCreateDIChan(taskOut, "SC1_DIN/port0",
"DigitalIn", DAQmx_Val_ChanForAllLines));
DAQmxErrChk(DAQmxSetChanAttribute(taskOut, "DigitalIn", DAQmx_DI_InvertLines, 0));
*taskOut1 = taskOut;
Error:
return DAQmxError;
}
Scanning does not seem to be a possibility.
Now, going to the example code (...\Digital\Read Values\Read Dig Port-Ext Clk ) , particularly attempting to use an external clock to perform scanning, with AI clock selected, when executing these function calls:
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDIChan(taskHandle,chan,"",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,clockSource,rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,sampsToRead));
the DAQmxCfgSampClkTiming() call generates this error
08-04-2011 02:27 PM
Hendra@ngms,
Thank you for using the forums. I am sorry that you are receiving these errors. I was able to replicate your system and I have found that if I set up a digital input task in Measurement and Automation Explorer, and chose any timing beside the on demand I received an error. See screen shot. Basically what this error says, is that the only timing that the 1162HV can do is On Demand. So it doesn't appear that you can sample at your desired rate. I hope that helps.
Regards,
Brian P.
08-04-2011 02:45 PM
Brian,
This only helps in that you proved what I saw. If I had known ahead of time that the SCXI with the 1600 digitizer does not scan digital signals, I would hot have purchased it. I presume that the PXI Express and/or SC Express platforms do not suffer from this limitation, that they both scan analog and digital signals together? How do I get my money back?
Latest issue: Is the SCXI-1530 4-Ch Accelerometer module incompatible with the SCXI-1600? When I attempt to add those channels to a DAQ task and start the task, I get an error that says my SCXI configuration does not support simultaneious sample and hold.
08-04-2011 04:07 PM
Cancel that last issue with the SCXI-1530. The problem had to do with an imporoper setup on the module in the slot just to the left of the 1530. It seems to be working fine now.
Thanks
08-04-2011 04:34 PM - edited 08-04-2011 04:36 PM
Hendra,
I have done some more research and it appears your card can do buffered input but you need to use a specific DIO Card. Check out this tutorial and see if will do what you would like. In terms of getting money back, call customer service (866-ASK-MYNI) and they can transfer you to the proper place to find out if you can get your money back.
Regards,
Brian P.
08-04-2011 04:46 PM - edited 08-04-2011 04:46 PM
Hendra,
Another option that you could do, is use a trigger to trigger the digital read everytime you need a the digital line to be read. You can trigger off the analog clock, or use a software trigger to read the ports at the interval that you want. This option would allow you to continue to use your 1600.
Brian P.
08-08-2011 07:38 AM
Brian,
Thanks for the research. This application is remote, stand-alone, so there is no computer near enough to do the parallel output to a DIO card.
I will end up putting the few time critical digital signals input to an AIN module, so they can be scanned at the same high rate.