.NET Based OPC UA Client/Server SDK  3.3.3.537
Running the example

In the following section we are going to run the MachineDemoServer and operate it with the UaExpert. Therefore compile and start the MachineDemoServer example, than establish a connection with the UaExpert.

Changing the temperature

First, drag and drop the heater variables for temperature and the temperature setpoint to the DA view of the UaExpert. You can than change the setpoint temperature, in the example we used 400°C.

machinedemoserver_settemp1.png
Changing the temperature setpoint value

The heater will control the temperature until it reaches the setpoint. If you try to enter a negative value the server will confine it to zero. In the log window of the UaExpert, the return status code of GoodClamped can be found. A value greater than 500°C will be completely discarded with a return value of BadOutOfRange.

machinedemoserver_settemp2.png
Writing unreasonable values to the temperature setpoint variable

Inserting a job

Navigate to the Production object in the Address Space window and expand the ProductionPlan object. The ProductionPlan is empty until now. Right click on the InsertJob method and select the Call context menu item. The Call dialog will popup. Enter an identifier and a Name for the job and press the Call button. In the output arguments section the NodeId of the newly created job will appear. Furthermore, the Job will be listed in the ProductionPlan collection.

machinedemoserver_insertjob2.png
Call InsertJob

Before we release and start this job, we will create a small watch list of interesting variables. Therefore, drag and drop the state machines MachineryItemState and MachineryOperationMode from the MachineryBuildingBlocks folder as well the StartTime, EndTime, the State and its substate machine from the created Job into the DA view window.

machinedemoserver_states1.png
Variables and states

The initial state of the MachineryItemState is "NotExecuting", the initial state of the MachineryOperationMode is "Setup", the initial state of the job's state is "Initializing". The "Initializing" state has a substate machine which is in its "Idle" state.

Processing a job

Before we can queue and release the job for production, we have to supply an instruction plan for the job. This plan contains the process time and the temperature range that should be used for this job. The Instruction object of the job contains a FileType object called Plan. The recipe is transferred to the server via file transfer. Therefore right-click the Plan and select the "Write from local file..." menu item.

machinedemoserver_writeplan.png
Writing a plan to the instructions.

A file dialog will be opened and you can select a file. The file content is in a proprietary format, you find an example file next to the MachineDemoServer executable called ExamplePlan.txt.

machinedemoserver_queue.png
Queue the job.

Next, call the QueueJob and the ReleaseJob method of the job. The job is now ready to be processed. But the machine is still in the "Setup" state.

machinedemoserver_states2.png
Variables and states after calling Release

To start the production, call the Process method of the GlassTemperingMachine.

machinedemoserver_states3.png
Variables and states after calling Process

The operation mode of the machine will change to "Processing", a glass pane will be loaded into the machine, and the state of the job will switch to "Running" and the machine state to "Executing". The start time will now contain a valid value.

Events and alarms

To test the events and alarms, open a new Event View in the UaExpert (choose DocumentAdd… from the menu) and drag and drop the GlassTemperingMachine object into the Event View. Now, change the target temperature to 350°C and run a second job as before.

There are two places in the machine demo server where events are generated. The GlassTemperingMachine will report a MaterialReceivedEventType event when a material (glass pane) arrives at the process location and a MaterialExitEventType when the material leaves the machine.

machinedemoserver_events.png
Events

Furthermore, there is a temperature level alarm of the heater. The temperature limits are defined in the plan of the job. As soon as a new job is started, the alarm limits are adjusted.

machinedemoserver_alarms.png
Alarms

The alarm can be acknowledged and confirmed in the Alarms tab. If the alarm is acknowledged and confirmed and the job is finished, i.e. the material has left the machine, the alarm will disappear from the list of retained alarms.