This article will explain the principles and the functions of the L2L Machine data flows. Data flows is the first logical structure in L2L Machine Connect cloud to receive the binary sensorbot generated machine data, to convert and save it as coherent manufacturing related data to its datalake. Dataflow convert binary data to, countable production events (strokes, weight, eaches) or states (uptime, downtime, error). The business logic is still not implemented in this stage. Dataflows' logical structure must be used only for the data conversion purposes. Business rules will be implemented in the Rules Engine using the output of the dataflows.
Click on the drop down to find the asset to make a new data flow for.
Click on the empty box to start a new flow. Give the new flow a name and press go.
Flow Start:
Here we are presented with 3 different options.
DIY: This will allow the creation of a flow from scratch.
Copy Existing: This will copy a flow one has already made for this factory id to this new flow.
Start From Template: This will allow you to choose from a list of templates all customers have published.
Available Tools
Inputs
A dataflow require at least one input to function. They are basically the outputs of Sensorbots. All inputs can be assigned to outputs in a one to one relationship but it is always beneficial to utilize a transform logic in dataflows to filter and create a coherent output that can be used by rules engine.
Outputs
A dataflow require at least one output so it generates a useable data to be used in the Rule engine.
Transforms
Transform utilization is not a requirement but highly recommended for creating coherent and meaningful data. L2L provides a lot of templates to be used as reference for different dataflow usecases (ex. uptime, downtime, count, alarm, state etc). Transforms also support JS for logic and data manipulation.
Sensorbot specific inputs:
On the left is the inputs, transforms, and outputs for a flow. Shown is a list of available inputs from the sensorbot we have chosen.
All sensorbots on a site inputs:
Shown is a list of all sensorbots inputs on the site.
Transforms:
Shown is the start of the list of transforms available for a flow. When using functions that have multiple inputs such as an AND the data will buffer on one input when there is nothing to process on the other input. Make sure all inputs to a function like this have the same rates of data so there are no buffering issues. All these functions have descriptions on how they work. Just click and drag any to the workspace and then click on the function again to get the description on the right side of the screen.
example of a function in the workspace and its description.
Outputs:
Shown are the two outputs for a function. The accumine database function will pass data into a table in Connect. The Send Alert will send email alerts.
Example Usecase:
This example will go through setting up a downtime/in-cycle flow for the amp1 input for this bot.
Shown here is the amp1 input dragged from the list on the left to the working space in the middle. This input is calibrated as a periodic measurement. Therefore the data is represented as a decimal value that represents the current value present at the input.
Here we have a map function. In this rule we wish to convert the value coming from the bot to a true or false based on a threshold in the code we paste in the map function. The value 1000 is the threshold we wish to set. Any value from the bot above the threshold will be converted to a true value for the rest of the flow. Any value from the bot below the threshold will be converted to a false value.
function(obj) {
if (obj.value > 1000) {
obj.value = true;
} else {
obj.value = false;
}
return obj;
}
Next this we need is a timeout function. If we don't get a true value in the set timeout time then we output a true value from the timeout. Here we have set the time out to 30000ms or 30 seconds.
Next we will filter duplicate values. We only need 1 consecutive true or false value to trigger the in-cycle or downtime events so we filter out any following trues or falses after the first one.
Now we can grab our outputs for the flow and a NOT function. The output connected to the filter duplicate values will be pointed to the Downtime table. The output connected to the NOT function will be pointed to the In-Cycle table.
Click here for a guided tour of the data flows.