Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Here is my config.lua:
scripts.TestThing = {
file = "thing.lua",
template = "display"
}
scripts.TestThing_Interface_0 = {
file = "thing.lua",
template = "interface"
}
scripts.TestThing_Interface_1 = {
file = "thing.lua",
template = "interface"
}
In the template when I am getting the properties how do I differentiate which interface I am getting properties for?
Let me explore the question more.
If they are of the same templates that would be different?
Have you considered multiple templates say
base template
I
subtemplate1 subtemplate2 subtemplate3 (where the sub templates have something different
if they are not different then the question is what makes them different is it a property value?
Maybe I'm off base. if so can you provide more detail
They are based on the same template on the server side, they will have different property values. The differentiating property value is called InterfaceID. This question is coming from the lua script resource environment.
Are you asking how to get the property value for interfaceID in Lua?
There are 2 properties that I am trying to use to differentiate between the interfaces.
log.info("Interface ID: ", properties.InterfaceIdentificationNumber.value)
log.info("Interface is redundant: ", properties.IsRedundantInterface.value)
This prints out the same thing for each interface
Interface ID: 0
Interface is redundant: false
I'm not a Lua expect - I'm assuming you added InterfaceIdentificationNumber to your template?
Yes. On the server side they have correct values, but they are all 0 in the lua script resource.
I believe you should set the identifier for each of these things on the Platform, and then make use of the identifier property of these lua tables. From the config.lua.example file:
"identifier: Register with the EMS and Platform using this identifier."
This would effectively distinguish between each of these on the Lua side of things. I hope this helps!