DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Function DDC_SaveFile(..) from the DIAdem Connectivity Library failed

Dear Sirs,
 
I'm a member of a software development project-group under the leadership of the 'German Aerospace Center' (DLR) in Berlin/Germany. Inside this project we are using the actual 'DIAdem Connectivity Library' (nilibddc.dll version 8.6 with added support for timestamps) from National Instruments for management of our data. We first contact the DIAdem Product Manager, Caroline Bright, from NI to solve our problem, but she suggested to contact the support team from NI.
 
Here's our problem:
 
It seems that inside the actual release of the DIAdem Connectivity Library there are some limitations concerning the API-function 'DDC_SaveFile' operating on a newly created TDMS-file (DDC_CreateFile). The documentation gives no further limitations on using DDC_SaveFile, so we assume we can use it at every point of constructing our TDMS object-hierarchie. That means we create new groups/channels/properties 'on demand' mixed with callings to DDC_SaveFile based on programmatic issues. Unfortunately under specific circumstances 'DDC_SaveFile' failed (with simply "The file could not be saved", that helps not much), e.g. adding new groups/channels after a previous call to 'DDC_SaveFile'. It looks like that not all error-free constructed TDMS object-hierarchies could be saved correctly. Additional information are given in a log-file produced from the library. There you can found logs like the following:
 
"ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
"
 
It would help us a lot if you could bring a little bit clarity to this obscure point.
 
Thank you very much
Thomas Zecha
0 Kudos
Message 1 of 6
(6,017 Views)

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

0 Kudos
Message 2 of 6
(5,994 Views)

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 2003

ires = 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-free

ires += 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

0 Kudos
Message 3 of 6
(5,974 Views)

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

0 Kudos
Message 4 of 6
(5,904 Views)

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 

0 Kudos
Message 5 of 6
(5,440 Views)

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)" ?   

0 Kudos
Message 6 of 6
(1,827 Views)