DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous logging data in TDMS using C# - Appending data after saving file

I am working on a project to continuous logging data for long time. Here are some example code to show what I am trying to do.   

I need to save the file at certain interval and keep appending new data.

 

I am getting below error from the log file:

 

***************** New logfile section *******************
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):
TDMS: ERROR: TDS Exception in GetProperty: Tds Error: TdsErrObjectTransactionPending(-2530):

 

 

Looks like ths error is becase of appending data after saving the file. Anyone can show me how to do this?

 

 

for (int j = 0; j < 100; j++)
{
    for (int i = 0; i < 100; i++)
    {
        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel0, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel1, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel2, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel3, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel4, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel5, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel6, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }

        if (chk == true)
        {
            ret = DDC_AppendDataValuesDouble(pChannel7, data, (ulong)data.Count());
            chk &= ddcChk(ret);
        }
    }

    if (chk == true)
    {
        ret = DDC_SaveFile(pfile);
        chk &= ddcChk(ret);

        Debug.WriteLine("Save file # = " + j);

    }

}
if (chk == true)
{
    ret = DDC_CloseFile(pfile);
    chk &= ddcChk(ret);
}

  

0 Kudos
Message 1 of 1
(339 Views)