Skip to main content
1-Visitor
January 3, 2020
Solved

Syntax of updating the property VTQ

  • January 3, 2020
  • 2 replies
  • 4087 views

Hello,

To update the property VTQ on Thingworx platform using lua EMS is the following possible.

 

properties.propertyName={baseType="NUMBER", pushType="ALWAYS", value=0}

--To update on thingworx

local variableName = propertyName

properties.variableName.value = <someValue>

 

I tried it in different ways but it's giving me an error.

 

Thank You,

Naeem

Best answer by mnaeem

Hi @slangley ,

Unfortunately I'm unable to find the solution and I've changed the way reading reading csv file on Thingworx platform instead of through agent.

Copying the file from agent to the server and then reading it on server.

It was the fastest way.

 

Thank You,

naeem

2 replies

22-Sapphire I
January 6, 2020

You can use this service: 

UpdatePropertyValues

mnaeem1-VisitorAuthor
1-Visitor
January 7, 2020

Thank You @PaiChung 

properties.Signal_Q30={baseType="NUMBER", pushType="ALWAYS", value=0}

serviceDefinitions.GetSystemProperties(
     output { baseType="BOOLEAN", description="" },
     description { "updates properties" }
)

services.GetSystemProperties = function(me, headers, query, data)
     log.trace("[TemplateRilevatore]","########### in GetSystemProperties#############")
     queryHardware()
     -- if properties are successfully updated, return HTTP 200 code with a true service return value
     return 200, true
end
function queryHardware()
     nome = "Signal_Q30"
     valore = 2
     serviceName(nome, valore)

end

I'd like to call a service in place of serviceName, which has been written on thingworx platform.

Thank you!

22-Sapphire I
January 7, 2020

You are looking to do this from an agent?

Usually you would use 'UpdateSubscribedProperties' for that.

mnaeem1-VisitorAuthor
1-Visitor
January 30, 2020

Thank You @Chandler1 ,

I'm talking about calling services of Thingworx in agent (LUA EMS).

 

For example:

properties.Signal_Q30={baseType="NUMBER", pushType="ALWAYS", value=0}

serviceDefinitions.GetSystemProperties(
     output { baseType="BOOLEAN", description="" },
     description { "updates properties" }
)

services.GetSystemProperties = function(me, headers, query, data)
     log.trace("[TemplateRilevatore]","########### in GetSystemProperties#############")
     queryHardware()
     -- if properties are successfully updated, return HTTP 200 code with a true service return value
     return 200, true
end
function queryHardware()
     name = "Signal_Q30"
     value = 2
     UpdatePropertyValue(name, value) --Service on Thingworx platform

end

Support
February 13, 2020

Hi @mnaeem.

 

I realize that you've already marked a solution to this post, but since a couple of replies have since been received, I want to be sure you don't have any remaining questions.  Please let us know.

 

Regards.

 

--Sharon

mnaeem1-VisitorAuthorAnswer
1-Visitor
February 17, 2020

Hi @slangley ,

Unfortunately I'm unable to find the solution and I've changed the way reading reading csv file on Thingworx platform instead of through agent.

Copying the file from agent to the server and then reading it on server.

It was the fastest way.

 

Thank You,

naeem