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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Unable to set infotable from edge

manasvi
12-Amethyst

Unable to set infotable from edge

I am setting an infotable from java sdk edge, but the value is updated only the first time.

For example the following code sets the infotable correctly in the first iteration of the while loop

 

while(true){

	this.setPropertyValue("SomePropertyName", new InfoTablePrimitive(myClass.returnsNewInfotable()));
	this.updateSubscribedProperties(1000);
	
}

 

In the second iteration , the value is not changed, i.e. even if the function returnsNewInfotable returns an infotable with different values, only the initial values are reflected in thingworx server.

10 REPLIES 10
CRArko
17-Peridot
(To:manasvi)

Hello,

 

We're going to need some more information to figure this out. Are there error messages in the logs on the Edge or on the Server?

 

And is the relevant property persisted on the platform?

 

Thanks,

 

-- Craig A.

manasvi
12-Amethyst
(To:CRArko)

Hi Craig,

There are no relevant logs both on edge and TW server. 

I have attached the screenshot of the aspects of the infotable property, I hope they are ok?

My observation is , as I posted earlier that , infotable once set by edge is not updated, when set again from edge, through the call 

this.setPropertyValue("SomePropertyName", new InfoTablePrimitive(myClass.returnsNewInfotable()));

I hope this is correct code for infotable, I face no problems when I do this for Integers, Strings etc.

 

Regards,

Manas

slangley
23-Emerald II
(To:manasvi)

Hi @manasvi.

 

What we really need are the trace logs from the edge side to determine what is being sent on the first attempt at updating the infotable.  That will help determine where the issue is--the Platform ignoring the first try or the edge not sending data (or sending incorrect data).

 

Regards.

 

--Sharon

manasvi
12-Amethyst
(To:slangley)

Hi Sharon,

Please find the attached log file, edge side (LogsForPTCForum.txt)

Please have look around the line numbers 6505,7300

Logs of the tomcat server are attached as (serverSideLog.txt)

I have also attached the relevant piece of code as code.txt

 

Let me know if there are anything else I can have a look at.

 

Regards,

Manasvi

manasvi
12-Amethyst
(To:manasvi)

I Just noticed that instead of setproperty method, writeproperty works fine.

slangley
23-Emerald II
(To:manasvi)

Hi @manasvi.

 

We are going to do further testing on this to validate.  We were expecting the setproperty method to work, as well.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @manasvi.

 

We noticed that in your original post you indicated you were using setPropertyValue but in your post regarding the solution, you indicated you were able to get writeProperty vs. setProperty to work.  Can you please confirm which services you were using?

 

If you can provide more of your code (or all of it, if possible), it will help to provide some context around the issue you were initially experiencing and help us in recreating the issue.

 

Regards.

 

--Sharon

 

manasvi
12-Amethyst
(To:slangley)

Hi @slangley,

I am not 100% sure how I used setPropertyValues initially as I tried lots of different methods to solve it, however for setProperty I am sure that it does not work as expected, i.e. I  could only send values once,inside the process scan request loop. On the next iteration of the loop, when the values of the Infotables on edge had changed, I was unable to see the Infotable change on the TW server. 

I have attached relevant piece of code with some comments for clarity.

 

Let me know if you need more information, or was I supposed to use setPropertyValues differently for Infotables.

Also, are you able to reproduce the issue?

 

manasvi
12-Amethyst
(To:slangley)

Hi Sharon,

Were you able to replicate the issue? In case you need more information, I would be glad to provide.

 

Regards,

Manas

slangley
23-Emerald II
(To:manasvi)

Hi @manasvi.

 

We are still working on it.  As soon as we have more information, I will post an update.

 

Regards.

 

--Sharon

Top Tags