12-06-2016 12:52 PM
In Matlab use the type-safe version of function "int DDC_CreateChannelPropertyDouble (DDCChannelHandle channel, const char *property, double value)"
Script:
[err,dummyVar,dummyVar,dummyVar,timechan]=calllib(libname,'DDC_AddChannel',timegrp,'DDC_Double',channame,chandesc,chanunitstring,timechanIn);
[err,dummyVar,dummyVar]=calllib(libname,'DDC_CreateChannelPropertyDouble',timechan,'wf_start_offset',0.0);
Error using calllib
No method with matching signature.
[err,dummyVar]=...'DDC_CreateChannelPropertyDouble'... return error:
Code Defined Constant Error Message
6202 DDC_InvalidArgument An invalid argument was passed to the library
Therefore "0.0" (for example) is the cause of the error?
12-07-2016 06:01 AM
Shouln't timechan be timechanIn.
I have no idea of mathscript but the only error I can think of is that timechan has no valid value.
12-07-2016 11:45 PM
'DDC_Double' in DDC_AddChannel is an enumeration.
typedef enum { DDC_UInt8 = 5, // unsigned char DDC_Int16 = 2, // short DDC_Int32 = 3, // int DDC_Float = 9, // float DDC_Double = 10, // double DDC_String = 23, // string DDC_Timestamp = 30, // timestamp (Year/Month/Day/Hour/Minute/Second/Millisecond components) } DDCDataType;
so it must be an integer value. The result of your DDC_AddChannel allready failed.
Please check the result of the first call.
12-08-2016 02:53 PM - edited 12-08-2016 02:54 PM
Thanks for answers.
But how to explain that the next script works:
% Add a new Time channel to channel groups
chanunitstring = 'm/s^2';
timechanIn = 0;
channame = ['Waveform'];
chandesc = ['Waveform channel'];
[err,dummyVar,dummyVar,dummyVar,timechan]=calllib(libname,'DDC_AddChannel',timegrp,'DDC_Double',channame,chandesc,chanunitstring,timechanIn);
[err,dummyVar,dummyVar]=calllib(libname,'DDC_CreateChannelPropertyString',timechan,'wf_xname','Time');
[err,dummyVar,dummyVar]=calllib(libname,'DDC_CreateChannelPropertyString',timechan,'wf_xunit_string','s');
[err,dummyVar,dummyVar]=calllib(libname,'DDC_CreateChannelPropertyString',timechan,'wf_time_pref','Relative');