Skip to main content

Posts

Showing posts with the label OPCUA

Minimal OPC UA client that auto generates self signed certificate on startup in C#

Minimal OPC UA client that auto generates self signed certificate on startup in C# This is minimal OPC UA client in C# that demonstrates self signed certificate auto generation on startup. Pre-Req Visual Studio 2022 Community Edition ConsoleReferenceServer running in the another console Steps Using Visual Studio, create C# .Net 6.0 Application Add a nuget reference to OPCFoundation.NetStandard.Opc.Ua.Client Copy/paste code from gist below into Program.cs and run it Full working code can be found here .

OPC UA Read service using C#

OPC UA Read service using C# This is a sample bare bones OPC UA C# application performing a Read service. Pre-Req Visual Studio 2022 Community Edition Run sample ConsoleReferenceServer Steps Using Visual Studio, create C# .Net 6.0 Application Add a nuget reference to OPCFoundation.NetStandard.Opc.Ua.Client Copy/paste code from gist below into Program.cs Full working code can be found here .

Running OPC UA .Net Standard PubSub reference server on Ubuntu 22.04 using dotnet-sdk-6.0

Running OPC UA .Net Standard PubSub reference server on Ubuntu 22.04 using dotnet-sdk-6.0 System info: OS: Ubuntu 22.04 OPC UA .Net Standard under test: 1.4.371.96 Install MQTT broker $: sudo apt install mosquitto Install dotnet-sdk-6.0 $: sudo apt install dotnet-sdk-6.0 Install git as needed $: sudo apt install git Clone OPC UA .Net Standard git repo $: mkdir ~/prj $: cd ~/prj $: git clone https://github.com/OPCFoundation/UA-.NETStandard.git $: cd UA-.NETStandard $: git checkout refs/tags/1.4.371.96 Run publisher $: dotnet run --project Applications/ConsoleReferencePublisher/ConsoleReferencePublisher.csproj --framework net6.0 Run subscriber (on another terminal) $: cd ~/prj/UA-.NETStandard $: dotnet run --project Applications/ConsoleReferenceSubscriber/ConsoleReferenceSubscriber.csproj --framework net6.0

Running OPC UA .Net Standard PubSub reference server on Ubuntu 20.04 using dotnet-sdk-3.1

Running OPC UA .Net Standard PubSub reference server on Ubuntu 20.04 using dotnet-sdk-3.1 High Level Info: OPC UA .Net Standard under test: 1.4.371.96 OS: Ubuntu 20.04 (>20.04 not working due to dotnet-sdk-3.1 is not supported) Install dotnet-sdk-3.1 $: wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb $: sudo dpkg -i packages-microsoft-prod.deb $: rm packages-microsoft-prod.deb $: sudo apt update $: sudo apt install dotnet-sdk-3.1 Clone OPC UA .Net Standard git repo $: mkdir -p ~/prj $: git clone -b 1.4.371.96 https://github.com/OPCFoundation/UA-.NETStandard.git Install MQTT broker Mosquitto and supporting tools $: sudo apt install mosquitto $: sudo apt install mosquitto-clients Run mqtt sub client to see traffic $: mosquitto_sub -h localhost -v -t '#' Run reference PubSub publisher $: cd ~/prj/UA-.NETStandard/Applications/ConsoleReferencePublisher $: dotnet run --project ConsoleReferen