0% found this document useful (0 votes)
25 views

Project1 Document

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Project1 Document

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Process for designing an IIot System in a Building

GETTING STARTED WITH WINCC OA


Part 1: Creating \ Opening a Project
Part 2: Overview of Data Point Configurations
Part 3: BACnet Driver Configuration
Part 4: Javascript Manager for Node.js
Part 5: MQTT Configuration
Part 6: Creating a GEDI Panel to Transfer BACnet Data to MQTT
Part 3: BACnet Driver Configuration
Download and Install Yabe: Create a BACnet Device using YABE
Parameters from YABE to configure BACnet Driver in WinCC OA
Access the config folder of your project and double-click in config file, then
add the following line under :
[bacnet]
net = 1 ”IP” ”” ”” 47808 ”” 0 120
This is an example of my project
C:\WinCC\O AnP rojnBACnetn0 3nconf ig
After creating project, right-click in the console and select “Append a new
manager”
Choose WCCOAbacnet and enter “-num 3” in Options to select driver num-
ber 3
Open Gedi and click on System managent ¿ Driver ¿ BACnet Driver to set
parameters
Note:
After a successful connection to the BACnet device the status in the BACnet
device configuration panel changes to online.
Creating a Datapoint Type:
To access Para, click the Para icon located within the project toolbar
To create a data point type, right-click the Para Tree and select “Create
datapoint type”
The first “folder ” structure in the Dp-Type Editor will be the name of the
datapoint type:
To add elements to the data point type, right-click the dpt and select “Add
node”,
To add Elenment-Type to a node, right-click on a node and hovering over
“Element-Type”, the user can configure each node take on a desired variable
type or even another datapoint type
Creating a Datapoint:
To create a datapoint, right-click the datapoint type and select “Create
datapoint”
One named (“AI1”), a datapoint will appear
Data point configs
To configure the periphery address of a data point element, right-click data
point element and select “Insert config ¿ Periphery adress”
Click on the \a ddressconf igof adatapointelement, selectthedriverBACN ET andclickonConf igure
Define an analog input for property Present\V alue

1
Click the Apply button to confirm
PART 4: JAVASCRIPT MANAGER FOR NODE.JS
Initial Setup:
Creat a new project — Example: SCADA\P hongSon
Access to path C:\WinCC\O AnP rojnSCADAnP hongSonnjavascriptcreateaf olderP ublisher
Open Visual Studio Code =¿ open folder Publisher
In the terminal ( Ctrl + Shift + ‘) :
Run “npm init -y” ; a new file package.json will be created
Run “npm install –save-dev C:\Siemens\Automation\WinCC\O An3.20njavascriptnwinccoa−
manager”toinstallrequiredmodulesincludingapathtothe\winccoa − manager”
Create a file “index.js” in folder Publisher, which is also where we will write
our code
Create a Javascript manager:
Add a Javascript manager to the console with the path of index.js and Set
Start mode to manual
Code Analysis: Getting Data from WINCC OA and Publishing to MQTT
Strict Mode and Imports
’use strict’;
const \ WinccoaManager \ = require(’winccoa-manager’);
const winccoa = new WinccoaManager();
MQTT Broker Configuration
const brokerUrl = ’mqtt://192.168.1.9:1883’;
const client = mqtt.connect(brokerUrl);
MQTT Connection Event Handler
client.on(’connect’, function() \
console.log(’Connected to MQTT broker’);
setInterval(getValuesAndPublish, 5000);
\);
Getting values and publishing to MQTT:
Exception Handling of the WinCC OA JavaScript Manager for Node.js
Publishing Data to MQTT
PART 5: MQTT CONFIGURATION
1. Setting Up an MQTT Broker on Windows:
Step 1: Download and Install Mosquitto:
Go to the official Mosquitto website: .
Download the Windows installer and follow the installation prompts.
Step 2: Configure Mosquitto for Anonymous Access:
Locate the mosquitto.conf configuration file, usually in the installation di-
rectory
(e.g., C:\Program Files\mosquitto\mosquitto.conf).
Open mosquitto.conf in a text editor.
Add the following lines to allow anonymous access:
Step 3: Test the Mosquitto Broker:
Open a New Command Prompt:
Run the following command to subscribe to a test topic
mosquitto\s ub − hlocalhost − ttest/topic

2
Publish a Message:
mosquitto\p ub − hlocalhost − ttest/topic − m”HelloM QT T ”
Connecting WinCC OA to the MQTT Broker
Once you have successfully created an MQTT broker, you can proceed to
connect it with the MQTT client in WinCCOA
Step 1: Append the MQTT Client Manager:
Step 2: Create a Data Point for MQTT:
Create datapoint DP\M QT T : \SystemM anagement > Driver > M QT T Client”
Figure: Configuration panel of the MQTT driver
Step 3: Defining the peripheral adress
Click on the \a ddressconf igof adatapointelement, selectthedriverM QT T CLIEN T andclickonConf igu
Figure: Definition of a peripheral address
Figure “MQTT Eplorer” and “Panel simulor Sine Sim”
Question : How can we deploy a webserver ?

You might also like