Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi I am trying to update values to my value stream using the Extension SDK. However the values are not getting changed on Thingworx.
InfoTableFunctions functions = new InfoTableFunctions(); InfoTable table = functions.CreateInfoTableFromDataShape(propertyName, propertyName+"Shape"); ValueCollection row = new ValueCollection(); for (Entry<String, Double> entry: dataMap.entrySet()) { row.SetStringValue(keyField, entry.getKey()); row.SetNumberValue(valueField, entry.getValue()); row.SetDateTimeValue("ds_timestamp", now); table.addRow(row.clone()); } myThing.AddInfoTableValueStreamEntry(now, propertyName, table);
//mtConnectDeviceThing.setPropertyValue(propertyName, new InfoTablePrimitive(table)); // this works, but not sure if it will add to the stream.
Solved! Go to Solution.
mtConnectDeviceThing.setPropertyValue(propertyName, new InfoTablePrimitive(table));
This will work as long as your property is configured to be "logged".
Another question is why in the code snippet is one line trying to log to "myThing" and in the code above it is named "mtConnectDeviceThing". Are these two different Things?
Thanks,
Adam
mtConnectDeviceThing.setPropertyValue(propertyName, new InfoTablePrimitive(table));
This will work as long as your property is configured to be "logged".
Another question is why in the code snippet is one line trying to log to "myThing" and in the code above it is named "mtConnectDeviceThing". Are these two different Things?
Thanks,
Adam
Thanks Adam. I have added the 'isLogged' aspect to the Thing properties and it is working fine now.
The 'mtConnectDeviceThing' was a typo. I forgot to update it in the commented code.