Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. 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.