Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Acquisition through Matlab (Simulink)

I have recently acquired a data acquisition card (model: DAQmx NI PCI-6229) so as to measure and characterize some devices. My intention is to transfer some digital output data to Matlab (Simulink) and then perform some digital signal processing using Simulink blocks. More analytically the digital signal is a bitsteram (a sequence of “0” and “1”) with a specific stable frequency which has to be acquired from Matlab (and so synchronization is also very important). In order to conduct this kind of testing I use the “Data Acquisition toolbox” and more specifically the Simulink blocks “Analog Input” and “Digital Input”. However, although for analog measurements things are straightforward, since “Analog Input” can be easily adjusted, (sampling rate could be set) there is a problem when using the “Digital Input” block. The only parameter that could actually be selected is the number of the digital channels of the acquisition card and there is no way to adjust sampling rate. Could you please provide me any guidelines so as to establish the communication between Matlab and the Data Acquisition Card? In addition can I set somehow the sampling rate through an external stable clock so as to synchronize data acquisition with the devices I measure (triggering)?

 

Thank you in advance,

 

Gerasimos

0 Kudos
Message 1 of 2
(5,834 Views)

Hello Gerasimos,

 

I am not too familiar with the environment you are working in, but I do have some suggestions about the hardware you are working with.  The 6229 does not have a direct clock to do digital input with.  Instead it is software timed which just means the line state is returned whenever the software calls into the driver.  I do not know how you would implement it, but to have hardware timed sampling on a digital line, you will need to correlate the first port of your 6229 to another clock that is running (like the AI or AO sample clock).  

 

A few other resources you can check out are this thread, this site, or this DevZone.   Also, I am not sure of the exact syntax used (I know it's C based), but the DAQmx C Reference Help will tell of all of the function calls you can use with the DAQmx driver.  You can find it at All Programs»National Instruments»NI-DAQ»Text-Based Code Support.  There is the reference guide here and a link to a folder with some C code.  I hope these options help, but please post back if you're still stuck. 

ColeR
Field Engineer
0 Kudos
Message 2 of 2
(5,806 Views)