Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Write TDM using WriteFile.m

hello,

        I tried to write a TDM file using the WriteFile.m example given in http://zone.ni.com/devzone/cda/epd/p/id/5957   . It writes to the file but when I try changing the number of elements by changing the length of the time array t on line 27 , the ammount of data written to the TDM file remains the same.

 

The line

 

[err,dummyVar] = calllib(libname,'DDC_SetDataValues',sinechan,Sine(:,i),length(t));

 

returns the err variable as -6208. What could be a possible solution to this?

 

Umar.

0 Kudos
Message 1 of 2
(2,688 Views)

Hello Umar,

 

Thanks for using the forums.

 

In this partciular example, the vector list "t" is initialised at line 22 as follows: t=(0:0.1:200). This creates a list from 0 to 200 in 0.1 increments. The function "length(t)" returns the length of the array t which has previously been defined, therefore if you wish to alter the length you will need to change the initialised length. If you wish to keep the same 0.1 increments this can be done by simply changing the 200 to an upper range limit you desire.

 

If you are not familiar with MATLAB programming, some further reference material on the language can be found at the following link: http://www.mathworks.co.uk/help/techdoc/matlab_prog/bqjgwp9.html

 

I hope that helps.

 

Kind Regards,

0 Kudos
Message 2 of 2
(2,677 Views)