06-04-2008 03:37 AM
06-05-2008 07:03 AM
Hello Thomas,
can you please provide a code snippet which can reproduce the error you reported to
stefan DOT romainczyk AT ni DOT com
Thanks and greetings from rainy Aachen
Stefan
06-06-2008 06:28 AM
Hi Stefan,
thank you for your response!
Here's the code (It is an extract of order/parameter-seetings of DDC_.. functions called by our high-level TDMSFilter-Library, so it looks somewhat strange, nevertheless it is equivalent and produces the error):
I have checked that there are no empty channels/groups are saved.
-------------------------------------------------------------------------------
void
vReproduce_DDC_SaveFile_Error_v2(){
DDCFileHandle hfile;
DDCChannelGroupHandle hgroup_data_packet;
DDCChannelGroupHandle hgroup_operation_hk;
DDCChannelGroupHandle hgroup_science_hk;
DDCChannelHandle hchannel_data_packet_pck_stream_1;
DDCChannelHandle hchannel_data_packet_index_pck_stream_1;
DDCChannelHandle hchannel_operation_hk_mertis_mode_1;
DDCChannelHandle hchannel_science_hk_tec_temperature_1;
int ires; unsigned int iexist; unsigned __int64 uinum_data_values; unsigned int iindex = 0; unsigned short xusdata[4096]; // this code produces error-code 'DDC_CouldNotSaveFile' in the last call to DDC_SaveFile(..) under MSVC 2003ires = 0;
ires += DDC_CreateFile(
"test.tdms", "TDMS", "test", "test", "test", "test", &hfile);ires += DDC_AddChannelGroup(hfile,
"DATA_PACKET", "", &hgroup_data_packet);ires += DDC_AddChannel(hgroup_data_packet, (DDCDataType)2,
"pck_stream:1", "", "", &hchannel_data_packet_pck_stream_1);ires += DDC_CreateChannelProperty(hchannel_data_packet_pck_stream_1,
"index_type", (DDCDataType)23, "indirect");ires += DDC_CreateChannelProperty(hchannel_data_packet_pck_stream_1,
"index_name", (DDCDataType)23, "index_pck_stream:1");ires += DDC_AddChannel(hgroup_data_packet, (DDCDataType)3,
"index_pck_stream:1", "", "", &hchannel_data_packet_index_pck_stream_1);ires += DDC_ChannelPropertyExists(hchannel_data_packet_pck_stream_1,
"generation_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_data_packet_pck_stream_1,
"generation_timestamp_name", (DDCDataType)23, "time_generation:1");ires += DDC_ChannelPropertyExists(hchannel_data_packet_pck_stream_1,
"storage_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_data_packet_pck_stream_1,
"storage_timestamp_name", (DDCDataType)23, "time_storage:1");ires += DDC_GetNumDataValues(hchannel_data_packet_pck_stream_1, &uinum_data_values);
ires += DDC_AppendDataValues(hchannel_data_packet_index_pck_stream_1, &iindex, 1);
ires += DDC_AppendDataValues(hchannel_data_packet_pck_stream_1, xusdata, 25);
ires += DDC_AddChannelGroup(hfile,
"OPERATION_HK", "", &hgroup_operation_hk);ires += DDC_AddChannel(hgroup_operation_hk, (DDCDataType)2,
"mertis_mode:1", "", "", &hchannel_operation_hk_mertis_mode_1);ires += DDC_ChannelPropertyExists(hchannel_operation_hk_mertis_mode_1,
"generation_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_operation_hk_mertis_mode_1,
"generation_timestamp_name", (DDCDataType)23, "time_generation:1");ires += DDC_ChannelPropertyExists(hchannel_operation_hk_mertis_mode_1,
"storage_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_operation_hk_mertis_mode_1,
"storage_timestamp_name", (DDCDataType)23, "time_storage:1");ires += DDC_AppendDataValues(hchannel_operation_hk_mertis_mode_1, xusdata, 1);
ires += DDC_SaveFile(hfile);
// obscure: commenting the next line let the last call to DDC_SaveFile(..) be error-freeires += DDC_AppendDataValues(hchannel_data_packet_index_pck_stream_1, &iindex, 1);
ires += DDC_AddChannelGroup(hfile,
"SCIENCE_HK", "", &hgroup_science_hk);ires += DDC_AddChannel(hgroup_science_hk, (DDCDataType)2,
"tec_temperatur:1", "", "", &hchannel_science_hk_tec_temperature_1);ires += DDC_ChannelPropertyExists(hchannel_science_hk_tec_temperature_1,
"generation_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_science_hk_tec_temperature_1,
"generation_timestamp_name", (DDCDataType)23, "time_generation:1");ires += DDC_ChannelPropertyExists(hchannel_science_hk_tec_temperature_1,
"storage_timestamp_name", &iexist);ires += DDC_CreateChannelProperty(hchannel_science_hk_tec_temperature_1,
"storage_timestamp_name", (DDCDataType)23, "time_storage:1");ires += DDC_AppendDataValues(hchannel_science_hk_tec_temperature_1, xusdata, 1);
ires += DDC_SaveFile(hfile);
ires += DDC_CloseFile(hfile);
----------------------------------------------------------------------------------------------
Greetings
Thomas
06-16-2008 07:05 AM
Hi Thomas,
in the current version of the TDM-C-DLL appears to be a problem when directly calling DDC_AppendDataValues after DDC_SaveFile.
You can work around that problem by inserting a call to DDC_GetFileProperty after DDC_SaveFile and before you access any other data in that file.
Greetings from sunny Aachen
Stefan
06-11-2009 01:40 AM
Hello,
I have the same problem as Thomas. All 10 seconds I want to save the collected data. But every call produced the failure "ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530)". I've added also the DDC_GetFileProperty call after DDC_FileSave. But it doesn't change anything. I'm using the DDC library version 8.6.
Does there exist a new library, which has fixed the problem?
Thanks,
David
12-08-2022 07:45 AM
This is an old topic. Using the latest TDM C DLL, and I am also doing "SaveFile" between each appending data call. Has anyone figured out how to solove the "ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530)" ?