Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
I am using Iot-gateway in Kepware, and I want to only send messages if they have quality set to true. I tried to use Advanced templates, but I could not find any guide anywhere on how to use the directives there. I tried this, but got an error.
{
"timestamp": |SERVERTIMESTAMP|,
"machine_ID": "m_id1",
"values": [
|#each VALUES|
{"id": "|TAG|", "v": |VALUE|, "q": |QUALITY|, "t": |TIMESTAMP| } |#unless @last|,|/unless| |#unless |QUALITY|="false"||/unless|
|/each|
]
}
Please help.
Solved! Go to Solution.
The closest setting we have is “ignore quality changes”. That should allow you to receive only value changes. What you specifically requested is not supported.
Best regards,
Andy Servetas
Principal Technical Support Engineer | Kepware Technologies
Hi,
You can read about "Advanced Template" in the attached guide.
P.S. "Getting Started with the IoT Gateway Advanced Template": https://www.youtube.com/watch?v=s8F1rr74_vs
Hi,
I saw the video before and read the document, but nothing there. I need a more complete guide on Advanced Templates to solve my problem.
The closest setting we have is “ignore quality changes”. That should allow you to receive only value changes. What you specifically requested is not supported.
Best regards,
Andy Servetas
Principal Technical Support Engineer | Kepware Technologies
Hi,
I tried some way to use them if-else. Please try if possible with the help of unless.
My problem statement :
I want to display the timestamp and description only once. so I developed this template and it is working as per expectation.
Please check if you can use something like this.
{
"timestamp": |SERVERTIMESTAMP|,
"values":
[
{|#each VALUES||#unless @first||else||LINEFEED|"t": |TIMESTAMP|,|LINEFEED|"id":"|DESCRIPTION|",|LINEFEED||/unless|"|TAG|": |VALUE|,|LINEFEED||/each|
}
]
}