Data Aggregation with FANUC
This tutorial uses FANUC device or FANUC Simulator (CNCGuide). Further an OPC-UA server is used to access the aggregated device information.
Preconditions
-
HumanOS IoT Designer installed on development client (Check Installation Manual)
-
Connectivity to a FANUC Control or Installation of CNCGuide from FANUC.
-
OPC-UA Client installed on the development client
Examples work with UAExpert from Unified Automation. Download UAExpert here
Step 2: Create a Designer Project for FANUC
-
Create an IoT project with HumanOS IoT Designer. Check Tutorial 1 Example for details about OPC-UA Bridges.
-
Add a new device template for FANUC Controllers.
In this example we use the empty device template. -
Add following nodes to the device template.
- Group node called
Controller
- Data node called
Available
- Data node called
MainProgram
- Data node called
OperationMode
- Data node called
PartCounter
NOTEUse the predefined data nodes from the designer.
- Group node called
-
Add a new blank data node called
AggregatedDataNode
. This node is used to store the aggregated data from the processor.- set the port match id to
AggregatedDataType
. - turn on the "Write" switch
- set the data type to
HumanOS.Kernel.DataModel.Entity.TGenericEntity, HumanOS.Kernel.Base
.
NOTEThe "Write"-flag must be turned on, otherwise the processor can not write its data to the data node.
- set the port match id to
-
Add the Port Matching Rule. This rule is necessary to match the data nodes with the input and output ports of the aggregator processor.
-
Add the aggregator processor
-
Add following input ports and corresponding match ids
- Input port named
AvailableFlag
with port match idAvailableType
and data typeSystem.Int32
. - Input port named
OperationMode
with port match idOperationModeType
and data typeSystem.Int32
- Input port named
ProgramName
with port match idMainProgramType
and data typeSystem.String
. - Input port named
WorkpieceCount
with port match idPartCounterType
and data typeSystem.Int32
. - Output port named
OutputPort
with port match idAggregatedDataType
and data typeHumanOS.Kernel.DataModel.Entity.TGenericEntity, HumanOS.Kernel.Base
.
NOTEThe port names are used to generate the field names of the entity.
- Input port named
Step 3: Create FANUC Device
-
Create a FANUC Device within the
default
-Target.NOTEUse the address
NCGUIDE!
to connect to the CNCGuide simulator.NOTEUse
<ip-address>:8193
to connect to a real FANUC controller using port 8193. -
Build and run HumanOS IoT Gateway
-
Connect with OPC-UA client to the OPC-UA server. Use the connection address
opc.tcp://localhost:4840
.
The OPC-UA provides the AggregatedDataNode
as string data type containing a JSON.
Example:
{
"Id": "ec0760c6-6255-4441-8a82-cb4c0f37be97",
"AvailableFlag": "1",
"OperationMode": "1",
"ProgramName": "0",
"WorkpieceCount": "952"
}