![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
10/20/2019
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hi,
I'm trying to build a very simple console server to deploy in a docker container. Initally this will only have a hand full of nodes to control a benchtop pump (on, off, set flow rate, set max pressure and get current pressure). The idea is to use this as a training aid and template for building more complex applications and clients in the future. I've done part of this using the unoffical NodeJS SDK and visualise with NodeRED but is very sluggish! Ideally i'd like to use the official .NET implimentation as i'll be including dlls for communicating with the pump and future equipment we developed using labVEIW.
I've download and built the official .NET OPC UA stacks using visual studio 2019 and managed to run the sample applications from the official OPC UA github site but there is very little infomation explaining the examples, how they were made, how to use them and in some cases what the diffence between some of the examples (Quick.Server vs ReferenceServer). The models and nodespaces seem to be very large and not very obvious where they are coming from? Most of the examples dont seem to have any of the NodeSets and other files you expact from using the UA-model tool saved in their file structures (csv, NodeSet2, .types, nodemanager etc)? I'm asumming the examples are pointing to prebuilt nodes loacted elseware, but without without any documention is proving quite hard for a novice/muppet like me to figure whats going on and reverse engineer.
The link in the OPC UA git hub page directs you to a how to guide for building your own server or client using the .NET SDK but this is from 2015 and no longer seems to reflect the code or file structures of the examples? Is there a more up to date step-by-step guide or tutorial?
I've tried following youtube tutorials but many assume a lot of existing knoweldge of the specifications, underlying models, tools (UA-modeler) inorder to build and compile models as well as coding in .NET. Is there an idiots guide somewhere or a basic step-by-step guide to any of the workshop sample and examples in the git repository? Were these used in an actual workshop or lession that is avalible?
Once I get a basic server up and running i'd like to try and map it to a REST API so my client effecively is a web application. I found a youtube video demonstarting how to do this and a link to a prototype example (https://prototyping.opcfoundation.org/). Unfortunately it no longer works as you can't log in? Is this being mainatained by the OPC UA foundataion or is there another example server running elsewere?
Apprechiate any help - many thanks!
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
https://prototyping.opcfoundation.org/ is down for maintenance.
Will be up again soon but that is not the example you are looking for (it is a JavaScript client demo).
The ReferenceServer implements the currently supported features and is used for Certification Testing.
It can be overwhelming for newbies.
The workshop examples illustrate single features and are better learning tools:
https://github.com/OPCFoundati.....r/Workshop
Any of these samples should be easy for someone to compile and run, however, actually changing the code will require some UA knowledge.
Note that the Nodes that appear in the address space come from 3 sources:
1) Static nodes loaded from a UANodeSet;
2) Dynamic nodes created using classes generated from a ModelDesign;
3) Virtual nodes created by implementing Browse/Read services that parse NodeIds and use that information look up the information in an external system.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
10/20/2019
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Randy Armstrong said
https://prototyping.opcfoundation.org/ is down for maintenance.Will be up again soon but that is not the example you are looking for (it is a JavaScript client demo).
The ReferenceServer implements the currently supported features and is used for Certification Testing.
It can be overwhelming for newbies.
The workshop examples illustrate single features and are better learning tools:
https://github.com/OPCFoundati.....r/Workshop
Any of these samples should be easy for someone to compile and run, however, actually changing the code will require some UA knowledge.
Note that the Nodes that appear in the address space come from 3 sources:
1) Static nodes loaded from a UANodeSet;
2) Dynamic nodes created using classes generated from a ModelDesign;
3) Virtual nodes created by implementing Browse/Read services that parse NodeIds and use that information look up the information in an external system.
Thank you so much for replying - this is very useful!
I have some follow up questions if thats ok...appologies if these are daft questions!
Which examples are static and which are dynamic - also where are the static files located?
Is it as simple as manually changing the static file to give you the node spaces you want - i'm guessing not!?!
Is it possible to request an example that shows the differnce for calling static or dynmic and highlight what the main advantages are of each?
I'm assuming the virtual nodes options is what is used in an aggrigation server?
For my very simple application, connecting to multiple RS232 pumps, is a single server the correct way to go? Within the server is it usual to have a state-machine for polling say the pressure or flow rate from the pump or should this be part of a the client?
Getting my head around methods, from what i understand these are for calling functions of whatever it is your device does...So does this mean you have a method that truns on a pump and all the code related to that (such as sending the ascii string to the pump through RS232) or is it better to use a simple boolean node space that represents on or off and the code to that genrates generates and sends the commands it to the pump is from a statemachine from within a client application?
Looking around some users recommended combining both a server and client together as one application, while others seem to build apps simply populates a OPC UA server or provides methods for controlling the device through the application. Which is the right way to go?
Also i've read some conflicting artcles about weather you should have only one server for all your devices and multiple clients for handelling the direct comms to the deivices or have servers for each item and one client that controls the logic for your process and is where the state-machine would be located?
I'm guessing if you go down the route of lots of servers thats when you need the aggrigation server and one client that controls the logic for all the devices and effectiveily is your state-machine? In this example would the server directly communicate to the device through say a serial interface using a method rather than this functionaility being in the client app?
Thanks again!
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Virtual Nodes are the way to go whenever you have the structure of the data coming from somewhere else.
This example illustrates the use of virtual nodes:
https://github.com/OPCFoundati.....Manager.cs
Virtual nodes eliminate the need to keep a copy of your address space in memory.
The samples load static nodes files from with the *uanodes extension. These are generated with the ModelCompiler.
This example loads Boiler1 from the static file but dynamically creates Boiler2:
https://github.com/OPCFoundati.....Manager.cs
You only want to static nodes for things that really do not change - i.e. things like ObjectTypes and DataTypes.
1 Guest(s)