Skip to content

Commit

Permalink
Simulation updates for quickstarts and tutorials (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicbetts authored Feb 17, 2025
1 parent ed56190 commit 557f7ff
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 63 deletions.
51 changes: 8 additions & 43 deletions samples/quickstarts/opc-plc-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,70 +22,35 @@ spec:
- "--ph=opcplc-000000"
- "--cdn=opcplc-000000"
- "--ut"
- "--sn=25"
- "--sph"
- "--sn=5"
- "--sr=10"
- "--fn=2000"
- "--fn=10"
- "--ftl=212"
- "--ftu=273"
- "--ftr=True"
- "--veryfastrate=1000"
- "--gn=5"
- "--gn=1"
- "--pn=50000"
- "--maxsessioncount=100"
- "--maxsubscriptioncount=100"
- "--maxqueuedrequestcount=2000"
- "--ses"
- "--alm"
- "--at=FlatDirectory"
- "--drurs"
- "--ll-debug"
- "--nodesfile"
- "/app/config/nodesfile.json"
ports:
- containerPort: 50000
volumeMounts:
- name: opc-plc-default-application-cert
mountPath: /app/pki/own
- name: opc-plc-trust-list
mountPath: /app/pki/trusted
- name: config-volume
mountPath: /app/config
volumes:
- name: opc-plc-default-application-cert
secret:
secretName: opc-plc-default-application-cert
- name: opc-plc-trust-list
secret:
secretName: opc-plc-trust-list
- name: config-volume
configMap:
name: opc-plc-config
serviceAccountName: opcplc-000000-service-account
---
apiVersion: v1
kind: ConfigMap
metadata:
name: opc-plc-config
namespace: azure-iot-operations
labels:
app.kubernetes.io/component: opcplc-000000
data:
nodesfile.json: |
{
"Folder": "MyTelemetry",
"NodeList": [
{
"NodeId": "ns=3;s=FastUInt100",
"Name": "Fryer Temperature",
"DataType": "Double",
"ValueRank": -1,
"AccessLevel": "CurrentReadOrWrite",
"Description": "Fryer Temperature with spikes",
"Anomaly": "Spike",
"MinValue": 150.0,
"MaxValue": 200.0
}
]
}
---
apiVersion: v1
kind: Service
metadata:
name: opcplc-000000
Expand Down Expand Up @@ -235,4 +200,4 @@ subjects:
roleRef:
kind: Role
name: opc-plc-000000-secret-access-role
apiGroup: rbac.authorization.k8s.io
apiGroup: rbac.authorization.k8s.io
41 changes: 21 additions & 20 deletions samples/quickstarts/quickstart.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,37 @@ resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
properties: {
displayName: assetName
assetEndpointProfileRef: assetEndpoint.name
description: 'an oven is essential for baking a wide variety of products'
description: 'Multi-function large oven for baked goods.'

enabled: true
externalAssetId: '32faab3f-88e8-4f38-b901-e175dde50c28'
manufacturer: 'http://asset.oven.contoso'
manufacturerUri: 'http://oven.asset.contoso'
model: 'Mymodel'
manufacturer: 'Contoso'
manufacturerUri: 'http://www.contoso.com/ovens'
model: 'Oven-003'
productCode: '12345C'
hardwareRevision: 'http://docs.oven.asset.contoso'
softwareRevision: '1.1'
hardwareRevision: '2.3'
softwareRevision: '14.1'
serialNumber: '12345'
documentationUri: 'http://docs.oven.asset.contoso'
documentationUri: 'http://docs.contoso.com/ovens'

datasets: [
{
name: 'some randome datasets name'
name: 'Oven telemetry'
dataPoints: [
{
name: 'Temperature'
dataSource: 'ns=3;s=FastUInt100'
dataSource: 'ns=3;s=SpikeData'
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
observabilityMode: 'None'
}
{
name: 'FillWeight'
dataSource: 'ns=3;s=FastUInt1004'
name: 'EnergyUse'
dataSource: 'ns=3;s=FastUInt10'
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
observabilityMode: 'None'
}
{
name: 'EnergyUse'
dataSource: 'ns=3;s=FastUInt1005'
name: 'Weight'
dataSource: 'ns=3;s=FastUInt9'
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
observabilityMode: 'None'
}
Expand Down Expand Up @@ -229,18 +228,20 @@ resource dataflowCToF 'Microsoft.IoTOperations/instances/dataflowProfiles/datafl
}
{
type: 'Compute'
description: 'Weight Offset'
inputs: [
'Temperature.Value ? $last'
'Weight.Value ? $last'
]
expression: '$1 > 225'
output: 'Spike'
expression: '$1 - 150'
output: 'FillWeight'
}
{
type: 'Rename'
type: 'Compute'
inputs: [
'Temperature.Value'
'Temperature.Value ? $last'
]
output: 'Temperature.Value'
expression: '$1 > 225'
output: 'Spike'
}
{
inputs: [
Expand Down

0 comments on commit 557f7ff

Please sign in to comment.