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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Enhanced Engine Failure Visualization Part 2

No ratings

 

Step 5: Contained Mashup

 

Our Minimum Viable Product (MVP) Mashup which we created in the last guide did have valid information.

 

Being able to display the inputs coming from the engine, as well as the analytical results coming from ThingWorx Analytics, are certainly items we don’t want to lose in this new, more complete Mashup.

 

Rather than recreating that work from scratch, we’ll simply include that previous Mashup in one of our sub-section via the Contained Mashup Widget.

 

    1. Click on the top-left section to select it, and ensure that you’re on the Widgets tab in the top-left.


IoTProductMgmt_0-1667830485637.png

 

    2. Drag-and-drop a Contained Mashup Widget onto the top-left section.


IoTProductMgmt_1-1667830485644.png

 

    3. With the Contained Mashup Widget selected, return to the Properties tab in the bottom-left.


IoTProductMgmt_2-1667830485649.png

 

    4. Scroll down and locate the Name Property.

 

    5. Search for and select EFPG_Mashup

 

    6. Click Save.


IoTProductMgmt_3-1667830485655.png

 

 

Add Column Labels

 

The original Mashup we created (and have now embedded in the new one) had some labels for the inputs and outputs. However, you had to know what things like “s1_fb1” meant to understand that that was an input.

 

We can go back to the original EPFG_Mashup, make some modifications for greater clarity, and those changes will also carry over to our new Mashup.

 

    1. Reopen the old EPFG_Mashup on the Design tab.


IoTProductMgmt_4-1667830485658.png

 

    2. Move all of the Widgets down to leave some extra room at the top.


IoTProductMgmt_5-1667830485661.png

 

    3. Drag-and-drop two Divider Widgets onto the Canvas above both the Inputs and Results columns.


IoTProductMgmt_6-1667830485663.png

 

    4. Select a Divider Widget, and go to its Style Properties.

 

    5. Expand Base > Line to reveal the background Style Property.


IoTProductMgmt_7-1667830485665.png

 

    6. Click on the default gray color to see the available options.


IoTProductMgmt_8-1667830485669.png

 

    7. Choose the built-in black at the bottom, and click Select.


IoTProductMgmt_9-1667830485671.png

 

    8. Make the same modification to the other Divider Widget.

 

    9. Drag-and-drop two more Label Widgets onto the Canvas above the two columns.


IoTProductMgmt_10-1667830485673.png

 

    10. Change their LabelText Properties to Inputs and Results, respectively.


IoTProductMgmt_11-1667830485675.png

 

 

Change Background and Size

 

    1. From the Explorer tab in the top-left, select the container.

 

    2. Select the Style Properties tab in the bottom-left and expand Base > Container.


IoTProductMgmt_12-1667830485677.png

 

    3. Change the background Style Property to a color you prefer.


IoTProductMgmt_13-1667830485679.png

 

    4. With the container still selected in the Explorer tab, drag the corners of the Mashup to reduce its size.

 

    5. You could even move the Results column over, place the Auto Refresh Widget underneath, and then reduce the container size even further.


IoTProductMgmt_14-1667830485681.png

 

    6. Click Save.

 

 

View Mashup Thus Far

 

With the changes to the previous EFPG_Mashup now complete, let’s ensure that everything carried over to our new Mashup.

 

    1. Return to EEFV_Mashup.

 

    2. Click Save.

 

    3. Click View Mashup.


IoTProductMgmt_15-1667830485685.png

 

Note how the various changes we made to the base Mashup are also being shown, via a Contained Mashup Widget, in our new Mashup.

 

Splitting out functionality to a separate Mashup that is then embedded where needed is a great way to re-use content and simplify development.

 

 

 

Step 6: Add Chart

 

Our original Mashup (which has now been embedded in our new one) shows the instantaneous analytical results based on the inputs coming from the Edge MicroServer (EMS).

 

However, when investigating remote customer issues, it might be helpful to see some historical trends. A temporary "blip" of a low-grease indication might be worrisome, but it may not require immediate intervention unless the issue was occuring consistently or for extended periods of time.

 

Fortunately, creating a historical record is relatively simple in ThingWorx Foundation.

 

All that is really needed is a place in which to store the past records.

 

