DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DDC_CreateChannelPropertyDouble

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?

0 Kudos
Message 1 of 4
(3,059 Views)

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.

0 Kudos
Message 2 of 4
(3,027 Views)

'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.

 

0 Kudos
Message 3 of 4
(3,015 Views)

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');

0 Kudos
Message 4 of 4
(3,004 Views)