cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How Update data of tag to data in INFOTABLE ?

Theeradache
7-Bedrock

How Update data of tag to data in INFOTABLE ?

I try to bring the value to INFOTABLE by Service script but yet unsuccessful

Please ask for advice on solving problems.

 

02.png03.png

1 ACCEPTED SOLUTION

Accepted Solutions

Still not sure what you are looking for. Maybe the AddOrUpdateDataTableEntry function? This could look like this.

 

// Create Infotable
var params = {
    infoTableName: "InfoTable" /* STRING */,
    dataShapeName: "<Your Shape>" /* DATASHAPENAME */
};
var values = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
 
var value = {
    Tag1: 1000,
    Tag2: 1
};

// Fill Infotable
infoTable.AddRow(value);

me.AddOrUpdateDataTableEntry({
	values: values
});

View solution in original post

4 REPLIES 4

Hi @Theeradache ,

 

some more information of what you already have and what you want to achieve would be helpful. Assuming you want to add new rows to your Infotable for each change you can add a subscription to the DataChange Event of Value01 and add to the Infotable in the script.

 

Regards

Benny

HI @bbeuckSIG 

I created tag INFOTABLE for doing pie chart.

by Column Tag1 is data, Column Tag2 is Name of data

 

I want to bring Value01 link with Column Tag1 and Row 1,Value02 link with Column Tag2 and Row 1

I tried the test using only 2 data for test data transfer Value01 and Value02 to INFO01

I tried to do it using Service script but not yet finished.

 

Would you advice what I could do?

Thank you

Theeradaech

Still not sure what you are looking for. Maybe the AddOrUpdateDataTableEntry function? This could look like this.

 

// Create Infotable
var params = {
    infoTableName: "InfoTable" /* STRING */,
    dataShapeName: "<Your Shape>" /* DATASHAPENAME */
};
var values = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
 
var value = {
    Tag1: 1000,
    Tag2: 1
};

// Fill Infotable
infoTable.AddRow(value);

me.AddOrUpdateDataTableEntry({
	values: values
});

 

Hi @bbeuckSIG 

      I'm sorry for the late reply

      Your method is the way I find it. 

      thank very much

 

Top Tags