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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Custom service is not listing properties when binding from widget but standard function does

AS_9770512
6-Contributor

Custom service is not listing properties when binding from widget but standard function does

Hello everyone,

 

i am trying to write a custom service "Calculate_all" see second image, which calculates the mean maximum and min and in future other different statistical values. As input my service expects a datetime and a string (property name for the QueryNumberPropertyHistory service inside my service). As an output it gives an infotable with the 3 values. The service is a service of a thing which has sensor data as properties.

 

When i try to give a value widget a data source i can link one of the outputs of my service for one sensor (given through the property name which is defined in the data properties section or by a readable lable widget) to the data of the value widget. But after that if i want to give data to another value widget from my service but from different sensor (property name input changes) i have to add my service again to the data area in the mashup builder (see picture 3) because thingworx says that my service already has a binding to his input parameter propertyname.

 

But when using standard services for example "getpropertyvalues" in thingworx the service itself is shown the properties (sensors) of my thing like the "actualspeed" so i do not have to declare the service multiple times and can use the same service multiple times with different sensors (see picture 1)

 

How do i have to change my service to achieve the same functionality? So that my service is showing the properties (sensors) and uses them to apply the calculations on.

 

AS_9770512_0-1615467594206.png

AS_9770512_1-1615467679009.png

AS_9770512_2-1615467831062.png

 

 

5 REPLIES 5

If I understand the question correctly, you can use "EventsRouter " function for this.

You can get more details in this topic.

 

DmitryTsarev_0-1615470166275.png

 

This function does look like that you have multiple inputs but just one output and coding there seems just doing logical statistics. I want to use my service multiple times with different input but not with multiple input. It still should take one input (properyname/sensor) and give the mean or max or min as output.

CharlesJi
15-Moonstone
(To:AS_9770512)

Hi AS_9770512,

 

I'm not sure I fully understand your request.

 

Could you give more details, like

1) how many sensors (or property name?) you have,

2) how many value widgets you are going to use? (Because I think for every different input, you will bind the outputs: mean, max, and min to 3 value widgets)

3) And will all these value widgets show different results simultaneously?

 

 

 

AS_9770512
6-Contributor
(To:CharlesJi)

1.there is no limitation to the number of sensor/propertynames, 

2.number of gadgets is equal to number of sensors and get contains of 3 value widgets each for minimum maximum and mean value

3.yes

AS_9770512_0-1615546796694.png

for each gadget i have defined the same service multiple times but i want to import the service only one time to my mashup and then use it like in the picture 3 times.

 

CharlesJi
15-Moonstone
(To:AS_9770512)

Hi @AS_9770512

 

Thanks for the snapshots. And I still have no clue why you have to define the same service multiple times for one gadget.

 

From your snapshot, for every box, I think you only have to call your service once.

And since you have 3 boxes, you will have to define the same service 3 times in total.

 

BTW, I guess you can also try to calculate your statistical data and store them in the corresponding thing's property so that you can get them by using GetPropertyValues.

Announcements


Top Tags