Connectivity Server

From FactorityWiki

Jump to: navigation, search

Contents

Introduction

The FACTORITY Connectivity Server ties together the real machine, the processes in the application server and the MES terminals. It is able to run jobs, which are required to control the real production process.

  • Communication with PLCs: The Connectivity Server knows the PLC structure and is able to read and write data directly from/to the PLC.
  • Communication with FACTORITY Terminals: In order to provide the machine status and errors to the operator, the Connectivity Server process is responsible to update the WireWare Bus with machine data in real time.
  • Communication with the FACTORITY Server Application: On one hand the Connectivity Server Process sends data for PDA and MDA to the server. On the other hand, these data can be used to control the whole production flow.
  • Execution of workflows: In contrast to the OPC server, the Connectivity Server is able to execute workflows that do not need Server Communication.


Technology overview

First some definitions:

  • Machine object (former: Plc object): This is a logical machine inside the FACTORITY Connectivity Server. A single server instance can run multiple independend machine objects.
  • Module: A machine object can have multiple modules. Device drivers, connectors to third party systems or logic functions are typically provided as modules. Modules are implemented in Java. FACTORTIY ships with many general purpose modules, but there may be modules for specific customer projects as well.
  • Datapoint: A datapoint is a kind of local variable of a machine object. Datapoints of the Connectivity Server are exported as two WireWare datapoints. The can be seen or modified (if allowed) by any WireWare client.

The FACTORITY Connectivity Server a native process, which is ported to Windows 32bit and Linux 32bit currently. It parses the configuration file, creates the machine objects and launches a local Java VM, which loads the modules of the machine object.


Input and output datapoints

A single datapoint of the FACTORITY Connectivity Server is represented by two WireWare datapoints. One datapoint has the suffix "#" attached. If datapoints are read by a process inside the connectivity server, the datapoint without suffix is read (the input datapoint). Any write operations are done on the datapoint with the suffix "#" (the output datpoint).

Note: This means in consequence, that any write operation on a datapoint is only seen after the current execution cycle (see next chapter).


The phases of the execution cycle

A machine object is processed in execution cycles by the runtime. A single execution cycle consists of the following phases:

  • Pre-execution
  • Execution
  • Post-execution
  • Remote command processing
  • Copying output to input datapoints
  • Waiting for next cycle

All modules of a machine object are processing the different phases together. In other words, if all modules are reporting, that they have finished processing the current phase, the runtime switches to the next phase. If the runtime contains multiple machine object, the different machine object may in different phases at the same time.

Please do not expect, that the modules are processed in a specific order.


Pre-execution

Any logic, which has to be processed before the normal execution phase, can be placed at this point. This is not used by most modules.


Execution

In this phase the normal logic functions are executed.


Post-execution

Any logic, which has to be processed after the normal execution phase, can be placed at this point. This is not used by most modules.

Remote command processing

Commands, which were send by client applications, are executed in this phase.


Copying output to input datapoints

The output datapoints (with suffix "#") are copied back to the input datapoints (without suffix). The next execution cycle will see the output state of this execution cycle as input state.


Waiting for next cycle

The processing of the machine object will suspend for the configured time. There are two waiting times:

  • Normal: This is the normal time (in ms)
  • Idle: If no datapoint changed in the last execution cycle, this wait time will be used (in ms).


Running a connectivity server process

The configuration of the FACTORITY Connectivity Server is placed in a XML file, which should have the extension "w2xplc" as convention.


Running under Windows

  1. Make sure, that WireWare is installed
  2. Just double click the "w2xplc" file

Note: Any jars, which are placed in the directory WireWare_Install_Dir\jars, are added to the classpath automatically. The same is true for jar files, which are placed in the same directory as the "w2xplc" file.

Running as pure Java process (any supported operating system)

Fire up your favorite Java VM with the start class de.wireware.plc.Runtime with the following parameters:

  1. File name of output log or "-" if stdout should be used
  2. File name of error log or "-" if stderr should be used
  3. Name of configuration file (w2xplc)
  4. Directory, where to store temporary data

Example: java -cp $MYCLASSPATH de.wireware.plc.Runtime - - config.w2xplc /tmp


Running in an installed FACTORITY environment on Linux

The directory "usr/bin" of the FACTORITY installation directory contains the program "fy-softplc", which can be used to start a Connectivity Server. The following parameters are supported:

  • --config=filename: Defines the "w2xplc" file which should be started
  • --debug-port=portnumber: (Optional) If specified, the process is started with remote debugging options and can be connected using the specified port number
  • --sandbox: (Optional) If specified, the process is started in the sandbox environment and uses alternate jars as classpath (for testing software updates)

The program "fy-softplc" takes care of building the classpath and places the log files in the directory "var/log" of the FACTORITY installation directory.

Example: fy-softplc --config=test.w2xplc --sandbox --debug-port=7100


Running the server using the Task Manager

The normal way running the FACTORITY Connectivity Server should be using the FACTORITY Task Manager. For configuring the Task Manager please see the Task Manager page.


Configuring a Connectivity Server process

A minimal configuration file (example.w2xplc) for a Connectivity Server process would be:

<?xml version="1.0" encoding="UTF-8"?>
<wireware-xplc-runtime>
  <!-- 
    -- If the server wants to serve some file (eg. configuration files) to clients, 
    -- a port for a simple web server may be specified. This is optional.
    -->
  <web-server>
    <port>50212</port>
  </web-server>

  <!-- Define some macros for textual replacement -->
  <environment name="myLineId">1000</environment>
  <environment name="myMachineNr">1</environment>ยด

  <!-- Include some more configuration an pass environment variables -->
  <include href="some_more_configs.w2xinc">
    <environment name="environment1_for_include">value1</environment>
    <environment name="environment2_for_include">value2</environment>
  </include>

  <!-- Define a machine object -->
  <machine line-id="{myLineId}" machine-nr="{myMachineNr}">
    <!-- The directory for the web server and temporary files -->
    <config-dir>./{myLineId}/{myMachineNr}</config-dir>

    <!-- The idle and normal cycle time (in ms), see above -->
    <cycle-time-normal>25</cycle-time-normal>
    <cycle-time-idle>75</cycle-time-idle>

    <!-- Add one module to the runtime -->
    <module>
      <class>my.simple.module.Class</class>
      <name>module1</name>
      <param name="param1">value1</param>
      <data>
        ... any module specific configuration data ...
      </data>
    </module>

    <!-- Define some more modules by include and pass environment variables -->
    <include href="some_other_modules.w2xinc">
      <environment name="environment1_for_include">value1</environment>
      <environment name="environment2_for_include">value2</environment>
    </include>
  </machine>

</wireware-xplc-runtime>


Please have a look at the page "Connectivity Server Configuration" for a complete description of configuration options.


See also

Connectivity Server: Standard Modules
Connectivity Server: API
Connectivity Server: Examples

Personal tools