One of the easiest such storage methods is a Value Stream.

 

    1. In ThingWorx Foundation, click Browse > Data Storage > Value Streams.


IoTProductMgmt_0-1667831555148.png

 

    2. Click + New.


IoTProductMgmt_1-1667831555151.png

 

    3. On the Choose Template pop-up, select ValueStream and click OK.


IoTProductMgmt_2-1667831555152.png

 

    4. In the Name field, type EEFV_ValueStream.


IoTProductMgmt_3-1667831555154.png

 

    5. If Project is not already set, search for and select PTCDefaultProject.

 

    6. At the top, click Save.

 

 

Link Value Stream and Begin Storage

 

Now that we have a Value Stream to act as a storage location, we want to link it to EdgeThing.

 

After EdgeThing knows where to store historical data, we can simply instruct it which Property we want to archive by setting it to Logged.

 

    1. Return to EdgeThing and its General Information tab.


IoTProductMgmt_4-1667831555155.png

 

    2. In the Value Stream field, search for and select EEFV_ValueStream.


IoTProductMgmt_5-1667831555157.png

 

    3. Click Save.

 

    4. Still on EdgeThing, click Properties and Alerts.


IoTProductMgmt_6-1667831555159.png

 

    5. Click Result_low_grease_mo to trigger the slide-out from the right-side.

 

IoTProductMgmt_7-1667831555163.png

 

    6. Check Logged.


IoTProductMgmt_8-1667831555164.png

 

    7. Click the Check icon in the top-right to close the slide-out.

 

    8. Click Save.

 

 

Add Line Chart and Data

 

As per most guides in this Learning Path, it is assumed that you have an active connection to the EMS Engine Simulator and have your Analytics Event currently set to active.

 

This provides both the engine-sensor inputs and the analytical results for our Mashup.

 

After adding the Value Stream above, you'll need to let it run for a bit for the historical data to be archived. After it's run for a while and we have a valid history build-up, you can display that history in a Line Chart.

 

    1. Return to EEFV_Mashup on the Design tab.

 

    2. Click on the top-right section to select it.

 

IoTProductMgmt_9-1667831555172.png

 

    3. From the Widgets tab, drag-and-drop a Line Chart onto the top-right section.

 

IoTProductMgmt_10-1667831555177.png

 

    4. In the top-right of Mashup Builder, ensure the Data tab is selected.

 

IoTProductMgmt_11-1667831555178.png

 

    5. Click the green + button.

 

IoTProductMgmt_12-1667831555180.png

 

    6. On the Add Data pop-up in Entity Filter, search for and select EdgeThing.

 

    7. In Services Filter, type queryprop.

 

    8. Click the right arrow button besides QueryPropertyHistory.

 

    9. Check Execute on Load.

 

IoTProductMgmt_13-1667831555183.png

 

    10. Click Done.

 

    11. Expand Data > Things_EdgeThing > QueryPropertyHistory > Returned Data.

 

IoTProductMgmt_14-1667831555183.png

 

 

Bind Data and View Mashup

 

Now that we have both our method of displaying the historical data, i.e. a Line Chart, as well as a method to bring backend data into the Mashup, i.e. QueryPropertyHistory, we can bind them together and see how our Mashup is progressing.

 

    1. From the right under the Data tab, drag-and-drop EdgeThing > QueryPropertyHistory > Returned Data > All Data onto the Line Chart in the top-right of the Canvas.

 

IoTProductMgmt_15-1667831555186.png

 

    2. On the Select Binding Target pop-up, click Data.

 

IoTProductMgmt_16-1667831555197.png

 

    3. With the Line Chart selected, explore its Properties in the bottom-left.

 

    4. Change XAxisField to timestamp.

 

IoTProductMgmt_17-1667831555202.png

 

    5. Click Save.

 

    6. Click View Mashup.

 

IoTProductMgmt_18-1667831555217.png

 

Your own Line Chart will vary depending on what values your Engine Simulator is sending to Foundation and Analytics.

 

NOTE: Remember that the Analysis Event needs to be Enabled for new values to be fed into Result_low_grease_mo.

 

 

Click here to view Part 3 of this guide.

 

Version history
Last update:
‎Mar 07, 2023 02:48 PM
Updated by:
Labels (2)
Contributors