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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Monitor an SMT Assembly Line Part 2

No ratings

 

 

Step 4: Implement New Features

 

The SMT Assembly Line Data Model was built around a sample manufacturing facility that tracks critical data points, including diagnostic information for:

 

  • motherboards
  • assembly machines
  • assembly line performance

 

To make informed decisions based on the diagnostic and performance data, you can add features that will increase analytics capabilities.

 

In this optional step, we'll add a Line Chart to see the performance of any given assembly machine. Once completed, we can create Services that will be used to make calculations on the data we have generated from the assembly line.

 

For a final challenge, you can create a service that will compare data points to identify what works best in an assembly machine, a larger internal queue, or more placement heads.

 

Setup New Mashup

 

  1. Create a Mashup that is Responsive and name it SMTTimeSeriesMashup.
  2. Click the Layout tab and add a column to the canvas.
  3. Drag and drop a List Widget onto the left column of the layout.
  4. Drag-and-drop a Line Chart Widget onto the other column of the layout.

    new_mashup.png

     

Configure List Widget

 

  1. Add the GetImplementingThingsWithData Service of the AssemblyMachineTemplate Thing Template as a data source in the Mashup. Ensure the checkbox for Execute on Load is checked.
  2. Drag-and-drop GetImplementingThingsWithData > Returned Data > All Data to the List Widget.
  3. On the Select Binding Target pop-up, select Data.

    list_widget_data.png

     

  4. With the List widget selected, for the DisplayField property dropdown, select name.
  5. In the ValueField property dropdown, select name.

 

Configure Time Series Data

  1. Add the Dynamic QueryPropertyHistory Service of the AssemblyMachineTemplate Thing Template as a data source in the Mashup. Ensure the checkbox for Execute on Load is checked.
  2. Drag-and-drop QueryPropertyHistory > Returned Data > All Data to the Time Series Chart Widget.
  3. On the Select Binding Target pop-up, select Data.
  4. For the XAxisField property dropdown, select timestamp.
  5. For the DataField1 property dropdown, select IdleTime OR MotherboardsCompleted.

    time_widget_setup.png

     

Connect Widgets

 

  1. Drag-and-drop the GetImplementingThingsWithData > Returned Data > Selected Row(s) > name property to the EntityName parameter for the Dynamic AssemblyMachineTemplate data source.
  2. Select the GetImplementingThingsWithData service, then drag-and-drop the SelectedRowChanged event onto QueryPropertyHistory.

    setup_data.png

     

  3. Click Save.
  4. After the save is complete, click View Mashup.

 

You are now able to see what the idle time is for each assemble machine over the span of its use.

 

Create Service

 

You can add JavaScript code to calculate the average completion time for the motherboard assembly.

 

  1. Open the MotherboardTemplate ThingTemplate in Composer.
  2. Create a new Service titled CompletionTime.
  3. For the Output type, select Number.
  4. Enter the following code into the JavaScript window and save:

var diff = 1;

if(me.EndTime != null && me.StartTime != null){
    diff = Math.abs(me.EndTime - me.StartTime);
} 

//Seconds
var result = Math.round(diff/1000);

//Minutes
//var result = Math.round((diff/1000)/60);

 

You can now calculate the time it takes for an individual motherboard to be completed. Create a service to be used with the GetCompletedMotherboards service (returns a list of all completed Raspberry Pi motherboards) with the SMTAssemblyLineTemplate ThingTemplate to calculate the average time for your assembly line to complete a motherboard. Finish this Service and add configure it to work with your new Mashup.

 

 

 

Step 5: Next Steps

 

Congratulations! You've successfully completed the ThingWorx Monitor an SMT Assembly Line Guide, learning how to use ThingWorx to create an application that provides real-time insight into connected assets.

 

Learn More

 

We recommend the following resources to continue your learning experience:

 

 Capability      Guide
BuildDesign Your Data Model
BuildImplement Services, Events, and Subscriptions
ConnectJava SDK Tutorial

 

Additional Resources

 

If you have questions, issues, or need additional information, refer to:

 

 Resource       Link
CommunityDeveloper Community Forum
SupportJava Edge SDK Help Center
Version history
Last update:
‎Nov 15, 2022 03:35 PM
Updated by:
Labels (1)
Contributors