News:

We really need your input in this questionnaire

Main Menu

Bug on CreateDCI Function

Started by AleCoelli, April 02, 2022, 01:24:26 PM

Previous topic - Next topic

AleCoelli

Hi, I think that on 4.0-2227 ther's a bug in CreateDCI Function, in docs pollingInterval parameter should be 0 for "default", but if you use it the new DCI will have 0 as pollinInterval time. If I use null all seems to be fine.
retentionTime parameter works fine with "0", but with null do strange things, randomly some DCI will have default, somother will have a blank value

Test script to test it:


NodeName="xxxxx";  //existing node name

Mynode = FindObject(NodeName);

value=%(1,2,3,4,5,6,7,8,9,10);  //new dci names

for (v : value) {
     if (!FindDCIByName(Mynode, v))
     {
      println("-------------------NEW----------------------------");
newDci = CreateDCI(Mynode, DataSource::INTERNAL, v , "TEST " . v, DCI::FLOAT, null, 0);  // <<-- null,0 = OK  // null,null = random retentionTime result // 0,0 = 0 pollingInterval set
     }
    else
    {
    println("-------------------" . NodeName . "->". v . "  ALREADY EXIST----------------------------");
    }
}


Thanks
Alessandro

Filipp Sudanov

Hi!

Yes, it's a bug, it will be fixed and included in next patch release.