Stations

In Viper.NET, stations represent a (bit-based) communication channel to an external system (PLC, robot, …). Often, stations also correspond to a physical processing or test station.

The handshake used depends on the station. A Standard BV station requires a different interface than, for example, the RunFromDir station for automatic reference image checking.

Alle Stationen werden in der Konfigurationsdatei stations.xml angelegt und beim Start von Viper.NET initialisiert. Alternativ können Stationen über die Benutzeroberfläche im Stationseditor konfiguriert werden. Der Stations-Tab zeigt den Zustand der Handshake-Bits der Stationen.

Digital standard handshake

Digital handshakes in Viper.NET usually work on the principle of a three-way handshake with two signals TRIGGER and BUSY:

../_images/station-digital-handshake.png

Timing diagram

First Viper.NET signals via READY->HIGH that the station is ready to receive triggers. The PLC can then start processing in Viper.NET via TRIGGER->HIGH.

Note

The TRIGGER may only be set by the PLC if the condition READY AND NOT BUSY is met. Otherwise the trigger is ignored by Viper.NET.

The station acknowledges the TRIGGER->HIGH with a BUSY->HIGH and starts processing. The PLC acknowledges the BUSY->HIGH signal with a TRIGGER->LOW.

Hint

The signal BUSY->LOW is only set by Viper.NET if TRIGGER->LOW is detected.

With the signal BUSY->LOW one of the three result bits is also set:

  • IO: Processing was completed with Good.

  • NIO: Processing was completed with Bad.

  • ERROR: An error occurred during processing, as a result of which no result could be determined.

This handshake forms the basis for most Viper.NET stations like the Vision Station, the RunFromDir Station or even the Reinspect Station.

Input data

In addition to the bits for the handshake, input and output data are defined for each station. The input data is read in at the trigger and used in processing. Since the time at which the data is read in cannot be determined exactly, and some data is also accessed during processing, the input data must not be changed during the process.

The data-areas for a station are normally divided into headers and payloads as follows:

../_images/station-data.png

Data areas Station

  • BITS: The bits of the handshake.

  • CMD: Can be used to trigger a specific command.

  • ERRCODE: Optional error code.

  • RESCODE: Optional result code.

  • CMD: Can be used to trigger a specific command. For BV stations, for example, this is used to switch between ToolGroup Items.

Note

In the documentation of individual stations, the significance of the individual fields for this station is explained in more detail.

Station configuration

Stationen über die Konfigurationsdatei stations.xml oder über die Benutzeroberfläche im Stationseditor konfiguriert werden.

Note

It is recommended to use the Stationseditor in the user interface to configure stations.

stations.xml

All stations are created in the configuration file stations.xml. In addition to the configuration of the handshake bits and the input and output data, specific parameters are also specified here. The exact description of the configuration is given in the documentation of the respective station.

Note

After changes to configuration file stations.xml Viper.NET must be restarted.

Stationseditor

The station editor is located under MainMenu Functions (1) GlobalSettings (2) in the Stations tab (3).

Stationseditor

The station editor contains the following tabs with various setting options:

Station editor tabs
  1. Stations: Station list in which new stations can be created and configured.

  2. Reset bits: Here, input signals are defined that can be used to reset all stations.

  3. Livebits toggler: Here, output signals can be added, which then poll with the configured poll cycle.

  4. Trigger servers: Here, ports can be defined on which TRIGGER->HIGH and TRIGGER->LOW signals can be sent to Viper.NET (see Station Trigger Server).

  5. Trigger server description: Overview of the configured trigger servers.

The station editor also contains the following cross-tab buttons:

  1. Reload stations xml: Updates the stations.xml file of the Viper.NET project with the current settings of the station editor.

  2. Edit stations xml: Opens the stations.xml file of the Viper.NET project in a text editor.

  3. Open GIO-HW-Explorer: Opens the HW Explorer.

New stations can be created in the Station tab of the station editor using the configuration buttons:

Station editor tabs

Double-click while holding shift to edit individual fields of the created station directly. A single double-click opens an editor dialog for the respective station, where detailed settings can be made:

Handshake tab of the station editor

In the Handshake tab (1), for example, the digital handshake of the station can be configured. In the lower area of the dialog, individual bits of the handshake can be configured manually. Input and output bits can also be created automatically using the Create GIO Bits (2) button. In the dialog that opens, input and output bits can be created based on the ID of the configured station:

Automatic generation of input and output bits

The Create missing bit IDs button (2) can be used to create input and output bits according to the ID scheme defined above (1). The Create missing GIO bits/data button (3) can be used to generate the corresponding GIO bits. To configure the necessary hardware, the HW Explorer can be opened using the Open GIO-HW-Explorer (4).

Station types

In Viper.NET, depending on the plugin configuration, the following stations exist:

Project specific plugins can provide additional stations.

Station Trigger Server

The stations can also be triggered by a TCP/IP or UDP telegram via the Station Trigger Server as an alternative to the TRIGGER bit. This has the advantage that the TRIGGER bit does not have to be polled. The cyclic data read in GInOut can then be done slower, or can be disabled completely. The handshake still corresponds to the Viper.NET standard. Only the edge change of the TRIGGER bit is replaced.

After changes to configuration file stations.xml Viper.NET must be restarted.

<triggerSvrs stationsExclusiveTriggerdBySvr="-1">
  <triggerSvr localIp="" port="4567" udp="False" maxTcpClients="100" timeoutWaitForTriggerBitHigh="-1" />
</triggerSvrs>
  • stationsExclusiveTriggerdBySvr : Comma-separated list of IDs of stations (-1 := all stations) to be started exclusively via the trigger server.

  • localIp : To bind the server port to a specific network adapter, a local IP address can be specified.

  • port : Local TCP/IP or UDP port.

  • udp: False|0 = TCP/IP connection, True|1* = UDP connection

  • maxTcpClients : Maximum number of TCP/IP connections (if udp=False).

  • timeoutWaitForTriggerBitHigh : Maximum time in [ms] that is waited for the digital trigger signal. The data is read cyclically.

    • < 0 : No waiting for the digital trigger signal.

    • 0: The digital trigger signal must be set after updating the input data.

    • > 0 : The digital trigger signal must be set in [ms] after this time at the latest.

Request and response are pipe-separated NULL-terminated ASCII or UTF8 strings:

Request PLC -> PC: telegramId|stationId or dataId[0x00]
Response PC -> PLC: telegramId|stationId or dataId|ACK[0x00]
  • The telegramId can be freely assigned.

  • stationId : id of the station in the stations.xml.

  • dataId : id of the GInOut data to be read in (mode=UpdateData).

  • mode : Optional parameter, default value : “Slope”.

    • Slope : Positive and negative trigger slope

    • High : Positive trigger edge

    • Low : Negative trigger edge

    • Reset : Resets the station with the ID stationId. If stationId <= 0, all stations are reset.

    • UpdateData : The data with the specified ID dataId are read in from the hardware.

  • acknowledge:

    • Positive response : “ACK[0x00]”

    • Negative answer : “NAK:ErrorText

Example trigger at station ID 1:
Request PLC -> PC: 99|1[0x00]
Positive response PC -> PLC: 99|1|ACK[0x00]
Negative response PC -> PLC: 99|1|NAK:Set starting outputs failed.[0x00]

Viper.NET Stations