secsgem

secsgem is a python package to communicate with a host or equipment system in the semiconductor industry.

The use cases range from writing tests for implementations or features, simulations in development environments to complete host/equipment implementations. Some parts of the package can be used individually, for example HSMS can be used without SECS-II, or the streams and functions can be used with a different networking stack.

Currently there is no support for communication over serial port (SECS-I, SEMI E04). Only ethernet (HSMS, SEMI E37) is available.

HSMS, SECS and GEM are standards from SEMI.

Namespaces

All classes can be accessed with their full module name or directly from the secsgem module.

>>> secsgem.format_hex("Hallo")
'48:61:6c:6c:6f'
>>> secsgem.common.format_hex("Hello")
'48:65:6c:6c:6f'

Thanks

Table of contents

Installation

Official releases are available via Pypi repository. The easiest way to install these is using a package manager like pip:

$ pip install secsgem

In order to use the current development code, which might be instable at times, use the git repository directly:

$ pip install git+git://github.com/bparzella/secsgem

First Steps

secsgem can be used in different ways. You can use it to create a GEM implementation for either equipment and host side. But also implementations on the SECS-II and HSMS levels are possible. Another way to use it is for testing your host or equipment implementation using python unit tests.

Callbacks and events

Callbacks are used to handle requests from the remote system and return a user defined result (eg an alarm has been received and a response is required). Events can notify the implementation about something that occurred (eg the hsms connection was selected). Events don’t return any result to the remote and are executed in the background

Callbacks

Callbacks are used to request information from a specific implementation. They can be used to process the passed information and present a result to the peer. Only one function can be registered for one callback.

The process will wait for the callback to return the result of the calculation. Because of that the callback should run as performant as possible.

There are three ways to define the callback functions, by creating them in the inherited handler, by setting a target object and by registering callbacks. Registered callbacks superseed target and overridden functions.

Inherited handler

When working with a inherited class, callbacks can be implemented by creating callback members with a specific name:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

    def _on_alarm_received(self, handler, ALID, ALCD, ALTX):
        return ACKC5.ACCEPTED

In this example when an alarm was received (callback name is alarm_received) the _on_alarm_received method will be called. The result (in this case ACKC5.ACCEPTED) will be passed to the host sending the alarm.

A generic representation of the function would be:

def _on_<callback_name>(self, handler, <parameters>):
    return <result>

Callbacks for streams/functions can also be overriden this way by following a specific naming:

def _on_s05f01(self, handler, packet):
    return self.stream_function(5, 2)(ACKC5.ACCEPTED)

Note that the stream and function numbers are formated to have a leading zero if they are only one character long. In this case the reply stream/function must be returned.

Target object

These methods don’t need to be implemented on the handler itself. Another object can also be registered using the callbacks member names of the handler. The _on_<callback_name> methods are then searched in that object:

class TestClass(object):
    def _on_alarm_received(self, handler, ALID, ALCD, ALTX):
        return ACKC5.ACCEPTED

t = TestClass()

handler.callbacks.target = t
Registering callbacks

Callbacks can also be registered from outside a class:

def f_alarm_received(handler, ALID, ALCD, ALTX):
    return ACKC5.ACCEPTED

handler.callbacks.alarm_received = f_alarm_received

To unregister simply clear the member:

handler.callbacks.alarm_received = None
Available callbacks
Events

Events will notify the implementation that things happened. They are called asynchronously, the result will be ignored.

There are three ways to define events, by creating them in the inherited handler, by setting target objects in the handlers events property and by registering events.

Inherited handler

When working with a inherited class, events can be implemented by creating members with a specific name:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

    def _on_event_hsms_selected(self, connection):
        pass

In this example when the hsms connection state changes to selected the _on_event_hsms_selected method will be called.

A generic representation of the function would be:

def _on_event_<event_name>(self, <parameters>):
    pass

To catch all events, the _on_event method can be overridden:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

    def _on_event(self, *args):
        pass
Target objects

These methods don’t need to be implemented on the handler itself. Other objects can also be registered using the event member names of the handler. The _on_event_<event_name> and _on_event methods are then searched in that object:

class TestClass(object):
    def _on_event_hsms_selected(self, connection):
        pass

t = TestClass()

handler.events.targets += t

The event handler can work with more than one target objects.

Registering events

Events can also be registered from outside a class:

def f_hsms_selected(connection):
    pass

handler.events.hsms_selected += f_hsms_selected

To unregister simply remove the member:

handler.events.hsms_selected -= f_hsms_selected
Available events

Implementing a GEM equipment

This package can be used to create a GEM equipment implementation. This is done by subclassing the secsgem.gem.equipmenthandler.GemEquipmentHandler class:

import secsgem
import code

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

h = SampleEquipment("127.0.0.1", 5000, False, 0, "sampleequipment")
h.enable()

code.interact("equipment object is available as variable 'h', press ctrl-d to stop", local=locals())

h.disable()
Using your own name

To use your own modelname and version for S1F14 reply you can override the secsgem.gem.handler.GemHandler.MDLN and secsgem.gem.handler.GemHandler.SOFTREV members of the GemHandler:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.MDLN = "gemequp"
        self.SOFTREV = "1.0.0"
Adding status variables

A status variable can be added by inserting an instance of the secsgem.gem.equipmenthandler.StatusVariable class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.status_variables dictionary:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.status_variables.update({
            10: secsgem.StatusVariable(10, "sample1, numeric SVID, SecsVarU4", "meters", secsgem.SecsVarU4, False),
            "SV2": secsgem.StatusVariable("SV2", "sample2, text SVID, SecsVarString", "chars", secsgem.SecsVarString, False),
        })

        self.status_variables[10].value = 123
        self.status_variables["SV2"].value = "sample sv"

Alternatively the values can be acquired using a callback by setting the use_callback parameter of the constructor to True:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.sv1 = 123
        self.sv2 = "sample sv"

        self.status_variables.update({
            10: secsgem.StatusVariable(10, "sample1, numeric SVID, SecsVarU4", "meters", secsgem.SecsVarU4, True),
            "SV2": secsgem.StatusVariable("SV2", "sample2, text SVID, SecsVarString", "chars", secsgem.SecsVarString, True),
        })

    def on_sv_value_request(self, svid, sv):
        if sv.svid == 10:
            return sv.value_type(value=self.sv1)
        elif sv.svid == "SV2":
            return sv.value_type(value=self.sv2)

        return []
Adding equipment constants

An equipment constant can be added by inserting an instance of the secsgem.gem.equipmenthandler.EquipmentConstant class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.status_variables dictionary:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.equipment_constants.update({
            20: secsgem.EquipmentConstant(20, "sample1, numeric ECID, SecsVarU4", 0, 500, 50, "degrees", secsgem.SecsVarU4, False),
            "EC2": secsgem.EquipmentConstant("EC2", "sample2, text ECID, SecsVarString", "", "", "", "chars", secsgem.SecsVarString, False),
        })

        self.status_variables[20].value = 321
        self.status_variables["EC2"].value = "sample ec"

Alternatively the values can be acquired and updated using callbacks by setting the use_callback parameter of the constructor to True:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.ec1 = 321
        self.ec2 = "sample ec"

        self.equipment_constants.update({
            20: secsgem.EquipmentConstant(20, "sample1, numeric ECID, SecsVarU4", 0, 500, 50, "degrees", secsgem.SecsVarU4, True),
            "EC2": secsgem.EquipmentConstant("EC2", "sample2, text ECID, SecsVarString", "", "", "", "chars", secsgem.SecsVarString, True),
        })

    def on_ec_value_request(self, ecid, ec):
        if ec.ecid == 20:
            return ec.value_type(value=self.ec1)
        elif ec.ecid == "EC2":
            return ec.value_type(value=self.ec2)

        return []

    def on_ec_value_update(self, ecid, ec, value):
        if ec.ecid == 20:
            self.ec1 = value
        elif ec.ecid == "EC2":
            self.ec2 = value
Adding collection events

A collection event can be added by inserting an instance of the secsgem.gem.equipmenthandler.CollectionEvent class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.collection_events dictionary. Data values can be added by inserting an instance of the secsgem.gem.equipmenthandler.DataValue class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.data_values dictionary. The data values for a collection event can be passed while creating the secsgem.gem.equipmenthandler.CollectionEvent instance:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.dv1 = 31337

        self.data_values.update({
            30: secsgem.DataValue(30, "sample1, numeric DV, SecsVarU4", secsgem.SecsVarU4, True),
        })

        self.collection_events.update({
            50: secsgem.CollectionEvent(50, "test collection event", [30]),
        })

    def on_dv_value_request(self, dvid, dv):
        if dv.dvid == 30:
            return dv.value_type(value=self.dv1)

        return []

    def trigger_sample_collection_event():
        self.trigger_collection_events([50])
Adding alarms

An alarm can be added by inserting an instance of the secsgem.gem.equipmenthandler.Alarm class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.alarms dictionary. The collection events for the alarm must be provided when adding the alarm. For an example see the section above:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.collection_events.update({
            100025: secsgem.CollectionEvent(100025, "test collection event alarm set", []),
            200025: secsgem.CollectionEvent(200025, "test collection event alarm clear", []),
        })

        self.alarms.update({
            25: secsgem.Alarm(25, "test alarm", "test text", secsgem.ALCD.PERSONAL_SAFETY | secsgem.ALCD.EQUIPMENT_SAFETY, 100025, 200025),
        })

    def set_sample_alarm():
        self.set_alarm(25)

    def clear_sample_alarm():
        self.clear_alarm(25)
Adding remote commands

A remote command can be added by inserting an instance of the secsgem.gem.equipmenthandler.RemoteCommand class to the secsgem.gem.equipmenthandler.GemEquipmentHandler.remote_commands dictionary. The collection event and parameters for the remote command must be provided when adding it. For an example see the section above:

class SampleEquipment(secsgem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.collection_events.update({
            5001: secsgem.CollectionEvent(5001, "TEST_RCMD complete", []),
        })
        self.remote_commands.update({
            "TEST_RCMD": secsgem.RemoteCommand("TEST_RCMD", "test rcmd", ["TEST_PARAMETER"], 5001),
        })

    def on_rcmd_TEST_RCMD(self, TEST_PARAMETER):
        print "remote command TEST_RCMD received"

Custom streams and functions

Custom data item

A new data item is created by overriding the DataItemBase class:

class UNITS_New(DataItemBase):
    __type__ = SecsVarDynamic
    __allowedtypes__ = [SecsVarArray, SecsVarBoolean, SecsVarU1, SecsVarU2, SecsVarU4, SecsVarU8, SecsVarI1, SecsVarI2, SecsVarI4, SecsVarI8, \
        SecsVarF4, SecsVarF8, SecsVarString, SecsVarBinary]

In this case the UNITS field allows all types instead only a string.

Custom stream function

To integrate this new data item in a stream function then you need to inherit secsgem.secs.functionbase.SecsStreamFunction

class SecsS01F12_New(secsgem.SecsStreamFunction):
    _stream = 1
    _function = 12

    _dataFormat = [
        [
            SVID,
            SVNAME,
            UNITS_New
        ]
    ]

    _toHost = True
    _toEquipment = False

    _hasReply = False
    _isReplyRequired = False

    _isMultiBlock = True
Integrate a stream function

Now we want to integrate this stream/function into the secsgem.gem.handler.GemHandler. You create a new class inherited from it and update the function list of that class:

class NewHandler(secsgem.GemHostHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.GemHostHandler.__init__(self, address, port, active, session_id, name, custom_connection_handler)

        self.secsStreamsFunctions[1].update({
            12: SecsS01F12_New,
        })

You can also add new methods and properties to the class if required.

This new class can be used with the secsgem.hsms.connectionmanager.HsmsConnectionManager (see parameter connection_handler of secsgem.hsms.connectionmanager.HsmsConnectionManager.add_peer())

Testing

secsgem can be used to make unit tests on your implementation of the SEMI standard.

Example:

import unittest

import secsgem

class TestExampleSecsGem(unittest.TestCase):
    def setUp(self):
        self.connection = secsgem.GemHostHandler("10.211.55.33", 5000, False, 0, "test")

        self.connection.enable()
        self.connection.waitfor_communicating()

    def tearDown(self):
        self.connection.disable()

    def testLinktest(self):
        result_packet = self.connection.send_linktest_req()

        self.assertEqual(result_packet.header.sType, 6)
        self.assertEqual(result_packet.header.sessionID, 65535)

See file samples/testExample.py

GEM

SEMI 30

GEM defines certain behaviors of the equipment and how to use the SECS messages for that purpose.

Handlers

secsgem.gem.handler.GemHandler inherits the functionality from secsgem.secs.handler.SecsHandler (see Handler).

To distinguish between host and equipment process there are two specialized types of secsgem.gem.handler.GemHandler: secsgem.gem.hosthandler.GemHostHandler and secsgem.gem.equipmenthandler.GemEquipmentHandler. Use GemHostHandler if you want to implement a host system, GemEquipmentHandler for a equipment system.

It automatically handles the whole setup and teardown of the link. Incoming collection events and terminal messages are automatically accepted and propagated by events. The setup of collection event reports is also simplified. It has functionality to send remote commands and handling process programs.

The handler also implements a maintains a communication state, which is defined in the standard.

>>> client = secsgem.GemHostHandler("10.211.55.33", 5000, False, 0, "test")
>>>
>>> client.enable()
>>> client.waitfor_communicating()
True
>>> client.get_process_program_list()
['test1', 'test2']
>>> client.request_process_program('test1')
This is process program test1
>>> client.disable()

Waiting for the communicating state can also be done asynchronous

>>> def on_communicating(event, data):
...     print "Communicating"
...
>>> client = secsgem.GemHostHandler("10.211.55.33", 5000, False, 0, "test")
>>> client.events.handler_communicating += on_communicating
>>>
>>> client.enable()
Communicating
>>> client.get_process_program_list()
['test1', 'test2']
>>> client.request_process_program('test1')
This is process program test1
>>> client.disable()

Also streams/functions can be sent and received with the handler:

>>> f = secsgem.SecsS01F01()
>>> client.send_and_waitfor_response(f)
secsgem.hsms.packets.HsmsPacket({'header': secsgem.hsms.packets.HsmsHeader({'function': 2, 'stream': 1, 'pType': 0, 'system': 14, 'sessionID': 0, 'requireResponse': False, 'sType': 0}), 'data': '\x01\x02A\x06EQUIPMA\x06SV n/a'})
Events

GemHandler defines a few new events, that can be received with the help of secsgem.common.EventHandler:

Event name Description
handler_communicating Connection is setup
collection_event_received Collection event was received
terminal_received Terminal message was received

For an example on how to use these events see the code fragment in Handler.

GEM Compliance

GEM COMPLIANCE STATEMENT
Fundamental GEM Requirements Implemented GEM Compliant
State Models Yes ✓ No No
Equipment Processing States No No
Host-Initiated S1,F13/F14 Scenario Yes ✓ Yes ✓
Event Notification Yes ✓ Yes ✓
On-Line Identification Yes ✓ Yes ✓
Error Messages Yes ✓ Yes ✓
Documentation Yes ✓ No
Control (Operator Initiated) Yes ✓ No
Additional Capabilities Implemented GEM Compliant
Establish Communications Yes ✓ Yes ✓
Dynamic Event Report Configuration Yes ✓ No
Variable Data Collection Yes ✓ Yes ✓
Trace Data Collection No No
Status Data Collection Yes ✓ Yes ✓
Alarm Management Yes ✓ No
Remote Control Yes ✓ Yes ✓
Equipment Constants Yes ✓ No
Process Recipe Management No No
Material Movement No No
Equipment Terminal Services Yes ✓ Yes ✓
Clock No No
Limits Monitoring No No
Spooling No No
Control (Host-Initiated) Yes ✓ Yes ✓
State Models
  • While the communication and control state models are implemented, especially the control state model needs rework.
Equipment Processing States
  • Not implemented yet.
Documentation
  • The documentation isn’t complete yet.
Control (Operator Initiated)
  • Persistence for the ONLINE LOCAL/REMOTE is not yet implemented.
  • The final UI (or hardware) needs the buttons required by this section.
Dynamic Event Report Configuration
  • Persistence for report definitions, report-to-event links and enable status is not yet implemented.
Trace Data Collection
  • Not implemented yet.
Alarm Management
  • Persistence of en-/disable states and report definitions is not implemented yet.
Remote Control
  • The START and STOP remote commands must be implemented to be GEM compliant. Currently only dummy functions are provided
Equipment Constants
  • Persistence of the equipment constants is not implemented yet.
  • Limiting changing equipment to “safe” states is not yet implemented?
  • Equipment constant changed collection event is not yet implemented.
Process Recipe Management
  • Not implemented yet.
Material Movement
  • Not implemented yet.
Equipment Terminal Services
  • The UI requirements can’t be fulfilled by the library
Clock
  • Not implemented yet.
Limits Monitoring
  • Not implemented yet.
Spooling
  • Not implemented yet.

SECS

SEMI E5

SECS-II defines the messages the data is transferred in between host and equipment over the HSMS protocol (and SECS-I serial). It specifies data types that contain the data and streams and functions that use these types for specific purposes.

Variables

SECS defines a few types to transmit data in.

Data Type Class Code
List secsgem.secs.variables.SecsVarArray L
List secsgem.secs.variables.SecsVarList L
Binary secsgem.secs.variables.SecsVarBinary B
Boolean secsgem.secs.variables.SecsVarBoolean TF
ASCII secsgem.secs.variables.SecsVarString A
8-Byte integer secsgem.secs.variables.SecsVarI8 I8
1-Byte integer secsgem.secs.variables.SecsVarI1 I1
2-Byte integer secsgem.secs.variables.SecsVarI2 I2
4-Byte integer secsgem.secs.variables.SecsVarI4 I4
8-Byte float secsgem.secs.variables.SecsVarF8 F8
4-Byte float secsgem.secs.variables.SecsVarF4 F8
8-Byte unsigned integer secsgem.secs.variables.SecsVarU8 U8
1-Byte unsigned integer secsgem.secs.variables.SecsVarU1 U1
2-Byte unsigned integer secsgem.secs.variables.SecsVarU2 U2
4-Byte unsigned integer secsgem.secs.variables.SecsVarU4 U4

Example:

>>> secsgem.SecsVarString("TESTString")
<A "TESTString">
>>> secsgem.SecsVarBoolean(True)
<BOOLEAN True >
>>> secsgem.SecsVarU4(1337)
<U4 1337 >
Type arrays

The numeric types can also be an array of that type:

>>> secsgem.SecsVarU1([1, 2, 3, 4])
<U1 1 2 3 4 >
>>> secsgem.SecsVarBoolean([True, False, False, True])
<BOOLEAN True False False True >

The length of this array can be fixed with the length parameter:

>>> secsgem.SecsVarU1([1, 2, 3], count=3)
<U1 1 2 3 >
>>> secsgem.SecsVarU1([1, 2, 3, 4], count=3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ext005207/Development/secsgem/secsgem/secs/variables.py", line 1439, in __init__
    self.set(value)
  File "/home/ext005207/Development/secsgem/secsgem/secs/variables.py", line 1537, in set
    raise ValueError("Value longer than {} chars".format(self.count))
ValueError: Value longer than 3 chars
>>> secsgem.SecsVarString("Hello", count=3).get()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ext005207/Development/secsgem/secsgem/secs/variables.py", line 1220, in __init__
    self.set(value)
  File "/home/ext005207/Development/secsgem/secsgem/secs/variables.py", line 1337, in set
    raise ValueError("Value longer than {} chars ({} chars)".format(self.count, len(value)))
ValueError: Value longer than 3 chars (5 chars)
Getting data

The data can be accessed with the secsgem.secs.variables.SecsVarU1.get() method, arrays can be accessed using the index operator:

>>> secsgem.SecsVarU1(1).get()
1
>>> secsgem.SecsVarU1([1, 2, 3], count=3).get()
[1, 2, 3]
>>> secsgem.SecsVarU1(1)[0]
1
>>> secsgem.SecsVarU1([1, 2, 3])[1]
2
Setting data

The data can be set with the secsgem.secs.variables.SecsVarString.set() method, arrays can be updated using the index operator:

>>> v=secsgem.SecsVarU1([1, 2, 3], count=3)
>>> v.set([3, 2, 1])
>>> v
<U1 3 2 1 >
>>> v[0] = 1
>>> v
<U1 1 2 1 >
En-/Decoding

The variable types can secsgem.secs.variables.SecsVarArray.encode() and secsgem.secs.variables.SecsVarString.decode() themselves to ASCII data transferrable with the HSMS protocol:

>>> v=secsgem.SecsVarString("Hello")
>>> d=v.encode()
>>> d
'A\x05Hello'
>>> secsgem.format_hex(d)
'41:05:48:65:6c:6c:6f'
>>> v.set("NewText")
>>> v
<A "NewText">
>>> v.decode(d)
7
>>> v
<A "Hello">
SecsVarArray

secsgem.secs.variables.SecsVarArray is a special type for a list of the same type. The items of the array can be accessed with the index operator.

>>> v=secsgem.SecsVarArray(secsgem.SecsVarU4)
>>> v.set([1, 2, 3])
>>> v
<L [3]
<U4 1 >
<U4 2 >
<U4 3 >

> >>> v.get() [1, 2, 3] >>> v[1] <U4 2 >

A new item can be appended to the array with the secsgem.secs.variables.SecsVarArray.append() method.

SecsVarList

secsgem.secs.variables.SecsVarList is a special type for a list of the different types. The items of the list can be accessed like properties of the object.

An ordered dictionary is required for the creation, because pythons default dictionary will be randomly sorted. Sorting is essential because both peers need to have the data in the same order.

>>> v=secsgem.SecsVarList([secsgem.OBJACK, secsgem.SOFTREV])
>>> v.OBJACK=3
>>> v.SOFTREV="Hallo"
>>> v
<L [2]
<U1 3 >
<A "Hallo">

> >>> v.SOFTREV <A “Hallo”> >>> secsgem.format_hex(v.encode()) ‘01:02:a5:01:03:41:05:48:61:6c:6c:6f’

SecsVarDynamic

secsgem.secs.variables.SecsVarDynamic can take different types, if specified to a certain set of types.

>>> v=secsgem.SecsVarDynamic([secsgem.SecsVarString, secsgem.SecsVarU1])
>>> v.set(secsgem.SecsVarString("Hello"))
>>> v
<A "Hello">
>>> v.set(secsgem.SecsVarU1(10))
>>> v
<U1 10 >
>>> v.set(secsgem.SecsVarU4(10))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ext005207/Development/secsgem/secsgem/secs/variables.py", line 255, in set
    raise ValueError("Unsupported type {} for this instance of SecsVarDynamic, allowed {}".format(value.__class__.__name__, self.types))
ValueError: Unsupported type SecsVarU4 for this instance of SecsVarDynamic, allowed [<class 'secsgem.secs.variables.SecsVarString'>, <class 'secsgem.secs.variables.SecsVarU1'>]

Functions

A function is inherited from secsgem.secs.functionbase.SecsStreamFunction.

Example:

class SecsS02F33(SecsStreamFunction):
    _stream = 2
    _function = 33

    _dataFormat = [
        DATAID,
        [
            [
                RPTID,
                [VID]
            ]
        ]
    ]

    _toHost = False
    _toEquipment = True

    _hasReply = True
    _isReplyRequired = True

    _isMultiBlock = True

The data of a function can be read and manipulated with the same functionality as the variables. secsgem.secs.functionbase.SecsStreamFunction.set(), secsgem.secs.functionbase.SecsStreamFunction.get(), secsgem.secs.functionbase.SecsStreamFunction.append(), the index operator and object properties. The objects can also en- and decode themselves.

Usage:

>>> f=secsgem.SecsS02F33()
>>> f.DATAID=10
>>> f.DATA.append({"RPTID": 5, "VID": ["Hello", "Hallo"]})
>>> f.DATA.append({"RPTID": 6, "VID": ["1", "2"]})
>>> f
S2F33 W
<L [2]
    <U1 10 >
    <L [2]
    <L [2]
        <U1 5 >
        <L [2]
        <A "Hello">
        <A "Hallo">
        >
    >
    <L [2]
        <U1 6 >
        <L [2]
        <A "1">
        <A "2">
        >
    >
    >
> .
>>> f.DATA[1].VID[0]="Goodbye"
>>> f.DATA[1].VID[1]="Auf Wiedersehen"
>>> f
S2F33 W
<L [2]
    <U1 10 >
    <L [2]
    <L [2]
        <U1 5 >
        <L [2]
        <A "Hello">
        <A "Hallo">
        >
    >
    <L [2]
        <U1 6 >
        <L [2]
        <A "Goodbye">
        <A "Auf Wiedersehen">
        >
    >
    >
> .
>>> secsgem.format_hex(f.encode())
'01:02:a5:01:0a:01:02:01:02:a5:01:05:01:02:41:05:48:65:6c:6c:6f:41:05:48:61:6c:6c:6f:01:02:a5:01:06:01:02:41:07:47:6f:6f:64:62:79:65:41:0f:41:75:66:20:57:69:65:64:65:72:73:65:68:65:6e'

The encoded data can be used as data string in a secsgem.hsms.packets.HsmsPacket together with a secsgem.hsms.packets.HsmsStreamFunctionHeader. See Packets.

Handler

secsgem.secs.handler.SecsHandler inherits the functionality from secsgem.hsms.handler.HsmsHandler (see Handler).

The SecsHandler has additional functionality to add callbacks for specific streams and functions.

>>> def s01f13_handler(connection, packet):
...     print "S1F13 received"
...
>>> def on_connect(event, data):
...     print "Connected"
...
>>> client = secsgem.SecsHandler("10.211.55.33", 5000, False, 0, "test")
>>> client.events.hsms_connected += on_connect
>>> client.register_stream_function(1, 13, s01f13_handler)
>>>
>>> client.enable()
Connected
S1F13 received
>>> client.disable()

There is also additional functionality concerning collection events, service variables and equipment constants.

HSMS

SEMI E37

HSMS defines the communication between host and equipment over the TCP protocol. It specifies packets used to initiate and terminate the connection, check if the link is still active and transfer the actual data.

Packets

A HSMS packet secsgem.hsms.packets.HsmsPacket consists of a header secsgem.hsms.packets.HsmsHeader and a data part represented by a string. The string contains the additional data encoded as ASCII characters for transmission over TCP. The additional data is only required for a stream/function packet.

>>> secsgem.hsms.packets.HsmsPacket(secsgem.hsms.packets.HsmsLinktestReqHeader(2))
secsgem.hsms.packets.HsmsPacket({'header': secsgem.hsms.packets.HsmsLinktestReqHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 2, 'sessionID': 65535, 'requireResponse': False, 'sType': 5}), 'data': ''})

Every header has a system id to match the response to a certain request. The system id is the first parameter to the headers constructor. The connection keeps track of the system id, a new one can be requested with the secsgem.hsms.connections.HsmsConnection.get_next_system_counter() function.

HSMS packet objects can encode themselves with the secsgem.hsms.packets.HsmsPacket.encode() function to a string, which can be sent over the TCP connection.

>>> packet = secsgem.hsms.packets.HsmsPacket(secsgem.hsms.packets.HsmsLinktestReqHeader(2))
>>> secsgem.common.format_hex(packet.encode())
'00:00:00:0a:ff:ff:00:00:00:05:00:00:00:02'

The other way around, a HSMS packet object can be created from the ASCII string with the secsgem.hsms.packets.HsmsPacket.decode() function.

>>> secsgem.hsms.packets.HsmsPacket.decode(packetData)
secsgem.hsms.packets.HsmsPacket({'header': secsgem.hsms.packets.HsmsHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 2, 'sessionID': 65535, 'requireResponse': False, 'sType': 5}), 'data': ''})

There are classes inherited from secsgem.hsms.packets.HsmsHeader for all HSMS packet types available:

Type Class SType
Select Request secsgem.hsms.packets.HsmsSelectReqHeader 1
Select Response secsgem.hsms.packets.HsmsSelectRspHeader 2
Deselect Request secsgem.hsms.packets.HsmsDeselectReqHeader 3
Deselect Response secsgem.hsms.packets.HsmsDeselectRspHeader 4
Linktest Request secsgem.hsms.packets.HsmsLinktestReqHeader 5
Linktest Response secsgem.hsms.packets.HsmsLinktestRspHeader 6
Reject Request secsgem.hsms.packets.HsmsRejectReqHeader 7
Separate Request secsgem.hsms.packets.HsmsSeparateReqHeader 9
Data Message secsgem.hsms.packets.HsmsStreamFunctionHeader 0
Select Request

Establish HSMS communication

>>> secsgem.hsms.packets.HsmsSelectReqHeader(14)
secsgem.hsms.packets.HsmsSelectReqHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 14, 'sessionID': 65535, 'requireResponse': False, 'sType': 1})
Select Response

Result of select request

>>> secsgem.hsms.packets.HsmsSelectRspHeader(24)
secsgem.hsms.packets.HsmsSelectRspHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 24, 'sessionID': 65535, 'requireResponse': False, 'sType': 2})
Deselect Request

Grateful close HSMS communication before disconnecting

>>> secsgem.hsms.packets.HsmsDeselectReqHeader(1)
secsgem.hsms.packets.HsmsDeselectReqHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 1, 'sessionID': 65535, 'requireResponse': False, 'sType': 3})
Deselect Response

Result of deselect request

>>> secsgem.hsms.packets.HsmsDeselectRspHeader(1)
secsgem.hsms.packets.HsmsDeselectRspHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 1, 'sessionID': 65535, 'requireResponse': False, 'sType': 4})
Linktest Request

Check the HSMS connection link is good

>>> secsgem.hsms.packets.HsmsLinktestReqHeader(2)
secsgem.hsms.packets.HsmsLinktestReqHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 2, 'sessionID': 65535, 'requireResponse': False, 'sType': 5})
Linktest Response

Result of linktest request

>>> secsgem.hsms.packets.HsmsLinktestRspHeader(10)
secsgem.hsms.packets.HsmsLinktestRspHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 10, 'sessionID': 65535, 'requireResponse': False, 'sType': 6})
Reject Request

Response to unsupported HSMS message

>>> secsgem.hsms.packets.HsmsRejectReqHeader(17, 3, 4)
secsgem.hsms.packets.HsmsRejectReqHeader({'function': 4, 'stream': 3, 'pType': 0, 'system': 17, 'sessionID': 65535, 'requireResponse': False, 'sType': 7})
Separate Request

Immediate termination of the HSMS connection

>>> secsgem.hsms.packets.HsmsSeparateReqHeader(17)
secsgem.hsms.packets.HsmsSeparateReqHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 17, 'sessionID': 65535, 'requireResponse': False, 'sType': 9})
Data Message

Secs stream and function message

>>> secsgem.hsms.packets.HsmsStreamFunctionHeader(22, 1, 1, True, 100)
secsgem.hsms.packets.HsmsStreamFunctionHeader({'function': 1, 'stream': 1, 'pType': 0, 'system': 22, 'sessionID': 100, 'requireResponse': True, 'sType': 0})

Connections

HSMS has active and passive connections. The active connection is the one making the connection, the passive one is waiting for the incoming connection.

The implementation for the active connection is secsgem.hsms.connections.HsmsActiveConnection. For the passive connection there are two implementations:

All connection classes are based on the secsgem.hsms.connections.HsmsConnection class, which provides common functionality for all connection types.

The connection process for active and passive connections can be started with the secsgem.hsms.connections.HsmsPassiveConnection.enable() function, and stopped with the secsgem.hsms.connections.HsmsPassiveConnection.disable() function.

Delegates

All connections work with delegates. When a connection is established/terminated or a packet is received a method of the passed delegate object will be called. The connections support the following delegates:

  • on_connection_established(connection)
  • on_connection_packet_received(response)
  • on_connection_before_closed(connection)
  • on_connection_closed(connection)

Sample delegate class:

class DelegateSample:
    def on_connection_established(self, connection):
        print "Connection established"

    def on_connection_packet_received(self, connection, packet):
        print "Packet received", packet

    def on_connection_before_closed(self, connection):
        print "Connection about to be terminated"

    def on_connection_closed(self, connection):
        print "Connection terminated"
Active connection

For the active connection the first parameter is the IP address of the peer, the second parameter is the port of the peer. The third parameter is the session id the peer is configured for.

Example:

>>> delegate = DelegateSample()
>>> conn = secsgem.HsmsActiveConnection('10.211.55.33', 5000, 0, delegate)
>>> conn.enable()
Connection established
Packet received header: {sessionID:0x0000, stream:00, function:04, pType:0x00, sType:0x07, system:0x00000000, requireResponse:0}
Packet received header: {sessionID:0x0000, stream:00, function:01, pType:0x00, sType:0x07, system:0x00000000, requireResponse:0}
Connection about to be terminated
Connection terminated
>>> conn.disable()
Passive connection

For the passive connection the first parameter is the expected IP address of the peer, the second parameter is the port to listen on. The third parameter is the session id the peer is configured for.

Example:

>>> delegate = DelegateSample()
>>> conn = secsgem.HsmsPassiveConnection('10.211.55.33', 5000, 0, delegate)
>>> conn.enable()
Connection established
Packet received header: {sessionID:0xffff, stream:00, function:00, pType:0x00, sType:0x01, system:0x00000001, requireResponse:0}
Packet received header: {sessionID:0x0000, stream:00, function:03, pType:0x00, sType:0x07, system:0x00000000, requireResponse:0}
Connection about to be terminated
Connection terminated
>>> conn.disable()
Multi-passive connection

In this mode one listening port handles the incoming connections for more than one peer. A instance of secsgem.hsms.connections.HsmsMultiPassiveServer is created and connection is created using its secsgem.hsms.connections.HsmsMultiPassiveServer.create_connection() method. The parameters of the method are the same as for the Passive connection. For every available peer a connection must be created using this method.

Example:

>>> delegate = DelegateSample()
>>> server = secsgem.HsmsMultiPassiveServer(5000)
>>> conn = server.create_connection('10.211.55.33', 5000, 0, delegate)
>>> conn.enable()
>>> server.start()
Connection established
Packet received header: {sessionID:0xffff, stream:00, function:00, pType:0x00, sType:0x01, system:0x00000003, requireResponse:0}
Packet received header: {sessionID:0x0000, stream:00, function:03, pType:0x00, sType:0x07, system:0x00000000, requireResponse:0}
Connection about to be terminated
Connection terminated
>>> conn.disable()
>>> server.stop()
Connection manager

The secsgem.hsms.connectionmanager.HsmsConnectionManager can be used to manage multiple active and passive connections. It creates and removes secsgem.hsms.connections.HsmsActiveConnection and secsgem.hsms.connections.HsmsMultiPassiveServer/secsgem.hsms.connections.HsmsMultiPassiveConnection dynamically.

>>> manager=secsgem.HsmsConnectionManager()
>>> handler=manager.add_peer("connection", '10.211.55.33', 5000, False, 0)
>>> handler.enable()
>>> handler.send_linktest_req()
secsgem.hsms.packets.HsmsPacket({'header': secsgem.hsms.packets.HsmsHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 13, 'sessionID': 65535, 'requireResponse': False, 'sType': 6}), 'data': ''})
>>> handler.disable()
>>> manager.stop()

Connection manager works with handlers which take care of a lot of the required communication on the matching level (secsgem.hsms.handler.HsmsHandler, secsgem.secs.handler.SecsHandler and secsgem.gem.handler.GemHandler).

Handler

secsgem.hsms.handler.HsmsHandler has the basic HSMS connection handling build in. It automatically selects and deselects the link and performs a periodic linktest. It also replies to incoming HSMS requests like linktest automatically.

>>> def on_connect(event, data):
...     print "Connected"
...
>>> client = secsgem.HsmsHandler("10.211.55.33", 5000, False, 0, "test")
>>> client.events.hsms_connected += on_connect
>>> client.enable()
Connected
>>> client.send_linktest_req()
secsgem.hsms.packets.HsmsPacket({'header': secsgem.hsms.packets.HsmsHeader({'function': 0, 'stream': 0, 'pType': 0, 'system': 7, 'sessionID': 65535, 'requireResponse': False, 'sType': 6}), 'data': ''})
>>> client.disable()

The handler has functions to send requests and responses and wait for a certain response.

Events

Events of the handler can be received with the help of secsgem.common.EventHandler. The handler sends the following events:

Event name Description
hsms_connected Connection was established
hsms_selected Connection was selected
hsms_disconnected Connection was terminated

For an example on how to use these events see the code fragment above.

Class reference

HSMS

Packets
class secsgem.hsms.packets.HsmsPacket(header=None, data=b'')[source]

Bases: object

Class for hsms packet.

Contains all required data and functions.

encode()[source]

Encode packet data to hsms packet.

Returns:encoded packet
Return type:string

Example:

>>> import secsgem
>>>
>>> packet = secsgem.hsms.packets.HsmsPacket(secsgem.hsms.packets.HsmsLinktestReqHeader(2))
>>> secsgem.common.format_hex(packet.encode())
'00:00:00:0a:ff:ff:00:00:00:05:00:00:00:02'
static decode(text)[source]

Decode byte array hsms packet to HsmsPacket object.

Returns:received packet object
Return type:secsgem.hsms.packets.HsmsPacket

Example:

>>> import secsgem
>>>
>>> packetData = b"\x00\x00\x00\x0b\xff\xff\x00\x00\x00\x05\x00\x00\x00\x02"
>>>
>>> secsgem.format_hex(packetData)
'00:00:00:0b:ff:ff:00:00:00:05:00:00:00:02'
>>>
>>> secsgem.hsms.packets.HsmsPacket.decode(packetData)
HsmsPacket({'header': HsmsHeader({sessionID:0xffff, stream:00, function:00, pType:0x00, sType:0x05, system:0x00000002, requireResponse:False}), 'data': ''})
class secsgem.hsms.packets.HsmsHeader(system, session_id)[source]

Bases: object

Generic HSMS header.

Base for different specific headers

encode()[source]

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsStreamFunctionHeader(system, stream, function, require_response, session_id)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for SECS message.

Header for message with SType 0.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsSelectReqHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Select Request.

Header for message with SType 1.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsSelectRspHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Select Response.

Header for message with SType 2.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsDeselectReqHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Deselect Request.

Header for message with SType 3.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsDeselectRspHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Deselect Response.

Header for message with SType 4.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsLinktestReqHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Linktest Request.

Header for message with SType 5.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsLinktestRspHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Linktest Response.

Header for message with SType 6.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsRejectReqHeader(system, s_type, reason)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Reject Request.

Header for message with SType 7.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
class secsgem.hsms.packets.HsmsSeparateReqHeader(system)[source]

Bases: secsgem.hsms.packets.HsmsHeader

Header for Separate Request.

Header for message with SType 9.

encode()

Encode header to hsms packet.

Returns:encoded header
Return type:string

Example:

>>> import secsgem
>>>
>>> header = secsgem.hsms.packets.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
Connections
class secsgem.hsms.connections.HsmsConnection(active, address, port, session_id=0, delegate=None)[source]

Bases: object

Connection class used for active and passive hsms connections.

selectTimeout = 0.5

Timeout for select calls .

sendBlockSize = 1048576

Block size for outbound data .

T3 = 45.0

Reply Timeout .

T5 = 10.0

Connect Separation Time .

T6 = 5.0

Control Transaction Timeout .

disconnect()[source]

Close connection.

send_packet(packet)[source]

Send the ASCII coded packet to the remote host.

Parameters:packet (string / byte array) – encoded data to be transmitted
class secsgem.hsms.connections.HsmsActiveConnection(address, port=5000, session_id=0, delegate=None)[source]

Bases: secsgem.hsms.connections.HsmsConnection

Client class for single active (outgoing) connection.

T3 = 45.0
T5 = 10.0
T6 = 5.0
disconnect()

Close connection.

selectTimeout = 0.5
sendBlockSize = 1048576
send_packet(packet)

Send the ASCII coded packet to the remote host.

Parameters:packet (string / byte array) – encoded data to be transmitted
enable()[source]

Enable the connection.

Starts the connection process to the passive remote.

disable()[source]

Disable the connection.

Stops all connection attempts, and closes the connection

class secsgem.hsms.connections.HsmsPassiveConnection(address, port=5000, session_id=0, delegate=None)[source]

Bases: secsgem.hsms.connections.HsmsConnection

Server class for single passive (incoming) connection.

Creates a listening socket and waits for one incoming connection on this socket. After the connection is established the listening socket is closed.

enable()[source]

Enable the connection.

Starts the connection process to the passive remote.

disable()[source]

Disable the connection.

Stops all connection attempts, and closes the connection

T3 = 45.0
T5 = 10.0
T6 = 5.0
disconnect()

Close connection.

selectTimeout = 0.5
sendBlockSize = 1048576
send_packet(packet)

Send the ASCII coded packet to the remote host.

Parameters:packet (string / byte array) – encoded data to be transmitted
class secsgem.hsms.connections.HsmsMultiPassiveConnection(address, port=5000, session_id=0, delegate=None)[source]

Bases: secsgem.hsms.connections.HsmsConnection

Connection class for single connection from secsgem.hsms.connections.HsmsMultiPassiveServer.

Handles connections incoming connection from secsgem.hsms.connections.HsmsMultiPassiveServer

on_connected(sock, address)[source]

Connected callback for secsgem.hsms.connections.HsmsMultiPassiveServer.

Parameters:
  • sock (Socket) – Socket for new connection
  • address (string) – IP address of remote host
enable()[source]

Enable the connection.

Starts the connection process to the passive remote.

disable()[source]

Disable the connection.

Stops all connection attempts, and closes the connection

T3 = 45.0
T5 = 10.0
T6 = 5.0
disconnect()

Close connection.

selectTimeout = 0.5
sendBlockSize = 1048576
send_packet(packet)

Send the ASCII coded packet to the remote host.

Parameters:packet (string / byte array) – encoded data to be transmitted
class secsgem.hsms.connections.HsmsMultiPassiveServer(port=5000)[source]

Bases: object

Server class for multiple passive (incoming) connection.

The server creates a listening socket and waits for incoming connections on this socket.

selectTimeout = 0.5

Timeout for select calls .

create_connection(address, port=5000, session_id=0, delegate=None)[source]

Create and remember connection for the server.

Parameters:
  • address (string) – IP address of target host
  • port (integer) – TCP port of target host
  • session_id (integer) – session / device ID to use for connection
  • delegate (object) – target for messages
start()[source]

Starts the server and returns.

It will launch a listener running in background to wait for incoming connections.

stop(terminate_connections=True)[source]

Stops the server. The background job waiting for incoming connections will be terminated.

Optionally all connections received will be closed.

Parameters:terminate_connections (boolean) – terminate all connection made by this server
Handler
class secsgem.hsms.handler.HsmsHandler(address, port, active, session_id, name, custom_connection_handler=None)[source]

Bases: object

Baseclass for creating Host/Equipment models.

This layer contains the HSMS functionality. Inherit from this class and override required functions.

events

Property for event handling.

callbacks

Property for callback handling.

get_next_system_counter()[source]

Returns the next System.

Returns:System for the next command
Return type:integer
on_connection_established(_)[source]

Connection was established.

on_connection_before_closed(_)[source]

Connection is about to be closed.

on_connection_closed(_)[source]

Connection was closed.

on_connection_packet_received(_, packet)[source]

Packet received by connection.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – received data packet
enable()[source]

Enables the connection.

disable()[source]

Disables the connection.

send_stream_function(packet)[source]

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
send_and_waitfor_response(packet)[source]

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
Returns:Packet that was received
Return type:secsgem.hsms.packets.HsmsPacket
send_response(function, system)[source]

Send response function for system.

Parameters:
send_select_req()[source]

Send a Select Request to the remote host.

Returns:System of the sent request
Return type:integer
send_select_rsp(system_id)[source]

Send a Select Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_linktest_req()[source]

Send a Linktest Request to the remote host.

Returns:System of the sent request
Return type:integer
send_linktest_rsp(system_id)[source]

Send a Linktest Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_deselect_req()[source]

Send a Deselect Request to the remote host.

Returns:System of the sent request
Return type:integer
send_deselect_rsp(system_id)[source]

Send a Deselect Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_reject_rsp(system_id, s_type, reason)[source]

Send a Reject Response to the remote host.

Parameters:
  • system_id (integer) – System of the request to reply for
  • s_type (integer) – s_type of rejected message
  • reason (integer) – reason for rejection
send_separate_req()[source]

Send a Separate Request to the remote host.

ConnectionManager
class secsgem.hsms.connectionmanager.HsmsConnectionManager[source]

Bases: object

High level class that handles multiple active and passive connections and the model for them.

events

Property for event handling.

has_connection_to(index)[source]

Check if connection to certain peer exists.

Parameters:index (string) – Name of the reqested handler.
Returns:Is peer available
Return type:boolean
static get_connection_id(address)[source]

Generates connection ids used for internal indexing.

Parameters:address (string) – The IP address for the affected remote.
add_peer(name, address, port, active, session_id, connection_handler=<class 'secsgem.hsms.handler.HsmsHandler'>)[source]

Add a new connection.

Parameters:
  • name (string) – Name of the peers configuration
  • address (string) – IP address of peer
  • port (integer) – TCP port of peer
  • active (boolean) – Is the connection active (True) or passive (False)
  • session_id (integer) – session / device ID of peer
  • connection_handler (inherited from secsgem.hsms.handler.HsmsHandler) – Model handling this connection
remove_peer(name, address, port)[source]

Remove a previously added connection.

Parameters:
  • name (string) – Name of the peers configuration
  • address (string) – IP address of peer
  • port (integer) – TCP port of peer
stop()[source]

Stop all servers and terminate the connections.

SECS

Variables

SECS variable types.

class secsgem.secs.variables.SecsVar[source]

Bases: object

Base class for SECS variables.

Due to the python types, wrapper classes for variables are required. If constructor is called with SecsVar or subclass only the value is copied.

formatCode = -1
static generate(dataformat)[source]

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)[source]

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)[source]

Set the internal value to the provided value.

Parameters:value (various) – new value
encode_item_header(length)[source]

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
decode_item_header(data, text_pos=0)[source]

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

class secsgem.secs.variables.SecsVarDynamic(types, value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

Variable with interchangable type.

set(value)[source]

Set the internal value to the provided value.

In doubt provide the variable wrapped in the matching secsgem.secs.variables.SecsVar class, to avoid confusion.

Example:

>>> import secsgem
>>>
>>> var = secsgem.SecsVarDynamic([secsgem.SecsVarString, secsgem.SecsVarU1])
>>> var.set(secsgem.SecsVarU1(10))
>>> var
<U1 10 >

If no type is provided the default type is used which might not be the expected type.

Parameters:value (various) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:various
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
formatCode = -1
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
class secsgem.secs.variables.ANYVALUE(value=None)[source]

Bases: secsgem.secs.variables.SecsVarDynamic

Dummy data item for generation of unknown types.

Types:
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
formatCode = -1
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:various
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

In doubt provide the variable wrapped in the matching secsgem.secs.variables.SecsVar class, to avoid confusion.

Example:

>>> import secsgem
>>>
>>> var = secsgem.SecsVarDynamic([secsgem.SecsVarString, secsgem.SecsVarU1])
>>> var.set(secsgem.SecsVarU1(10))
>>> var
<U1 10 >

If no type is provided the default type is used which might not be the expected type.

Parameters:value (various) – new value
class secsgem.secs.variables.SecsVarList(dataformat, value=None)[source]

Bases: secsgem.secs.variables.SecsVar

List variable type. List with items of different types.

formatCode = 0
textCode = 'L'
preferredTypes = [<class 'dict'>]
static get_format(dataformat, showname=False)[source]

Gets the format of the variable.

Returns:returns the string representation of the function
Return type:string
static get_name_from_format(dataformat)[source]

Generates a name for the passed dataformat.

Parameters:dataformat (list/SecsVar based class) – dataformat to get name for
Returns:name for dataformat
Return type:str
set(value)[source]

Set the internal value to the provided value.

Parameters:value (dict/list) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
class secsgem.secs.variables.SecsVarArray(dataFormat, value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

List variable type. List with items of same type.

formatCode = 0
textCode = 'L'
preferredTypes = [<class 'list'>]
static get_format(dataformat, showname=False)[source]

Gets the format of the variable.

Returns:returns the string representation of the function
Return type:string
append(data)[source]

Append data to the internal list.

Parameters:value (various) – new value
set(value)[source]

Set the internal value to the provided value.

Parameters:value (list) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
class secsgem.secs.variables.SecsVarBinary(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

Secs type for binary data.

formatCode = 8
textCode = 'B'
preferredTypes = [<class 'bytes'>, <class 'bytearray'>]
supports_value(value)[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list/integer
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
class secsgem.secs.variables.SecsVarBoolean(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

Secs type for boolean data.

formatCode = 9
textCode = 'BOOLEAN'
preferredTypes = [<class 'bool'>]
supports_value(value)[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (list/boolean) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list/boolean
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
class secsgem.secs.variables.SecsVarText(value='', count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

Secs type base for any text data.

formatCode = -1
textCode = ''
controlChars = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xad'
coding = ''
supports_value(value)[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:string
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
class secsgem.secs.variables.SecsVarString(value='', count=-1)[source]

Bases: secsgem.secs.variables.SecsVarText

Secs type for string data.

Parameters:
  • value (string) – initial value
  • count (integer) – number of items this value
formatCode = 16
textCode = 'A'
preferredTypes = [<class 'bytes'>, <class 'str'>]
controlChars = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
coding = 'latin-1'
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:string
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarJIS8(value='', count=-1)[source]

Bases: secsgem.secs.variables.SecsVarText

Secs type for string data.

Parameters:
  • value (string) – initial value
  • count (integer) – number of items this value
formatCode = 17
textCode = 'J'
preferredTypes = [<class 'bytes'>, <class 'str'>]
controlChars = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xad'
coding = 'jis-8'
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:string
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarNumber(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVar

Secs base type for numeric data.

formatCode = 0
textCode = ''
supports_value(value)[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list/integer/float
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
class secsgem.secs.variables.SecsVarI8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 8 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 24
textCode = 'I8'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarI1(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 1 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 25
textCode = 'I1'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarI2(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 2 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 26
textCode = 'I2'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarI4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 4 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 28
textCode = 'I4'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarF8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 8 byte float data.

Parameters:
  • value (list/float) – initial value
  • count (integer) – number of items this value
formatCode = 32
textCode = 'F8'
preferredTypes = [<class 'float'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarF4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 4 byte float data.

Parameters:
  • value (list/float) – initial value
  • count (integer) – number of items this value
formatCode = 36
textCode = 'F4'
preferredTypes = [<class 'float'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarU8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 8 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 40
textCode = 'U8'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarU1(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 1 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 41
textCode = 'U1'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarU2(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 2 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 42
textCode = 'U2'
preferredTypes = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.SecsVarU4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.SecsVarNumber

Secs type for 4 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
formatCode = 44
textCode = 'U4'
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
static generate(dataformat)

Generate actual variable from data format.

Parameters:dataformat (list/SecsVar based class) – dataformat to create variable for
Returns:created variable
Return type:SecsVar based class
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
static get_format(dataformat, showname=False)

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value)

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
preferredTypes = [<class 'int'>]
Data Items

Data items for functions.

class secsgem.secs.dataitems.DataItemMeta[source]

Bases: type

Meta class for data items.

class secsgem.secs.dataitems.DataItemBase(value=None)[source]

Bases: object

Base class for data items.

It provides type and output handling.

classmethod get_format(showname=True)[source]

Format the contents as a string.

Parameters:showname – Display the real class name when True
Returns:Formatted value string
class secsgem.secs.dataitems.ACKC5(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.ACKC5.ACCEPTED
1-63 Error secsgem.secs.dataitems.ACKC5.ERROR
Used In Function
ACCEPTED = 0
ERROR = 1
class secsgem.secs.dataitems.ACKC6(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.ACKC6.ACCEPTED
1-63 Error secsgem.secs.dataitems.ACKC6.ERROR
Used In Function
  • SecsS06F02
  • SecsS06F04
  • SecsS06F10
  • SecsS06F12
  • SecsS06F14
ACCEPTED = 0
ERROR = 1
class secsgem.secs.dataitems.ACKC7(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.ACKC7.ACCEPTED
1 Permission not granted secsgem.secs.dataitems.ACKC7.NO_PERMISSION
2 Length error secsgem.secs.dataitems.ACKC7.LENGTH_ERROR
3 Matrix overflow secsgem.secs.dataitems.ACKC7.MATRIX_OVERFLOW
4 PPID not found secsgem.secs.dataitems.ACKC7.PPID_NOT_FOUND
5 Mode unsupported secsgem.secs.dataitems.ACKC7.MODE_UNSUPPORTED
6 Performed later secsgem.secs.dataitems.ACKC7.PERFORMED_LATER
7-63 Reserved  
Used In Function
  • SecsS07F04
  • SecsS07F12
  • SecsS07F14
  • SecsS07F16
  • SecsS07F18
  • SecsS07F24
  • SecsS07F32
  • SecsS07F38
  • SecsS07F40
  • SecsS07F42
  • SecsS07F44
ACCEPTED = 0
NO_PERMISSION = 1
LENGTH_ERROR = 2
MATRIX_OVERFLOW = 3
PPID_NOT_FOUND = 4
MODE_UNSUPPORTED = 5
PERFORMED_LATER = 6
class secsgem.secs.dataitems.ACKC10(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.ACKC10.ACCEPTED
1 Will not be displayed secsgem.secs.dataitems.ACKC10.NOT_DISPLAYED
2 Terminal not available secsgem.secs.dataitems.ACKC10.TERMINAL_NOT_AVAILABLE
3-63 Other error  
Used In Function
ACCEPTED = 0
NOT_DISPLAYED = 1
TERMINAL_NOT_AVAILABLE = 2
class secsgem.secs.dataitems.ACKA(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBoolean

Request success.

Types:SecsVarBoolean
Length:1
Values
Value  
True Success
False Failed
Used In Function
  • SecsS05F14
  • SecsS05F15
  • SecsS05F18
  • SecsS16F02
  • SecsS16F04
  • SecsS16F06
  • SecsS16F12
  • SecsS16F14
  • SecsS16F16
  • SecsS16F18
  • SecsS16F24
  • SecsS16F26
  • SecsS16F28
  • SecsS16F30
  • SecsS17F04
  • SecsS17F08
  • SecsS17F14
class secsgem.secs.dataitems.ALCD(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Alarm code byte.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Not used  
1 Personal safety secsgem.secs.dataitems.ALCD.PERSONAL_SAFETY
2 Equipment safety secsgem.secs.dataitems.ALCD.EQUIPMENT_SAFETY
3 Parameter control warning secsgem.secs.dataitems.ALCD.PARAMETER_CONTROL_WARNING
4 Parameter control error secsgem.secs.dataitems.ALCD.PARAMETER_CONTROL_ERROR
5 Irrecoverable error secsgem.secs.dataitems.ALCD.IRRECOVERABLE_ERROR
6 Equipment status warning secsgem.secs.dataitems.ALCD.EQUIPMENT_STATUS_WARNING
7 Attention flags secsgem.secs.dataitems.ALCD.ATTENTION_FLAGS
8 Data integrity secsgem.secs.dataitems.ALCD.DATA_INTEGRITY
9-63 Other catogories  
128 Alarm set flag secsgem.secs.dataitems.ALCD.ALARM_SET
Used In Function
PERSONAL_SAFETY = 1
EQUIPMENT_SAFETY = 2
PARAMETER_CONTROL_WARNING = 3
PARAMETER_CONTROL_ERROR = 4
IRRECOVERABLE_ERROR = 5
EQUIPMENT_STATUS_WARNING = 6
ATTENTION_FLAGS = 7
DATA_INTEGRITY = 8
ALARM_SET = 128
class secsgem.secs.dataitems.ALED(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Alarm en-/disable code byte.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Disable secsgem.secs.dataitems.ALED.DISABLE
1-127 Not used  
128 Enable secsgem.secs.dataitems.ALED.ENABLE
129-255 Not used  
Used In Function
DISABLE = 0
ENABLE = 128
class secsgem.secs.dataitems.ALID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Alarm ID.

Types:
Used In Function
class secsgem.secs.dataitems.ALTX(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Alarm ID.

Types:
Used In Function
class secsgem.secs.dataitems.ATTRDATA(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Object attribute value.

Types:
Used In Function
  • SecsS01F20
  • SecsS03F17
  • SecsS03F18
  • SecsS13F14
  • SecsS13F16
  • SecsS14F01
  • SecsS14F02
  • SecsS14F03
  • SecsS14F04
  • SecsS14F09
  • SecsS14F10
  • SecsS14F11
  • SecsS14F12
  • SecsS14F13
  • SecsS14F14
  • SecsS14F15
  • SecsS14F16
  • SecsS14F17
  • SecsS14F18
  • SecsS18F02
  • SecsS18F03
class secsgem.secs.dataitems.ATTRID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Object attribute identifier.

Types:
Used In Function
  • SecsS01F19
  • SecsS03F17
  • SecsS03F18
  • SecsS13F14
  • SecsS13F16
  • SecsS14F01
  • SecsS14F02
  • SecsS14F03
  • SecsS14F04
  • SecsS14F08
  • SecsS14F09
  • SecsS14F10
  • SecsS14F11
  • SecsS14F12
  • SecsS14F13
  • SecsS14F14
  • SecsS14F15
  • SecsS14F16
  • SecsS14F17
  • SecsS14F18
  • SecsS18F01
  • SecsS18F03
class secsgem.secs.dataitems.ATTRRELN(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU1

Attribute relation to attribute of object.

Types:SecsVarU1
Values
Value Description Constant
0 Equal to secsgem.secs.dataitems.ATTRRELN.EQUAL
1 Not equal to secsgem.secs.dataitems.ATTRRELN.NOT_EQUAL
2 Less than secsgem.secs.dataitems.ATTRRELN.LESS
3 Less than or equal to secsgem.secs.dataitems.ATTRRELN.LESS_EQUAL
4 More than secsgem.secs.dataitems.ATTRRELN.MORE
5 More than or equal to secsgem.secs.dataitems.ATTRRELN.MORE_EQUAL
6 Value present secsgem.secs.dataitems.ATTRRELN.PRESENT
7 Value absent secsgem.secs.dataitems.ATTRRELN.ABSENT
8-63 Error  
Used In Function
EQUAL = 0
NOT_EQUAL = 1
LESS = 2
LESS_EQUAL = 3
MORE = 4
MORE_EQUAL = 5
PRESENT = 6
ABSENT = 7
class secsgem.secs.dataitems.BCEQU(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Bin code equivalents.

Types:
Used In Function
class secsgem.secs.dataitems.BINLT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Bin list.

Types:
Used In Function
class secsgem.secs.dataitems.CEED(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBoolean

Collection event or trace enable/disable code.

Types:SecsVarBoolean
Length:1
Values
Value State
True Enable
False Disable
Used In Function
class secsgem.secs.dataitems.CEID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Collection event ID.

Types:
Used In Function
class secsgem.secs.dataitems.COLCT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Column count in dies.

Types:
Used In Function
class secsgem.secs.dataitems.COMMACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Establish communications acknowledge.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.COMMACK.ACCEPTED
1 Denied, Try Again secsgem.secs.dataitems.COMMACK.DENIED
2-63 Reserved  
Used In Function
ACCEPTED = 0
DENIED = 1
class secsgem.secs.dataitems.CPACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Command parameter acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
1 Parameter name unknown secsgem.secs.dataitems.CPACK.PARAMETER_UNKNOWN
2 CPVAL value illegal secsgem.secs.dataitems.CPACK.CPVAL_ILLEGAL_VALUE
3 CPVAL format illegal secsgem.secs.dataitems.CPACK.CPVAL_ILLEGAL_FORMAT
4-63 Reserved  
Used In Function
PARAMETER_UNKNOWN = 1
CPVAL_ILLEGAL_VALUE = 2
CPVAL_ILLEGAL_FORMAT = 3
class secsgem.secs.dataitems.CPNAME(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Command parameter name.

Types:
Used In Function
class secsgem.secs.dataitems.CPVAL(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Command parameter name.

Types:
Used In Function
  • SecsS02F41
  • SecsS02F49
  • SecsS04F21
  • SecsS04F29
  • SecsS16F05
  • SecsS16F27
  • SecsS18F13
class secsgem.secs.dataitems.DATAID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Data ID.

Types:
Used In Function
  • SecsS02F33
  • SecsS02F35
  • SecsS02F39
  • SecsS02F45
  • SecsS02F49
  • SecsS03F15
  • SecsS03F17
  • SecsS04F19
  • SecsS04F25
  • SecsS06F03
  • SecsS06F05
  • SecsS06F07
  • SecsS06F08
  • SecsS06F09
  • SecsS06F11
  • SecsS06F13
  • SecsS06F16
  • SecsS06F18
  • SecsS06F27
  • SecsS13F11
  • SecsS13F13
  • SecsS13F15
  • SecsS14F19
  • SecsS14F21
  • SecsS14F23
  • SecsS15F27
  • SecsS15F29
  • SecsS15F33
  • SecsS15F35
  • SecsS15F37
  • SecsS15F39
  • SecsS15F41
  • SecsS15F43
  • SecsS15F45
  • SecsS15F47
  • SecsS15F49
  • SecsS16F01
  • SecsS16F03
  • SecsS16F05
  • SecsS16F11
  • SecsS16F13
  • SecsS17F01
  • SecsS17F05
  • SecsS17F09
class secsgem.secs.dataitems.DATALENGTH(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Length of data to be sent.

Types:
Used In Function
  • SecsS02F39
  • SecsS03F15
  • SecsS03F29
  • SecsS03F31
  • SecsS04F25
  • SecsS06F05
  • SecsS13F11
  • SecsS14F23
  • SecsS16F01
  • SecsS16F11
  • SecsS18F05
  • SecsS18F07
  • SecsS19F19
class secsgem.secs.dataitems.DATLC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU1

Data location.

Types:SecsVarU1
Used In Function
class secsgem.secs.dataitems.DRACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Define report acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Acknowledge secsgem.secs.dataitems.DRACK.ACK
1 Denied, insufficient space secsgem.secs.dataitems.DRACK.INSUFFICIENT_SPACE
2 Denied, invalid format secsgem.secs.dataitems.DRACK.INVALID_FORMAT
3 Denied, RPTID already defined secsgem.secs.dataitems.DRACK.RPTID_REDEFINED
4 Denied, VID doesn’t exist secsgem.secs.dataitems.DRACK.VID_UNKNOWN
5-63 Reserved, other errors  
Used In Function
ACK = 0
INSUFFICIENT_SPACE = 1
INVALID_FORMAT = 2
RPTID_REDEFINED = 3
VID_UNKNOWN = 4
class secsgem.secs.dataitems.DSID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Data set ID.

Types:
Used In Function
class secsgem.secs.dataitems.DUTMS(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Die units of measure.

Types:
Used In Function
class secsgem.secs.dataitems.DVNAME(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Data value name.

Types:
Used In Function
class secsgem.secs.dataitems.DVVAL(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Data value.

Types:
Used In Function
class secsgem.secs.dataitems.EAC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Equipment acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Acknowledge secsgem.secs.dataitems.EAC.ACK
1 Denied, not all constants exist secsgem.secs.dataitems.EAC.INVALID_CONSTANT
2 Denied, busy secsgem.secs.dataitems.EAC.BUSY
3 Denied, constant out of range secsgem.secs.dataitems.EAC.OUT_OF_RANGE
4-63 Reserved, equipment specific  
Used In Function
ACK = 0
INVALID_CONSTANT = 1
BUSY = 2
OUT_OF_RANGE = 3
class secsgem.secs.dataitems.ECDEF(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Equipment constant default value.

Types:
Used In Function
class secsgem.secs.dataitems.ECID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Equipment constant ID.

Types:
Used In Function
class secsgem.secs.dataitems.ECMAX(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Equipment constant maximum value.

Types:
Used In Function
class secsgem.secs.dataitems.ECMIN(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Equipment constant minimum value.

Types:
Used In Function
class secsgem.secs.dataitems.ECNAME(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Equipment constant name.

Types:
Used In Function
class secsgem.secs.dataitems.ECV(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Equipment constant value.

Types:
Used In Function
class secsgem.secs.dataitems.EDID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Expected data identification.

Types:
Used In Function
class secsgem.secs.dataitems.ERACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Enable/disable event report acknowledge.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Accepted secsgem.secs.dataitems.ERACK.ACCEPTED
1 Denied, CEID doesn’t exist secsgem.secs.dataitems.ERACK.CEID_UNKNOWN
2-63 Reserved  
Used In Function
ACCEPTED = 0
CEID_UNKNOWN = 1
class secsgem.secs.dataitems.ERRCODE(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Reference point.

Types:
Used In Function
  • SecsS01F03
  • SecsS01F20
  • SecsS03F16
  • SecsS03F30
  • SecsS03F32
  • SecsS04F20
  • SecsS04F22
  • SecsS04F23
  • SecsS04F33
  • SecsS04F35
  • SecsS05F14
  • SecsS05F15
  • SecsS05F18
  • SecsS13F14
  • SecsS13F16
  • SecsS14F02
  • SecsS14F04
  • SecsS14F06
  • SecsS14F08
  • SecsS14F10
  • SecsS14F12
  • SecsS14F14
  • SecsS14F16
  • SecsS14F18
  • SecsS14F26
  • SecsS14F28
  • SecsS15F18
  • SecsS15F20
  • SecsS15F22
  • SecsS15F24
  • SecsS15F26
  • SecsS15F28
  • SecsS15F30
  • SecsS15F32
  • SecsS15F34
  • SecsS15F36
  • SecsS15F38
  • SecsS15F40
  • SecsS15F42
  • SecsS15F44
  • SecsS15F48
  • SecsS15F53
  • SecsS16F12
  • SecsS16F14
  • SecsS16F16
  • SecsS16F18
  • SecsS16F24
  • SecsS16F26
  • SecsS16F28
  • SecsS17F02
  • SecsS17F04
  • SecsS17F06
  • SecsS17F08
  • SecsS17F10
  • SecsS17F12
  • SecsS17F14
class secsgem.secs.dataitems.ERRTEXT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Error description for error code.

Types:
Used In Function
  • SecsS01F20
  • SecsS03F16
  • SecsS03F18
  • SecsS03F20
  • SecsS03F22
  • SecsS03F24
  • SecsS03F26
  • SecsS03F30
  • SecsS03F32
  • SecsS04F20
  • SecsS04F22
  • SecsS04F23
  • SecsS04F33
  • SecsS04F35
  • SecsS05F14
  • SecsS05F15
  • SecsS05F18
  • SecsS13F14
  • SecsS13F16
  • SecsS14F02
  • SecsS14F04
  • SecsS14F06
  • SecsS14F08
  • SecsS14F10
  • SecsS14F12
  • SecsS14F14
  • SecsS14F16
  • SecsS14F18
  • SecsS14F26
  • SecsS14F28
  • SecsS15F28
  • SecsS15F30
  • SecsS15F32
  • SecsS15F34
  • SecsS15F36
  • SecsS15F38
  • SecsS15F40
  • SecsS15F42
  • SecsS15F44
  • SecsS15F48
  • SecsS15F53
  • SecsS16F12
  • SecsS16F14
  • SecsS16F16
  • SecsS16F18
  • SecsS16F24
  • SecsS16F26
  • SecsS16F28
  • SecsS17F04
  • SecsS17F08
  • SecsS17F14
class secsgem.secs.dataitems.EXID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Exception identifier.

Types:
Used In Function
class secsgem.secs.dataitems.EXMESSAGE(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Exception message.

Types:
Used In Function
class secsgem.secs.dataitems.EXRECVRA(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Exception recovery action.

Types:
Used In Function
class secsgem.secs.dataitems.EXTYPE(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Exception type.

Types:
Used In Function
class secsgem.secs.dataitems.FFROT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU2

Film frame rotation.

In degrees from the bottom CW. (Bottom equals zero degrees.) Zero length indicates not used.

Types:SecsVarU2
Used In Function
class secsgem.secs.dataitems.FNLOC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU2

Flat/notch location.

In degrees from the bottom CW. (Bottom equals zero degrees.) Zero length indicates not used.

Types:SecsVarU2
Used In Function
class secsgem.secs.dataitems.GRANT6(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Permission to send.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Granted secsgem.secs.dataitems.GRANT6.GRANTED
1 Busy secsgem.secs.dataitems.GRANT6.BUSY
2 Not interested secsgem.secs.dataitems.GRANT6.NOT_INTERESTED
3-63 Other error  
Used In Function
GRANTED = 0
BUSY = 1
NOT_INTERESTED = 2
class secsgem.secs.dataitems.GRNT1(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Grant code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Acknowledge secsgem.secs.dataitems.GRNT1.ACK
1 Busy, try again secsgem.secs.dataitems.GRNT1.BUSY
2 No space secsgem.secs.dataitems.GRNT1.NO_SPACE
3 Map too large secsgem.secs.dataitems.GRNT1.MAP_TOO_LARGE
4 Duplicate ID secsgem.secs.dataitems.GRNT1.DUPLICATE_ID
5 Material ID not found secsgem.secs.dataitems.GRNT1.MATERIALID_UNKNOWN
6 Unknown map format secsgem.secs.dataitems.GRNT1.UNKNOWN_MAP_FORMAT
7-63 Reserved, error  
Used In Function
ACK = 0
BUSY = 1
NO_SPACE = 2
MAP_TOO_LARGE = 3
DUPLICATE_ID = 4
MATERIALID_UNKNOWN = 5
UNKNOWN_MAP_FORMAT = 6
class secsgem.secs.dataitems.HCACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Host command parameter acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Acknowledge secsgem.secs.dataitems.HCACK.ACK
1 Denied, invalid command secsgem.secs.dataitems.HCACK.INVALID_COMMAND
2 Denied, cannot perform now secsgem.secs.dataitems.HCACK.CANT_PERFORM_NOW
3 Denied, parameter invalid secsgem.secs.dataitems.HCACK.PARAMETER_INVALID
4 Acknowledge, will finish later secsgem.secs.dataitems.HCACK.ACK_FINISH_LATER
5 Rejected, already in condition secsgem.secs.dataitems.HCACK.ALREADY_IN_CONDITION
6 No such object secsgem.secs.dataitems.HCACK.NO_OBJECT
7-63 Reserved  
Used In Function
ACK = 0
INVALID_COMMAND = 1
CANT_PERFORM_NOW = 2
PARAMETER_INVALID = 3
ACK_FINISH_LATER = 4
ALREADY_IN_CONDITION = 5
NO_OBJECT = 6
class secsgem.secs.dataitems.IDTYP(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

ID type.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Wafer ID secsgem.secs.dataitems.IDTYP.WAFER
1 Wafer cassette ID secsgem.secs.dataitems.IDTYP.WAFER_CASSETTE
2 Film frame ID secsgem.secs.dataitems.IDTYP.FILM_FRAME
3-63 Reserved, error  
Used In Function
WAFER = 0
WAFER_CASSETTE = 1
FILM_FRAME = 2
class secsgem.secs.dataitems.LENGTH(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Service/process program length.

Types:
Used In Function
class secsgem.secs.dataitems.LRACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Link report acknowledge code.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Acknowledge secsgem.secs.dataitems.LRACK.ACK
1 Denied, insufficient space secsgem.secs.dataitems.LRACK.INSUFFICIENT_SPACE
2 Denied, invalid format secsgem.secs.dataitems.LRACK.INVALID_FORMAT
3 Denied, CEID already linked secsgem.secs.dataitems.LRACK.CEID_LINKED
4 Denied, CEID doesn’t exist secsgem.secs.dataitems.LRACK.CEID_UNKNOWN
5 Denied, RPTID doesn’t exist secsgem.secs.dataitems.LRACK.RPTID_UNKNOWN
6-63 Reserved, other errors  
Used In Function
ACK = 0
INSUFFICIENT_SPACE = 1
INVALID_FORMAT = 2
CEID_LINKED = 3
CEID_UNKNOWN = 4
RPTID_UNKNOWN = 5
class secsgem.secs.dataitems.MAPER(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Map error.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 ID not found secsgem.secs.dataitems.MAPER.ID_UNKNOWN
1 Invalid data secsgem.secs.dataitems.MAPER.INVALID_DATA
2 Format error secsgem.secs.dataitems.MAPER.FORMAT_ERROR
3-63 Invalid error  
Used In Function
ID_UNKNOWN = 0
INVALID_DATA = 1
FORMAT_ERROR = 2
class secsgem.secs.dataitems.MAPFT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Map data format.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Row format secsgem.secs.dataitems.MAPFT.ROW
1 Array format secsgem.secs.dataitems.MAPFT.ARRAY
2 Coordinate format secsgem.secs.dataitems.MAPFT.COORDINATE
3-63 Error  
Used In Function
ROW = 0
ARRAY = 1
COORDINATE = 2
class secsgem.secs.dataitems.MDACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Map data acknowledge.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Map received secsgem.secs.dataitems.MDACK.ACK
1 Format error secsgem.secs.dataitems.MDACK.FORMAT_ERROR
2 No ID match secsgem.secs.dataitems.MDACK.UNKNOWN_ID
3 Abort/discard map secsgem.secs.dataitems.MDACK.ABORT_MAP
4-63 Reserved, error  
Used In Function
ACK = 0
FORMAT_ERROR = 1
UNKNOWN_ID = 2
ABORT_MAP = 3
class secsgem.secs.dataitems.MDLN(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Equipment model type.

Types:
Used In Function
class secsgem.secs.dataitems.MEXP(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Message expected.

Types:
Used In Function
class secsgem.secs.dataitems.MHEAD(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

SECS message header.

Types:SecsVarBinary
Length:10
Used In Function
class secsgem.secs.dataitems.MID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Material ID.

Types:
Used In Function
class secsgem.secs.dataitems.MLCL(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Message length.

Types:
Used In Function
class secsgem.secs.dataitems.NULBC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Column count in dies.

Types:
Used In Function
class secsgem.secs.dataitems.OBJACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU1

Object acknowledgement code.

Types:SecsVarU1
Length:1
Values
Value Description Constant
0 Successful secsgem.secs.dataitems.OBJACK.SUCCESSFUL
1 Error secsgem.secs.dataitems.OBJACK.ERROR
2-63 Reserved  
Used In Function
  • SecsS14F02
  • SecsS14F04
  • SecsS14F06
  • SecsS14F08
  • SecsS14F10
  • SecsS14F12
  • SecsS14F14
  • SecsS14F16
  • SecsS14F18
  • SecsS14F26
  • SecsS14F28
SUCCESSFUL = 0
ERROR = 1
class secsgem.secs.dataitems.OBJID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Object identifier.

Types:
Used In Function
class secsgem.secs.dataitems.OBJSPEC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Specific object instance.

Types:
Used In Function
  • SecsS02F49
  • SecsS13F11
  • SecsS13F13
  • SecsS13F15
  • SecsS14F01
  • SecsS14F03
  • SecsS14F05
  • SecsS14F07
  • SecsS14F09
  • SecsS14F10
  • SecsS14F11
  • SecsS14F13
  • SecsS14F15
  • SecsS14F16
  • SecsS14F17
  • SecsS14F19
  • SecsS14F25
  • SecsS14F27
  • SecsS15F43
  • SecsS15F47
class secsgem.secs.dataitems.OBJTYPE(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Class of object identifier.

Types:
Used In Function
  • SecsS01F19
  • SecsS14F01
  • SecsS14F03
  • SecsS14F06
  • SecsS14F07
  • SecsS14F08
  • SecsS14F25
  • SecsS14F26
  • SecsS14F27
class secsgem.secs.dataitems.OFLACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code for OFFLINE request.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 OFFLINE Acknowledge secsgem.secs.dataitems.OFLACK.ACK
1-63 Reserved  
Used In Function
ACK = 0
class secsgem.secs.dataitems.ONLACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Acknowledge code for ONLINE request.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 ONLINE Accepted secsgem.secs.dataitems.ONLACK.ACCEPTED
1 ONLINE Not allowed secsgem.secs.dataitems.ONLACK.NOT_ALLOWED
2 Already ONLINE secsgem.secs.dataitems.ONLACK.ALREADY_ON
3-63 Reserved  
Used In Function
ACCEPTED = 0
NOT_ALLOWED = 1
ALREADY_ON = 2
class secsgem.secs.dataitems.ORLOC(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Origin location.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Center die of wafer secsgem.secs.dataitems.ORLOC.CENTER_DIE
1 Upper right secsgem.secs.dataitems.ORLOC.UPPER_RIGHT
2 Upper left secsgem.secs.dataitems.ORLOC.UPPER_LEFT
3 Lower left secsgem.secs.dataitems.ORLOC.LOWER_LEFT
4 Lower right secsgem.secs.dataitems.ORLOC.LOWER_RIGHT
5-63 Reserved, error  
Used In Function
CENTER_DIE = 0
UPPER_RIGHT = 1
UPPER_LEFT = 2
LOWER_LEFT = 3
LOWER_RIGHT = 3
class secsgem.secs.dataitems.PPBODY(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Status variable ID.

Types:
Used In Function
class secsgem.secs.dataitems.PPGNT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Process program grant status.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 OK secsgem.secs.dataitems.PPGNT.OK
1 Already have secsgem.secs.dataitems.PPGNT.ALREADY_HAVE
2 No space secsgem.secs.dataitems.PPGNT.NO_SPACE
3 Invalid PPID secsgem.secs.dataitems.PPGNT.INVALID_PPID
4 Busy, try later secsgem.secs.dataitems.PPGNT.BUSY
5 Will not accept secsgem.secs.dataitems.PPGNT.WILL_NOT_ACCEPT
6-63 Reserved, other errors  
Used In Function
OK = 0
ALREADY_HAVE = 1
NO_SPACE = 2
INVALID_PPID = 3
BUSY = 4
WILL_NOT_ACCEPT = 5
class secsgem.secs.dataitems.PPID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Process program ID.

Types:
Used In Function
class secsgem.secs.dataitems.PRAXI(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Process axis.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Rows, top, increasing secsgem.secs.dataitems.PRAXI.ROWS_TOP_INCR
1 Rows, top, decreasing secsgem.secs.dataitems.PRAXI.ROWS_TOP_DECR
2 Rows, bottom, increasing secsgem.secs.dataitems.PRAXI.ROWS_BOT_INCR
3 Rows, bottom, decreasing secsgem.secs.dataitems.PRAXI.ROWS_BOT_DECR
4 Columns, left, increasing secsgem.secs.dataitems.PRAXI.COLS_LEFT_INCR
5 Columns, left, decreasing secsgem.secs.dataitems.PRAXI.COLS_LEFT_DECR
6 Columns, right, increasing secsgem.secs.dataitems.PRAXI.COLS_RIGHT_INCR
7 Columns, right, decreasing secsgem.secs.dataitems.PRAXI.COLS_RIGHT_DECR
8-63 Error  
Used In Function
ROWS_TOP_INCR = 0
ROWS_TOP_DECR = 1
ROWS_BOT_INCR = 2
ROWS_BOT_DECR = 3
COLS_LEFT_INCR = 4
COLS_LEFT_DECR = 5
COLS_RIGHT_INCR = 6
COLS_RIGHT_DECR = 7
class secsgem.secs.dataitems.PRDCT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Process die count.

Types:
Used In Function
class secsgem.secs.dataitems.RCMD(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Remote command.

Types:
Used In Function
class secsgem.secs.dataitems.REFP(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Reference point.

Types:
Used In Function
class secsgem.secs.dataitems.ROWCT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Row count in dies.

Types:
Used In Function
class secsgem.secs.dataitems.RPSEL(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarU1

Reference point select.

Types:SecsVarU1
Used In Function
class secsgem.secs.dataitems.RPTID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Report ID.

Types:
Used In Function
class secsgem.secs.dataitems.RSINF(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Starting location.

Types:
Used In Function
class secsgem.secs.dataitems.SDACK(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Map setup acknowledge.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Received Data secsgem.secs.dataitems.SDACK.ACK
1-63 Error  
Used In Function
ACK = 0
class secsgem.secs.dataitems.SDBIN(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Send bin information.

Types:SecsVarBinary
Length:1
Values
Value Description Constant
0 Send bin information secsgem.secs.dataitems.SDBIN.SEND
1 Don’t send bin infomation secsgem.secs.dataitems.SDBIN.DONT_SEND
2-63 Reserved  
Used In Function
SEND = 0
DONT_SEND = 1
class secsgem.secs.dataitems.SHEAD(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

SECS message header.

Types:SecsVarBinary
Length:10
Used In Function
class secsgem.secs.dataitems.SOFTREV(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Software revision.

Types:
Used In Function
class secsgem.secs.dataitems.STRP(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Starting position.

Types:
Used In Function
class secsgem.secs.dataitems.SV(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Status variable value.

Types:
Used In Function
class secsgem.secs.dataitems.SVID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Status variable ID.

Types:
Used In Function
class secsgem.secs.dataitems.SVNAME(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Status variable name.

Types:
Used In Function
class secsgem.secs.dataitems.TEXT(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Line of characters.

Types:
Used In Function
class secsgem.secs.dataitems.TID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarBinary

Terminal ID.

Types:SecsVarBinary
Length:1
Used In Function
class secsgem.secs.dataitems.TIME(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Time of day.

Types:
Used In Function
class secsgem.secs.dataitems.TIMESTAMP(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Timestamp.

Types:
Used In Function
class secsgem.secs.dataitems.UNITS(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarString

Units identifier.

Types:
Used In Function
class secsgem.secs.dataitems.V(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Variable data.

Types:
Used In Function
class secsgem.secs.dataitems.VID(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Variable ID.

Types:
Used In Function
  • SecsS02F33
  • SecsS02F45
  • SecsS02F46
  • SecsS02F47
  • SecsS02F48
  • SecsS06F13
  • SecsS06F18
  • SecsS06F22
  • SecsS17F01
class secsgem.secs.dataitems.XDIES(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Die size/index X-axis.

Types:
Used In Function
class secsgem.secs.dataitems.XYPOS(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

X/Y coordinate position.

Types:
Used In Function
class secsgem.secs.dataitems.YDIES(value=None)[source]

Bases: secsgem.secs.dataitems.DataItemBase, secsgem.secs.variables.SecsVarDynamic

Die size/index Y-axis.

Types:
Used In Function
FunctionBase

Base class for for SECS stream and functions.

class secsgem.secs.functionbase.StructureDisplayingMeta[source]

Bases: type

Meta class overriding the default __repr__ of a class.

mro()

Return a type’s method resolution order.

class secsgem.secs.functionbase.SecsStreamFunction(value=None)[source]

Bases: object

Secs stream and function base class.

This class is inherited to create a stream/function class. To create a function specific content the class variables _stream, _function and _dataFormat must be overridden.

append(data)[source]

Append data to list, if stream/function parameter is a list.

Parameters:data (various) – list item to add
encode()[source]

Generates the encoded hsms data of the stream/function parameter.

Returns:encoded data
Return type:string
decode(data)[source]

Updates stream/function parameter data from the passed data.

Parameters:data (string) – encoded data
set(value)[source]

Updates the value of the stream/function parameter.

Parameters:value (various) – new value for the parameter
get()[source]

Gets the current value of the stream/function parameter.

Returns:current parameter value
Return type:various
classmethod get_format()[source]

Gets the format of the function.

Returns:returns the string representation of the function
Return type:string
Functions

Wrappers for SECS stream and functions.

class secsgem.secs.functions.SecsS00F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

Hsms communication.

Structure:

>>> import secsgem
>>> secsgem.SecsS00F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS00F00()
S0F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS01F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 1.

Structure:

>>> import secsgem
>>> secsgem.SecsS01F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS01F00()
S1F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS01F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

are you online - request.

Structure:

>>> import secsgem
>>> secsgem.SecsS01F01
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS01F01()
S1F1 W .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS01F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

on line data.

Caution

This Stream/function has different structures depending on the source. If it is sent from the eqipment side it has the structure below, if it is sent from the host it is an empty list. Be sure to fill the array accordingly.

Structure E->H:

{
    MDLN: A[20]
    SOFTREV: A[20]
}

Example:

>>> import secsgem
>>> secsgem.SecsS01F02(['secsgem', '0.0.6']) # E->H
S1F2
  <L [2]
    <A "secsgem">
    <A "0.0.6">
  > .
>>> secsgem.SecsS01F02() #H->E
S1F2
  <L> .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

Selected equipment status - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F03
[
    SVID: U1/U2/U4/U8/I1/I2/I4/I8/A
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS01F03([1, "1337", 12])
S1F3 W
  <L [3]
    <U1 1 >
    <A "1337">
    <U1 12 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

selected equipment status - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F04
[
    SV: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS01F04([secsgem.SecsVarU1(1), "text", secsgem.SecsVarU4(1337)])
S1F4
  <L [3]
    <U1 1 >
    <A "text">
    <U4 1337 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F11(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

status variable namelist - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F11
[
    SVID: U1/U2/U4/U8/I1/I2/I4/I8/A
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS01F11([1, 1337])
S1F11 W
  <L [2]
    <U1 1 >
    <U2 1337 >
  > .

An empty list will return all available status variables.

Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F12(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

status variable namelist - reply.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F12
[
    {
        SVID: U1/U2/U4/U8/I1/I2/I4/I8/A
        SVNAME: A
        UNITS: A
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS01F12([{"SVID": 1, "SVNAME": "SV1", "UNITS": "mm"},
...     {"SVID": 1337, "SVNAME": "SV2", "UNITS": ""}])
S1F12
  <L [2]
    <L [3]
      <U1 1 >
      <A "SV1">
      <A "mm">
    >
    <L [3]
      <U2 1337 >
      <A "SV2">
      <A>
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F13(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

establish communication - request.

Caution

This Stream/function has different structures depending on the source. If it is sent from the eqipment side it has the structure below, if it is sent from the host it is an empty list. Be sure to fill the array accordingly.

Structure E->H:

{
    MDLN: A[20]
    SOFTREV: A[20]
}

Example:

>>> import secsgem
>>> secsgem.SecsS01F13(['secsgem', '0.0.6']) # E->H
S1F13 W
  <L [2]
    <A "secsgem">
    <A "0.0.6">
  > .
>>> secsgem.SecsS01F13() #H->E
S1F13 W
  <L> .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F14(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

establish communication - acknowledge.

Caution

This Stream/function has different structures depending on the source. See structure definition below for details. Be sure to fill the array accordingly.

Data Items

Structure E->H:

{
    COMMACK: B[1]
    DATA: {
        MDLN: A[20]
        SOFTREV: A[20]
    }
}

Structure H->E:

{
    COMMACK: B[1]
    DATA: []
}

Example:

>>> import secsgem
>>> secsgem.SecsS01F14({"COMMACK": secsgem.COMMACK.ACCEPTED, "MDLN": ["secsgem", "0.0.6"]})
S1F14
  <L [2]
    <B 0x0>
    <L [2]
      <A "secsgem">
      <A "0.0.6">
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F15(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

request offline.

Structure:

>>> import secsgem
>>> secsgem.SecsS01F15
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS01F15()
S1F15 W .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS01F16(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

offline acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F16
OFLACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS01F16(secsgem.OFLACK.ACK)
S1F16
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS01F17(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

request online.

Structure:

>>> import secsgem
>>> secsgem.SecsS01F17
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS01F17()
S1F17 W .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS01F18(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

online acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS01F18
ONLACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS01F18(secsgem.ONLACK.ALREADY_ON)
S1F18
  <B 0x2> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 2.

Structure:

>>> import secsgem
>>> secsgem.SecsS02F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS02F00()
S2F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS02F13(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

equipment constant - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F13
[
    ECID: U1/U2/U4/U8/I1/I2/I4/I8/A
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS02F13([1, 1337])
S2F13 W
  <L [2]
    <U1 1 >
    <U2 1337 >
  > .

An empty list will return all available equipment constants.

Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F14(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

equipment constant - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F14
[
    ECV: L/BOOLEAN/I8/I1/I2/I4/F8/F4/U8/U1/U2/U4/A/B
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS02F14([secsgem.SecsVarU1(1), "text"])
S2F14
  <L [2]
    <U1 1 >
    <A "text">
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F15(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

new equipment constant - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F15
[
    {
        ECID: U1/U2/U4/U8/I1/I2/I4/I8/A
        ECV: L/BOOLEAN/I8/I1/I2/I4/F8/F4/U8/U1/U2/U4/A/B
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS02F15([{"ECID": 1, "ECV": secsgem.SecsVarU4(10)}, {"ECID": "1337", "ECV": "text"}])
S2F15 W
  <L [2]
    <L [2]
      <U1 1 >
      <U4 10 >
    >
    <L [2]
      <A "1337">
      <A "text">
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F16(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

new equipment constant - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F16
EAC: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS02F16(secsgem.EAC.BUSY)
S2F16
  <B 0x2> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F17(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

date and time - request.

Structure:

>>> import secsgem
>>> secsgem.SecsS02F17
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS02F17()
S2F17 W .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS02F18(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

date and time - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F18
TIME: A[32]

Example:

>>> import secsgem
>>> secsgem.SecsS02F18("160816205942")
S2F18
  <A "160816205942"> .
Parameters:value (ASCII string) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F29(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

equipment constant namelist - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F29
[
    ECID: U1/U2/U4/U8/I1/I2/I4/I8/A
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS02F29([1, 1337])
S2F29 W
  <L [2]
    <U1 1 >
    <U2 1337 >
  > .

An empty list will return all available equipment constants.

Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F30(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

equipment constant namelist.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F30
[
    {
        ECID: U1/U2/U4/U8/I1/I2/I4/I8/A
        ECNAME: A
        ECMIN: BOOLEAN/I8/I1/I2/I4/F8/F4/U8/U1/U2/U4/A/B
        ECMAX: BOOLEAN/I8/I1/I2/I4/F8/F4/U8/U1/U2/U4/A/B
        ECDEF: BOOLEAN/I8/I1/I2/I4/F8/F4/U8/U1/U2/U4/A/B
        UNITS: A
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS02F30([             {"ECID": 1, "ECNAME": "EC1", "ECMIN": secsgem.SecsVarU1(0), "ECMAX": secsgem.SecsVarU1(100),                 "ECDEF": secsgem.SecsVarU1(50), "UNITS": "mm"},             {"ECID": 1337, "ECNAME": "EC2", "ECMIN": "", "ECMAX": "", "ECDEF": "", "UNITS": ""}])
S2F30
  <L [2]
    <L [6]
      <U1 1 >
      <A "EC1">
      <U1 0 >
      <U1 100 >
      <U1 50 >
      <A "mm">
    >
    <L [6]
      <U2 1337 >
      <A "EC2">
      <A>
      <A>
      <A>
      <A>
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F33(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

define report.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F33
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    DATA: [
        {
            RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A
            VID: [
                DATA: U1/U2/U4/U8/I1/I2/I4/I8/A
                ...
            ]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS02F33({"DATAID": 1, "DATA": [{"RPTID": 1000, "VID": [12, 1337]}, {"RPTID": 1001, "VID": [1, 2355]}]})
S2F33 W
  <L [2]
    <U1 1 >
    <L [2]
      <L [2]
        <U2 1000 >
        <L [2]
          <U1 12 >
          <U2 1337 >
        >
      >
      <L [2]
        <U2 1001 >
        <L [2]
          <U1 1 >
          <U2 2355 >
        >
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F34(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

define report - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F34
DRACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS02F34(secsgem.DRACK.INVALID_FORMAT)
S2F34
  <B 0x2> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F35(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

link event report.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F35
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    DATA: [
        {
            CEID: U1/U2/U4/U8/I1/I2/I4/I8/A
            RPTID: [
                DATA: U1/U2/U4/U8/I1/I2/I4/I8/A
                ...
            ]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS02F35({"DATAID": 1, "DATA": [{"CEID": 1337, "RPTID": [1000, 1001]}]})
S2F35 W
  <L [2]
    <U1 1 >
    <L [1]
      <L [2]
        <U2 1337 >
        <L [2]
          <U2 1000 >
          <U2 1001 >
        >
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F36(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

link event report - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F36
LRACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS02F36(secsgem.LRACK.CEID_UNKNOWN)
S2F36
  <B 0x4> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F37(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

en-/disable event report.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F37
{
    CEED: BOOLEAN[1]
    CEID: [
        DATA: U1/U2/U4/U8/I1/I2/I4/I8/A
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS02F37({"CEED": True, "CEID": [1337]})
S2F37 W
  <L [2]
    <BOOLEAN True >
    <L [1]
      <U2 1337 >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F38(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

en-/disable event report - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F38
ERACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS02F38(secsgem.ERACK.CEID_UNKNOWN)
S2F38
  <B 0x1> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F41(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

host command - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F41
{
    RCMD: U1/I1/A
    PARAMS: [
        {
            CPNAME: U1/U2/U4/U8/I1/I2/I4/I8/A
            CPVAL: BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/A/B
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS02F41({"RCMD": "COMMAND", "PARAMS": [{"CPNAME": "PARAM1", "CPVAL": "VAL1"}, {"CPNAME": "PARAM2", "CPVAL": "VAL2"}]})
S2F41 W
  <L [2]
    <A "COMMAND">
    <L [2]
      <L [2]
        <A "PARAM1">
        <A "VAL1">
      >
      <L [2]
        <A "PARAM2">
        <A "VAL2">
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS02F42(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

host command - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS02F42
{
    HCACK: B[1]
    PARAMS: [
        {
            CPNAME: U1/U2/U4/U8/I1/I2/I4/I8/A
            CPACK: B[1]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS02F42({             "HCACK": secsgem.HCACK.INVALID_COMMAND,             "PARAMS": [                 {"CPNAME": "PARAM1", "CPACK": secsgem.CPACK.CPVAL_ILLEGAL_VALUE},                 {"CPNAME": "PARAM2", "CPACK": secsgem.CPACK.CPVAL_ILLEGAL_FORMAT}]})
S2F42
  <L [2]
    <B 0x1>
    <L [2]
      <L [2]
        <A "PARAM1">
        <B 0x2>
      >
      <L [2]
        <A "PARAM2">
        <B 0x3>
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 5.

Structure:

>>> import secsgem
>>> secsgem.SecsS05F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS05F00()
S5F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS05F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

alarm report - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F01
{
    ALCD: B[1]
    ALID: U1/U2/U4/U8/I1/I2/I4/I8
    ALTX: A[120]
}

Example:

>>> import secsgem
>>> secsgem.SecsS05F01({"ALCD": secsgem.ALCD.PERSONAL_SAFETY | secsgem.ALCD.ALARM_SET, "ALID": 100, "ALTX": "text"})
S5F1
  <L [3]
    <B 0x81>
    <U1 100 >
    <A "text">
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

alarm report - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F02
ACKC5: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS05F02(secsgem.ACKC5.ACCEPTED)
S5F2
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

en-/disable alarm - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F03
{
    ALED: B[1]
    ALID: U1/U2/U4/U8/I1/I2/I4/I8
}

Example:

>>> import secsgem
>>> secsgem.SecsS05F03({"ALED": secsgem.ALED.ENABLE, "ALID": 100})
S5F3
  <L [2]
    <B 0x80>
    <U1 100 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

en-/disable alarm - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F04
ACKC5: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS05F04(secsgem.ACKC5.ACCEPTED)
S5F4
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F05(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

list alarms - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F05
[
    ALID: U1/U2/U4/U8/I1/I2/I4/I8
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS05F05([100, 200])
S5F5 W
  <L [2]
    <U1 100 >
    <U1 200 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F06(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

list alarms - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F06
[
    {
        ALCD: B[1]
        ALID: U1/U2/U4/U8/I1/I2/I4/I8
        ALTX: A[120]
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS05F06([{"ALCD": secsgem.ALCD.PERSONAL_SAFETY | secsgem.ALCD.ALARM_SET, "ALID": 100, "ALTX": "text"}])
S5F6
  <L [1]
    <L [3]
      <B 0x81>
      <U1 100 >
      <A "text">
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F07(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

list enabled alarms - request.

Structure:

>>> import secsgem
>>> secsgem.SecsS05F07
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS05F07()
S5F7 W .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F08(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

list enabled alarms - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F08
[
    {
        ALCD: B[1]
        ALID: U1/U2/U4/U8/I1/I2/I4/I8
        ALTX: A[120]
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS05F08([{"ALCD": secsgem.ALCD.PERSONAL_SAFETY | secsgem.ALCD.ALARM_SET, "ALID": 100, "ALTX": "text"}])
S5F8
  <L [1]
    <L [3]
      <B 0x81>
      <U1 100 >
      <A "text">
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F09(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception post - notify.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F09
{
    TIMESTAMP: A[32]
    EXID: A[20]
    EXTYPE: A
    EXMESSAGE: A
    EXRECVRA: [
        DATA: A[40]
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS05F09({             "TIMESTAMP": "161006221500",             "EXID": "EX123",             "EXTYPE": "ALARM",             "EXMESSAGE": "Exception",             "EXRECVRA": ["EXRECVRA1", "EXRECVRA2"] })
S5F9
  <L [5]
    <A "161006221500">
    <A "EX123">
    <A "ALARM">
    <A "Exception">
    <L [2]
      <A "EXRECVRA1">
      <A "EXRECVRA2">
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F10(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception post - confirm.

Structure:

>>> import secsgem
>>> secsgem.SecsS05F10
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS05F10()
S5F10 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS05F11(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception clear - notify.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F11
{
    TIMESTAMP: A[32]
    EXID: A[20]
    EXTYPE: A
    EXMESSAGE: A
}

Example:

>>> import secsgem
>>> secsgem.SecsS05F11({"TIMESTAMP": "161006221500", "EXID": "EX123", "EXTYPE": "ALARM", "EXMESSAGE": "Exception"})
S5F11
  <L [4]
    <A "161006221500">
    <A "EX123">
    <A "ALARM">
    <A "Exception">
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F12(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception clear - confirm.

Structure:

>>> import secsgem
>>> secsgem.SecsS05F12
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS05F12()
S5F12 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS05F13(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F13
{
    EXID: A[20]
    EXRECVRA: A[40]
}

Example:

>>> import secsgem
>>> secsgem.SecsS05F13({"EXID": "EX123", "EXRECVRA": "EXRECVRA2"})
S5F13 W
  <L [2]
    <A "EX123">
    <A "EXRECVRA2">
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F14(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F14
{
    EXID: A[20]
    DATA: {
        ACKA: BOOLEAN[1]
        DATA: {
            ERRCODE: I1/I2/I4/I8
            ERRTEXT: A[120]
        }
    }
}
Example::
>>> import secsgem
>>> secsgem.SecsS05F14({"EXID": "EX123", "DATA": {"ACKA": False, "DATA": {"ERRCODE": 10, "ERRTEXT": "Error"}}})
S5F14
  <L [2]
    <A "EX123">
    <L [2]
      <BOOLEAN False >
      <L [2]
        <I1 10 >
        <A "Error">
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F15(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover complete - notify.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F15
{
    TIMESTAMP: A[32]
    EXID: A[20]
    DATA: {
        ACKA: BOOLEAN[1]
        DATA: {
            ERRCODE: I1/I2/I4/I8
            ERRTEXT: A[120]
        }
    }
}
Example::
>>> import secsgem
>>> secsgem.SecsS05F15({"TIMESTAMP": "161006221500", "EXID": "EX123", "DATA": {"ACKA": False, "DATA": {"ERRCODE": 10, "ERRTEXT": "Error"}}})
S5F15
  <L [3]
    <A "161006221500">
    <A "EX123">
    <L [2]
      <BOOLEAN False >
      <L [2]
        <I1 10 >
        <A "Error">
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F16(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover complete - confirm.

Structure:

>>> import secsgem
>>> secsgem.SecsS05F16
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS05F16()
S5F16 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS05F17(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover abort - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F17
EXID: A[20]

Example:

>>> import secsgem
>>> secsgem.SecsS05F17("EX123")
S5F17 W
  <A "EX123"> .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS05F18(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

exception recover abort - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS05F18
{
    EXID: A[20]
    DATA: {
        ACKA: BOOLEAN[1]
        DATA: {
            ERRCODE: I1/I2/I4/I8
            ERRTEXT: A[120]
        }
    }
}
Example::
>>> import secsgem
>>> secsgem.SecsS05F18({"EXID": "EX123", "DATA": {"ACKA": False, "DATA": {"ERRCODE": 10, "ERRTEXT": "Error"}}})
S5F18
  <L [2]
    <A "EX123">
    <L [2]
      <BOOLEAN False >
      <L [2]
        <I1 10 >
        <A "Error">
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 6.

Structure:

>>> import secsgem
>>> secsgem.SecsS06F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS06F00()
S6F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS06F05(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

multi block data inquiry.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F05
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    DATALENGTH: U1/U2/U4/U8/I1/I2/I4/I8
}

Example:

>>> import secsgem
>>> secsgem.SecsS06F05({"DATAID": 1, "DATALENGTH": 1337})
S6F5 W
  <L [2]
    <U1 1 >
    <U2 1337 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F06(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

multi block data grant.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F06
GRANT6: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS06F06(secsgem.GRANT6.BUSY)
S6F6
  <B 0x1> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F07(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

data transfer request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F07
DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A

Example:

>>> import secsgem
>>> secsgem.SecsS06F07(1)
S6F7 W
  <U1 1 > .
Parameters:value (integer) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F08(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

data transfer data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F08
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    CEID: U1/U2/U4/U8/I1/I2/I4/I8/A
    DS: [
        {
            DSID: U1/U2/U4/U8/I1/I2/I4/I8/A
            DV: [
                {
                    DVNAME: U1/U2/U4/U8/I1/I2/I4/I8/A
                    DVVAL: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
                }
                ...
            ]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS06F08({             "DATAID": 1,             "CEID": 1337,             "DS": [{                 "DSID": 1000,                 "DV": [                     {"DVNAME": "VAR1", "DVVAL": "VAR"},                     {"DVNAME": "VAR2", "DVVAL": secsgem.SecsVarU4(100)}]}]})
S6F8
  <L [3]
    <U1 1 >
    <U2 1337 >
    <L [1]
      <L [2]
        <U2 1000 >
        <L [2]
          <L [2]
            <A "VAR1">
            <A "VAR">
          >
          <L [2]
            <A "VAR2">
            <U4 100 >
          >
        >
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F11(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

event report.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F11
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    CEID: U1/U2/U4/U8/I1/I2/I4/I8/A
    RPT: [
        {
            RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A
            V: [
                DATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
                ...
            ]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS06F11({"DATAID": 1, "CEID": 1337, "RPT": [{"RPTID": 1000, "V": ["VAR", secsgem.SecsVarU4(100)]}]})
S6F11 W
  <L [3]
    <U1 1 >
    <U2 1337 >
    <L [1]
      <L [2]
        <U2 1000 >
        <L [2]
          <A "VAR">
          <U4 100 >
        >
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F12(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

event report - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F12
ACKC6: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS06F12(secsgem.ACKC6.ACCEPTED)
S6F12
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F15(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

event report request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F15
CEID: U1/U2/U4/U8/I1/I2/I4/I8/A

Example:

>>> import secsgem
>>> secsgem.SecsS06F15(1337)
S6F15 W
  <U2 1337 > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F16(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

event report data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F16
{
    DATAID: U1/U2/U4/U8/I1/I2/I4/I8/A
    CEID: U1/U2/U4/U8/I1/I2/I4/I8/A
    RPT: [
        {
            RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A
            V: [
                DATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
                ...
            ]
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS06F16({"DATAID": 1, "CEID": 1337, "RPT": [{"RPTID": 1000, "V": ["VAR", secsgem.SecsVarU4(100)]}]})
S6F16
  <L [3]
    <U1 1 >
    <U2 1337 >
    <L [1]
      <L [2]
        <U2 1000 >
        <L [2]
          <A "VAR">
          <U4 100 >
        >
      >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F19(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

individual report request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F19
RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A

Example:

>>> import secsgem
>>> secsgem.SecsS06F19(secsgem.SecsVarU4(1337))
S6F19 W
  <U4 1337 > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F20(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

individual report data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F20
[
    V: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS06F20(["ASD", 1337])
S6F20
  <L [2]
    <A "ASD">
    <U2 1337 >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F21(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

annotated individual report request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F21
RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A

Example:

>>> import secsgem
>>> secsgem.SecsS06F21(secsgem.SecsVarU4(1337))
S6F21 W
  <U4 1337 > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS06F22(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

annotated individual report data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS06F22
[
    {
        VID: U1/U2/U4/U8/I1/I2/I4/I8/A
        V: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
    }
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS06F22([{"VID": "VID1", "V": "ASD"}, {"VID": 2, "V": 1337}])
S6F22
  <L [2]
    <L [2]
      <A "VID1">
      <A "ASD">
    >
    <L [2]
      <U1 2 >
      <U2 1337 >
    >
  > .
Parameters:value (list) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 7.

Structure:

>>> import secsgem
>>> secsgem.SecsS07F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS07F00()
S7F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS07F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program load - inquire.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F01
{
    PPID: A/B[120]
    LENGTH: U1/U2/U4/U8/I1/I2/I4/I8
}

Example:

>>> import secsgem
>>> secsgem.SecsS07F01({"PPID": "program", "LENGTH": 4})
S7F1 W
  <L [2]
    <A "program">
    <U1 4 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program load - grant.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F02
PPGNT: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS07F02(secsgem.PPGNT.OK)
S7F2
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F03
{
    PPID: A/B[120]
    PPBODY: U1/U2/U4/U8/I1/I2/I4/I8/A/B
}

Example:

>>> import secsgem
>>> secsgem.SecsS07F03({"PPID": "program", "PPBODY": secsgem.SecsVarBinary("data")})
S7F3 W
  <L [2]
    <A "program">
    <B 0x64 0x61 0x74 0x61>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F04
ACKC7: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS07F04(secsgem.ACKC7.MATRIX_OVERFLOW)
S7F4
  <B 0x3> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F05(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F05
PPID: A/B[120]

Example:

>>> import secsgem
>>> secsgem.SecsS07F05("program")
S7F5 W
  <A "program"> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F06(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

process program - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F06
{
    PPID: A/B[120]
    PPBODY: U1/U2/U4/U8/I1/I2/I4/I8/A/B
}

Example:

>>> import secsgem
>>> secsgem.SecsS07F06({"PPID": "program", "PPBODY": secsgem.SecsVarBinary("data")})
S7F6
  <L [2]
    <A "program">
    <B 0x64 0x61 0x74 0x61>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F17(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

delete process program - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F17
[
    PPID: A/B[120]
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS07F17(["program1", "program2"])
S7F17 W
  <L [2]
    <A "program1">
    <A "program2">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F18(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

delete process program - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F18
ACKC7: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS07F18(secsgem.ACKC7.MODE_UNSUPPORTED)
S7F18
  <B 0x5> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F19(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

current equipment process program - request.

Structure:

>>> import secsgem
>>> secsgem.SecsS07F19
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS07F19()
S7F19 W .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS07F20(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

current equipment process program - data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS07F20
[
    PPID: A/B[120]
    ...
]

Example:

>>> import secsgem
>>> secsgem.SecsS07F20(["program1", "program2"])
S7F20
  <L [2]
    <A "program1">
    <A "program2">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 9.

Structure:

>>> import secsgem
>>> secsgem.SecsS09F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS09F00()
S9F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS09F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

unrecognized device id.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F01
MHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F01("HEADERDATA")
S9F1
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

unrecognized stream type.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F03
MHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F03("HEADERDATA")
S9F3
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F05(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

unrecognized function type.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F05
MHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F05("HEADERDATA")
S9F5
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F07(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

illegal data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F07
MHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F07("HEADERDATA")
S9F7
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F09(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

transaction timer timeout.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F09
SHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F09("HEADERDATA")
S9F9
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F11(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

data too long.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F11
MHEAD: B[10]

Example:

>>> import secsgem
>>> secsgem.SecsS09F11("HEADERDATA")
S9F11
  <B 0x48 0x45 0x41 0x44 0x45 0x52 0x44 0x41 0x54 0x41> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS09F13(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

conversation timeout.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS09F13
{
    MEXP: A[6]
    EDID: U1/U2/U4/U8/I1/I2/I4/I8/A/B
}

Example:

>>> import secsgem
>>> secsgem.SecsS09F13({"MEXP": "S01E01", "EDID": "data"})
S9F13
  <L [2]
    <A "S01E01">
    <A "data">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS10F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 10.

Structure:

>>> import secsgem
>>> secsgem.SecsS10F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS10F00()
S10F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS10F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

terminal - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS10F01
{
    TID: B[1]
    TEXT: U1/U2/U4/U8/I1/I2/I4/I8/A/B
}

Example:

>>> import secsgem
>>> secsgem.SecsS10F01({"TID": 0, "TEXT": "hello?"})
S10F1
  <L [2]
    <B 0x0>
    <A "hello?">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS10F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

terminal - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS10F02
ACKC10: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS10F02(secsgem.ACKC10.ACCEPTED)
S10F2
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS10F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

terminal single - display.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS10F03
{
    TID: B[1]
    TEXT: U1/U2/U4/U8/I1/I2/I4/I8/A/B
}

Example:

>>> import secsgem
>>> secsgem.SecsS10F03({"TID": 0, "TEXT": "hello!"})
S10F3
  <L [2]
    <B 0x0>
    <A "hello!">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS10F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

terminal single - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS10F04
ACKC10: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS10F04(secsgem.ACKC10.TERMINAL_NOT_AVAILABLE)
S10F4
  <B 0x2> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 12.

Structure:

>>> import secsgem
>>> secsgem.SecsS12F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS12F00()
S12F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS12F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map setup data - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F01
{
    MID: A/B[80]
    IDTYP: B[1]
    FNLOC: U2
    FFROT: U2
    ORLOC: B
    RPSEL: U1
    REFP: [
        DATA: I1/I2/I4/I8
        ...
    ]
    DUTMS: A
    XDIES: U1/U2/U4/U8/F4/F8
    YDIES: U1/U2/U4/U8/F4/F8
    ROWCT: U1/U2/U4/U8
    COLCT: U1/U2/U4/U8
    NULBC: U1/A
    PRDCT: U1/U2/U4/U8
    PRAXI: B[1]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F01({"MID": "materialID",                 "IDTYP": secsgem.IDTYP.WAFER,                 "FNLOC": 0,                 "FFROT": 0,                 "ORLOC": secsgem.ORLOC.UPPER_LEFT,                 "RPSEL": 0,                 "REFP": [[1,2], [2,3]],                 "DUTMS": "unit",                 "XDIES": 100,                 "YDIES": 100,                 "ROWCT": 10,                 "COLCT": 10,                 "NULBC": "{x}",                 "PRDCT": 100,                 "PRAXI": secsgem.PRAXI.ROWS_TOP_INCR,                 })
S12F1 W
  <L [15]
    <A "materialID">
    <B 0x0>
    <U2 0 >
    <U2 0 >
    <B 0x2>
    <U1 0 >
    <L [2]
      <I1 1 2 >
      <I1 2 3 >
    >
    <A "unit">
    <U1 100 >
    <U1 100 >
    <U1 10 >
    <U1 10 >
    <A "{x}">
    <U1 100 >
    <B 0x0>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map setup data - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F02
SDACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS12F02(secsgem.SDACK.ACK)
S12F2
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map setup data - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F03
{
    MID: A/B[80]
    IDTYP: B[1]
    MAPFT: B[1]
    FNLOC: U2
    FFROT: U2
    ORLOC: B
    PRAXI: B[1]
    BCEQU: U1/A
    NULBC: U1/A
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F03({"MID": "materialID",                 "IDTYP": secsgem.IDTYP.WAFER_CASSETTE,                 "MAPFT": secsgem.MAPFT.ROW,                 "FNLOC": 0,                 "FFROT": 0,                 "ORLOC": secsgem.ORLOC.LOWER_LEFT,                 "PRAXI": secsgem.PRAXI.COLS_LEFT_INCR,                 "BCEQU": [1, 3, 5, 7],                 "NULBC": "{x}",                 })
S12F3 W
  <L [9]
    <A "materialID">
    <B 0x1>
    <B 0x0>
    <U2 0 >
    <U2 0 >
    <B 0x3>
    <B 0x4>
    <U1 1 3 5 7 >
    <A "{x}">
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map setup data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F04
{
    MID: A/B[80]
    IDTYP: B[1]
    FNLOC: U2
    ORLOC: B
    RPSEL: U1
    REFP: [
        DATA: I1/I2/I4/I8
        ...
    ]
    DUTMS: A
    XDIES: U1/U2/U4/U8/F4/F8
    YDIES: U1/U2/U4/U8/F4/F8
    ROWCT: U1/U2/U4/U8
    COLCT: U1/U2/U4/U8
    PRDCT: U1/U2/U4/U8
    BCEQU: U1/A
    NULBC: U1/A
    MLCL: U1/U2/U4/U8
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F04({"MID": "materialID",                 "IDTYP": secsgem.IDTYP.FILM_FRAME,                 "FNLOC": 0,                 "ORLOC": secsgem.ORLOC.CENTER_DIE,                 "RPSEL": 0,                 "REFP": [[1,2], [2,3]],                 "DUTMS": "unit",                 "XDIES": 100,                 "YDIES": 100,                 "ROWCT": 10,                 "COLCT": 10,                 "PRDCT": 100,                 "BCEQU": [1, 3, 5, 7],                 "NULBC": "{x}",                 "MLCL": 0,                 })
S12F4
  <L [15]
    <A "materialID">
    <B 0x2>
    <U2 0 >
    <B 0x0>
    <U1 0 >
    <L [2]
      <I1 1 2 >
      <I1 2 3 >
    >
    <A "unit">
    <U1 100 >
    <U1 100 >
    <U1 10 >
    <U1 10 >
    <U1 100 >
    <U1 1 3 5 7 >
    <A "{x}">
    <U1 0 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F05(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map transmit inquire.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F05
{
    MID: A/B[80]
    IDTYP: B[1]
    MAPFT: B[1]
    MLCL: U1/U2/U4/U8
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F05({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER, "MAPFT": secsgem.MAPFT.ARRAY, "MLCL": 0})
S12F5 W
  <L [4]
    <A "materialID">
    <B 0x0>
    <B 0x1>
    <U1 0 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F06(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map transmit - grant.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F06
GRNT1: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS12F06(secsgem.GRNT1.MATERIALID_UNKNOWN)
S12F6
  <B 0x5> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F07(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 1 - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F07
{
    MID: A/B[80]
    IDTYP: B[1]
    DATA: [
        {
            RSINF: I1/I2/I4/I8[3]
            BINLT: U1/A
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F07({             "MID": "materialID",             "IDTYP": secsgem.IDTYP.WAFER,             "DATA": [                 {"RSINF": [1, 2, 3], "BINLT": [1, 2, 3, 4]},                 {"RSINF": [4, 5, 6], "BINLT": [5, 6, 7, 8]}]})
S12F7 W
  <L [3]
    <A "materialID">
    <B 0x0>
    <L [2]
      <L [2]
        <I1 1 2 3 >
        <U1 1 2 3 4 >
      >
      <L [2]
        <I1 4 5 6 >
        <U1 5 6 7 8 >
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F08(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 1 - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F08
MDACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS12F08(secsgem.MDACK.ABORT_MAP)
S12F8
  <B 0x3> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F09(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 2 - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F09
{
    MID: A/B[80]
    IDTYP: B[1]
    STRP: I1/I2/I4/I8[2]
    BINLT: U1/A
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F09({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER, "STRP": [0, 1], "BINLT": [1, 2, 3, 4, 5, 6]})
S12F9 W
  <L [4]
    <A "materialID">
    <B 0x0>
    <I1 0 1 >
    <U1 1 2 3 4 5 6 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F10(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 2 - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F10
MDACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS12F10(secsgem.MDACK.ACK)
S12F10
  <B 0x0> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F11(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 3 - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F11
{
    MID: A/B[80]
    IDTYP: B[1]
    DATA: [
        {
            XYPOS: I1/I2/I4/I8[2]
            BINLT: U1/A
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F11({             "MID": "materialID",             "IDTYP": secsgem.IDTYP.WAFER,             "DATA": [                 {"XYPOS": [1, 2], "BINLT": [1, 2, 3, 4]},                 {"XYPOS": [3, 4], "BINLT": [5, 6, 7, 8]}]})
S12F11 W
  <L [3]
    <A "materialID">
    <B 0x0>
    <L [2]
      <L [2]
        <I1 1 2 >
        <U1 1 2 3 4 >
      >
      <L [2]
        <I1 3 4 >
        <U1 5 6 7 8 >
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F12(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 3 - acknowledge.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F12
MDACK: B[1]

Example:

>>> import secsgem
>>> secsgem.SecsS12F12(secsgem.MDACK.FORMAT_ERROR)
S12F12
  <B 0x1> .
Parameters:value (byte) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F13(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 1 - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F13
{
    MID: A/B[80]
    IDTYP: B[1]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F13({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER})
S12F13 W
  <L [2]
    <A "materialID">
    <B 0x0>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F14(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 1.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F14
{
    MID: A/B[80]
    IDTYP: B[1]
    DATA: [
        {
            RSINF: I1/I2/I4/I8[3]
            BINLT: U1/A
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F14({             "MID": "materialID",             "IDTYP": secsgem.IDTYP.WAFER,             "DATA": [                 {"RSINF": [1, 2, 3], "BINLT": [1, 2, 3, 4]},                 {"RSINF": [4, 5, 6], "BINLT": [5, 6, 7, 8]}]})
S12F14
  <L [3]
    <A "materialID">
    <B 0x0>
    <L [2]
      <L [2]
        <I1 1 2 3 >
        <U1 1 2 3 4 >
      >
      <L [2]
        <I1 4 5 6 >
        <U1 5 6 7 8 >
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F15(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 2 - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F15
{
    MID: A/B[80]
    IDTYP: B[1]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F15({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER})
S12F15 W
  <L [2]
    <A "materialID">
    <B 0x0>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F16(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 2.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F16
{
    MID: A/B[80]
    IDTYP: B[1]
    STRP: I1/I2/I4/I8[2]
    BINLT: U1/A
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F16({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER, "STRP": [0, 1], "BINLT": [1, 2, 3, 4, 5, 6]})
S12F16
  <L [4]
    <A "materialID">
    <B 0x0>
    <I1 0 1 >
    <U1 1 2 3 4 5 6 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F17(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 3 - request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F17
{
    MID: A/B[80]
    IDTYP: B[1]
    SDBIN: B[1]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F17({"MID": "materialID", "IDTYP": secsgem.IDTYP.WAFER, "SDBIN": secsgem.SDBIN.DONT_SEND})
S12F17 W
  <L [3]
    <A "materialID">
    <B 0x0>
    <B 0x1>
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F18(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map data type 3.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F18
{
    MID: A/B[80]
    IDTYP: B[1]
    DATA: [
        {
            XYPOS: I1/I2/I4/I8[2]
            BINLT: U1/A
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F18({                 "MID": "materialID",                 "IDTYP": secsgem.IDTYP.WAFER,                 "DATA": [                     {"XYPOS": [1, 2], "BINLT": [1, 2, 3, 4]},                     {"XYPOS": [3, 4], "BINLT": [5, 6, 7, 8]}]})
S12F18
  <L [3]
    <A "materialID">
    <B 0x0>
    <L [2]
      <L [2]
        <I1 1 2 >
        <U1 1 2 3 4 >
      >
      <L [2]
        <I1 3 4 >
        <U1 5 6 7 8 >
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS12F19(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

map error report - send.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS12F19
{
    MAPER: B[1]
    DATLC: U1
}

Example:

>>> import secsgem
>>> secsgem.SecsS12F19({"MAPER": secsgem.MAPER.INVALID_DATA, "DATLC": 0})
S12F19
  <L [2]
    <B 0x1>
    <U1 0 >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS14F00(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

abort transaction stream 14.

Structure:

>>> import secsgem
>>> secsgem.SecsS14F00
Header only

Example:

>>> import secsgem
>>> secsgem.SecsS14F00()
S14F0 .
Parameters:value (None) – function has no parameters
class secsgem.secs.functions.SecsS14F01(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

GetAttr request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS14F01
{
    OBJSPEC: A
    OBJTYPE: U1/U2/U4/U8/A
    OBJID: [
        DATA: U1/U2/U4/U8/A
        ...
    ]
    FILTER: [
        {
            ATTRID: U1/U2/U4/U8/A
            ATTRDATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
            ATTRRELN: U1
        }
        ...
    ]
    ATTRID: [
        DATA: U1/U2/U4/U8/A
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS14F01({             "OBJSPEC": '',             "OBJTYPE": 'StripMap',             "OBJID": ['MAP001'],             "FILTER": [],             "ATTRID": ['OriginLocation', 'Rows', 'Columns', 'CellStatus', 'LotID']})
S14F1 W
  <L [5]
    <A>
    <A "StripMap">
    <L [1]
      <A "MAP001">
    >
    <L>
    <L [5]
      <A "OriginLocation">
      <A "Rows">
      <A "Columns">
      <A "CellStatus">
      <A "LotID">
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
RELATION = {'EQUAL': 0, 'GREATER': 4, 'GREATEREQUAL': 5, 'LESS': 2, 'LESSEQUAL': 3, 'NOTEQUAL': 1, 'NOTPRESENT': 7, 'PRESENT': 6}
class secsgem.secs.functions.SecsS14F02(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

GetAttr data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS14F02
{
    DATA: [
        {
            OBJID: U1/U2/U4/U8/A
            ATTRIBS: [
                {
                    ATTRID: U1/U2/U4/U8/A
                    ATTRDATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
                }
                ...
            ]
        }
        ...
    ]
    ERRORS: {
        OBJACK: U1[1]
        ERROR: [
            {
                ERRCODE: I1/I2/I4/I8
                ERRTEXT: A[120]
            }
            ...
        ]
    }
}

Example:

>>> import secsgem
>>> secsgem.SecsS14F02({             "DATA": [{                 "OBJID": "MAP001",                 "ATTRIBS": [                     {"ATTRID": "OriginLocation", "ATTRDATA": "0"},                     {"ATTRID": "Rows", "ATTRDATA": 4},                     {"ATTRID": "Columns", "ATTRDATA": 4},                     {"ATTRID": "CellStatus", "ATTRDATA": 6},                     {"ATTRID": "LotID", "ATTRDATA":"LOT001"}]}],                 "ERRORS": {"OBJACK": 0}})
S14F2
  <L [2]
    <L [1]
      <L [2]
        <A "MAP001">
        <L [5]
          <L [2]
            <A "OriginLocation">
            <A "0">
          >
          <L [2]
            <A "Rows">
            <U1 4 >
          >
          <L [2]
            <A "Columns">
            <U1 4 >
          >
          <L [2]
            <A "CellStatus">
            <U1 6 >
          >
          <L [2]
            <A "LotID">
            <A "LOT001">
          >
        >
      >
    >
    <L [2]
      <U1 0 >
      <L>
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS14F03(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

SetAttr request.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS14F03
{
    OBJSPEC: A
    OBJTYPE: U1/U2/U4/U8/A
    OBJID: [
        DATA: U1/U2/U4/U8/A
        ...
    ]
    ATTRIBS: [
        {
            ATTRID: U1/U2/U4/U8/A
            ATTRDATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
        }
        ...
    ]
}

Example:

>>> import secsgem
>>> secsgem.SecsS14F03({"OBJSPEC": '', "OBJTYPE": 'StripMap', "OBJID": ['MAP001'], "ATTRIBS": [ {"ATTRID": "CellStatus", "ATTRDATA": "3"} ] })
S14F3 W
  <L [4]
    <A>
    <A "StripMap">
    <L [1]
      <A "MAP001">
    >
    <L [1]
      <L [2]
        <A "CellStatus">
        <A "3">
      >
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
class secsgem.secs.functions.SecsS14F04(value=None)[source]

Bases: secsgem.secs.functionbase.SecsStreamFunction

SetAttr data.

Data Items

Structure:

>>> import secsgem
>>> secsgem.SecsS14F04
{
    DATA: [
        {
            OBJID: U1/U2/U4/U8/A
            ATTRIBS: [
                {
                    ATTRID: U1/U2/U4/U8/A
                    ATTRDATA: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B
                }
                ...
            ]
        }
        ...
    ]
    ERRORS: {
        OBJACK: U1[1]
        ERROR: [
            {
                ERRCODE: I1/I2/I4/I8
                ERRTEXT: A[120]
            }
            ...
        ]
    }
}

Example:

>>> import secsgem
>>> secsgem.SecsS14F04({             "DATA": [{                 "OBJID": "MAP001",                 "ATTRIBS": [                     {"ATTRID": "OriginLocation", "ATTRDATA": "0"},                     {"ATTRID": "Rows", "ATTRDATA": 4},                     {"ATTRID": "Columns", "ATTRDATA": 4},                     {"ATTRID": "CellStatus", "ATTRDATA": 6},                     {"ATTRID": "LotID", "ATTRDATA":"LOT001"}]}],                 "ERRORS": {"OBJACK": 0}})
S14F4
  <L [2]
    <L [1]
      <L [2]
        <A "MAP001">
        <L [5]
          <L [2]
            <A "OriginLocation">
            <A "0">
          >
          <L [2]
            <A "Rows">
            <U1 4 >
          >
          <L [2]
            <A "Columns">
            <U1 4 >
          >
          <L [2]
            <A "CellStatus">
            <U1 6 >
          >
          <L [2]
            <A "LotID">
            <A "LOT001">
          >
        >
      >
    >
    <L [2]
      <U1 0 >
      <L>
    >
  > .
Parameters:value (dict) – parameters for this function (see example)
Handler
class secsgem.secs.handler.SecsHandler(address, port, active, session_id, name, custom_connection_handler=None)[source]

Bases: secsgem.hsms.handler.HsmsHandler

Baseclass for creating Host/Equipment models. This layer contains the SECS functionality.

Inherit from this class and override required functions.

register_stream_function(stream, function, callback)[source]

Register the function callback for stream and function.

Parameters:
  • stream (integer) – stream to register callback for
  • function (integer) – function to register callback for
  • callback (def callback(connection)) – method to call when stream and functions is received
unregister_stream_function(stream, function)[source]

Unregister the function callback for stream and function.

Parameters:
  • stream (integer) – stream to unregister callback for
  • function (integer) – function to register callback for
collection_events

Dictionary of available collection events.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.collection_events[123] = {'name': 'collectionEventName', 'dvids': [1, 5] }

Key

Id of the collection event (integer)

Data

Dictionary with the following fields

name
Name of the collection event (string)
dvids
Data values for the collection event (list of integers)
data_values

Dictionary of available data values.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.data_values[5] = {'name': 'dataValueName', 'ceid': 123 }

Key

Id of the data value (integer)

Data

Dictionary with the following fields

name
Name of the data value (string)
ceid
Collection event the data value is used for (integer)
alarms

Dictionary of available alarms.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.alarms[137] = {'ceidon': 1371, 'ceidoff': 1372}

Key

Id of the alarm (integer)

Data

Dictionary with the following fields

ceidon
Collection event id for alarm on (integer)
ceidoff
Collection event id for alarm off (integer)
remote_commands

Dictionary of available remote commands.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.remote_commands["PP_SELECT"] = {'params': [{'name': 'PROGRAM', 'format': 'A'}], 'ceids': [200, 343]}

Key

Name of the remote command (string)

Data

Dictionary with the following fields

params

Parameters for the remote command (list of dictionaries)

Parameters

The dictionaries have the following fields

name
name of the parameter (string)
format
format character of the parameter (string)
ceids
Collection events ids the remote command might return (list of integers)
disable_ceids()[source]

Disable all Collection Events.

disable_ceid_reports()[source]

Disable all Collection Event Reports.

list_svs(svs=None)[source]

Get list of available Service Variables.

Returns:available Service Variables
Return type:list
request_svs(svs)[source]

Request contents of supplied Service Variables.

Parameters:svs (list) – Service Variables to request
Returns:values of requested Service Variables
Return type:list
request_sv(sv)[source]

Request contents of one Service Variable.

Parameters:sv (int) – id of Service Variable
Returns:value of requested Service Variable
Return type:various
list_ecs(ecs=None)[source]

Get list of available Equipment Constants.

Returns:available Equipment Constants
Return type:list
request_ecs(ecs)[source]

Request contents of supplied Equipment Constants.

Parameters:ecs (list) – Equipment Constants to request
Returns:values of requested Equipment Constants
Return type:list
request_ec(ec)[source]

Request contents of one Equipment Constant.

Parameters:ec (int) – id of Equipment Constant
Returns:value of requested Equipment Constant
Return type:various
set_ecs(ecs)[source]

Set contents of supplied Equipment Constants.

Parameters:ecs (list) – list containing list of id / value pairs
set_ec(ec, value)[source]

Set contents of one Equipment Constant.

Parameters:
  • ec (int) – id of Equipment Constant
  • value (various) – new content of Equipment Constant
send_equipment_terminal(terminal_id, text)[source]

Set text to equipment terminal.

Parameters:
  • terminal_id (int) – ID of terminal
  • text (string) – text to send
get_ceid_name(ceid)[source]

Get the name of a collection event.

Parameters:ceid (integer) – ID of collection event
Returns:Name of the event or empty string if not found
Return type:string
get_dvid_name(dvid)[source]

Get the name of a data value.

Parameters:dvid (integer) – ID of data value
Returns:Name of the event or empty string if not found
Return type:string
are_you_there()[source]

Check if remote is still replying.

stream_function(stream, function)[source]

Get class for stream and function.

Parameters:
  • stream (int) – stream to get function for
  • function (int) – function to get
Returns:

matching stream and function class

Return type:

secsSxFx class

secs_decode(packet)[source]

Get object of decoded stream and function class, or None if no class is available.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – packet to get object for
Returns:matching stream and function object
Return type:secsSxFx object
callbacks

Property for callback handling.

disable()

Disables the connection.

enable()

Enables the connection.

events

Property for event handling.

get_next_system_counter()

Returns the next System.

Returns:System for the next command
Return type:integer
on_connection_before_closed(_)

Connection is about to be closed.

on_connection_closed(_)

Connection was closed.

on_connection_established(_)

Connection was established.

on_connection_packet_received(_, packet)

Packet received by connection.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – received data packet
send_and_waitfor_response(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
Returns:Packet that was received
Return type:secsgem.hsms.packets.HsmsPacket
send_deselect_req()

Send a Deselect Request to the remote host.

Returns:System of the sent request
Return type:integer
send_deselect_rsp(system_id)

Send a Deselect Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_linktest_req()

Send a Linktest Request to the remote host.

Returns:System of the sent request
Return type:integer
send_linktest_rsp(system_id)

Send a Linktest Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_reject_rsp(system_id, s_type, reason)

Send a Reject Response to the remote host.

Parameters:
  • system_id (integer) – System of the request to reply for
  • s_type (integer) – s_type of rejected message
  • reason (integer) – reason for rejection
send_response(function, system)

Send response function for system.

Parameters:
send_select_req()

Send a Select Request to the remote host.

Returns:System of the sent request
Return type:integer
send_select_rsp(system_id)

Send a Select Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_separate_req()

Send a Separate Request to the remote host.

send_stream_function(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent

GEM

Handler
class secsgem.gem.handler.GemHandler(address, port, active, session_id, name, custom_connection_handler=None)[source]

Bases: secsgem.secs.handler.SecsHandler

Baseclass for creating Host/Equipment models. This layer contains GEM functionality.

MDLN = None

model number returned by S01E13/14

SOFTREV = None

software version returned by S01E13/14

enable()[source]

Enables the connection.

disable()[source]

Disables the connection.

on_connection_closed(connection)[source]

Connection was closed.

on_commack_requested()[source]

Get the acknowledgement code for the connection request.

override to accept or deny connection request

Returns:0 when connection is accepted, 1 when connection is denied
Return type:integer
send_process_program(ppid, ppbody)[source]

Send a process program.

Parameters:
  • ppid (string) – Transferred process programs ID
  • ppbody (string) – Content of process program
request_process_program(ppid)[source]

Request a process program.

Parameters:ppid (string) – Transferred process programs ID
waitfor_communicating(timeout=None)[source]

Wait until connection gets into communicating state. Returns immediately if state is communicating.

Parameters:timeout (float) – seconds to wait before aborting
Returns:True if state is communicating, False if timed out
Return type:bool
alarms

Dictionary of available alarms.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.alarms[137] = {'ceidon': 1371, 'ceidoff': 1372}

Key

Id of the alarm (integer)

Data

Dictionary with the following fields

ceidon
Collection event id for alarm on (integer)
ceidoff
Collection event id for alarm off (integer)
are_you_there()

Check if remote is still replying.

callbacks

Property for callback handling.

collection_events

Dictionary of available collection events.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.collection_events[123] = {'name': 'collectionEventName', 'dvids': [1, 5] }

Key

Id of the collection event (integer)

Data

Dictionary with the following fields

name
Name of the collection event (string)
dvids
Data values for the collection event (list of integers)
data_values

Dictionary of available data values.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.data_values[5] = {'name': 'dataValueName', 'ceid': 123 }

Key

Id of the data value (integer)

Data

Dictionary with the following fields

name
Name of the data value (string)
ceid
Collection event the data value is used for (integer)
disable_ceid_reports()

Disable all Collection Event Reports.

disable_ceids()

Disable all Collection Events.

events

Property for event handling.

get_ceid_name(ceid)

Get the name of a collection event.

Parameters:ceid (integer) – ID of collection event
Returns:Name of the event or empty string if not found
Return type:string
get_dvid_name(dvid)

Get the name of a data value.

Parameters:dvid (integer) – ID of data value
Returns:Name of the event or empty string if not found
Return type:string
get_next_system_counter()

Returns the next System.

Returns:System for the next command
Return type:integer
list_ecs(ecs=None)

Get list of available Equipment Constants.

Returns:available Equipment Constants
Return type:list
list_svs(svs=None)

Get list of available Service Variables.

Returns:available Service Variables
Return type:list
on_connection_before_closed(_)

Connection is about to be closed.

on_connection_established(_)

Connection was established.

on_connection_packet_received(_, packet)

Packet received by connection.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – received data packet
register_stream_function(stream, function, callback)

Register the function callback for stream and function.

Parameters:
  • stream (integer) – stream to register callback for
  • function (integer) – function to register callback for
  • callback (def callback(connection)) – method to call when stream and functions is received
remote_commands

Dictionary of available remote commands.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.remote_commands["PP_SELECT"] = {'params': [{'name': 'PROGRAM', 'format': 'A'}], 'ceids': [200, 343]}

Key

Name of the remote command (string)

Data

Dictionary with the following fields

params

Parameters for the remote command (list of dictionaries)

Parameters

The dictionaries have the following fields

name
name of the parameter (string)
format
format character of the parameter (string)
ceids
Collection events ids the remote command might return (list of integers)
request_ec(ec)

Request contents of one Equipment Constant.

Parameters:ec (int) – id of Equipment Constant
Returns:value of requested Equipment Constant
Return type:various
request_ecs(ecs)

Request contents of supplied Equipment Constants.

Parameters:ecs (list) – Equipment Constants to request
Returns:values of requested Equipment Constants
Return type:list
request_sv(sv)

Request contents of one Service Variable.

Parameters:sv (int) – id of Service Variable
Returns:value of requested Service Variable
Return type:various
request_svs(svs)

Request contents of supplied Service Variables.

Parameters:svs (list) – Service Variables to request
Returns:values of requested Service Variables
Return type:list
secs_decode(packet)

Get object of decoded stream and function class, or None if no class is available.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – packet to get object for
Returns:matching stream and function object
Return type:secsSxFx object
send_and_waitfor_response(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
Returns:Packet that was received
Return type:secsgem.hsms.packets.HsmsPacket
send_deselect_req()

Send a Deselect Request to the remote host.

Returns:System of the sent request
Return type:integer
send_deselect_rsp(system_id)

Send a Deselect Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_equipment_terminal(terminal_id, text)

Set text to equipment terminal.

Parameters:
  • terminal_id (int) – ID of terminal
  • text (string) – text to send
send_linktest_req()

Send a Linktest Request to the remote host.

Returns:System of the sent request
Return type:integer
send_linktest_rsp(system_id)

Send a Linktest Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_reject_rsp(system_id, s_type, reason)

Send a Reject Response to the remote host.

Parameters:
  • system_id (integer) – System of the request to reply for
  • s_type (integer) – s_type of rejected message
  • reason (integer) – reason for rejection
send_response(function, system)

Send response function for system.

Parameters:
send_select_req()

Send a Select Request to the remote host.

Returns:System of the sent request
Return type:integer
send_select_rsp(system_id)

Send a Select Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_separate_req()

Send a Separate Request to the remote host.

send_stream_function(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
set_ec(ec, value)

Set contents of one Equipment Constant.

Parameters:
  • ec (int) – id of Equipment Constant
  • value (various) – new content of Equipment Constant
set_ecs(ecs)

Set contents of supplied Equipment Constants.

Parameters:ecs (list) – list containing list of id / value pairs
stream_function(stream, function)

Get class for stream and function.

Parameters:
  • stream (int) – stream to get function for
  • function (int) – function to get
Returns:

matching stream and function class

Return type:

secsSxFx class

unregister_stream_function(stream, function)

Unregister the function callback for stream and function.

Parameters:
  • stream (integer) – stream to unregister callback for
  • function (integer) – function to register callback for
HostHandler
class secsgem.gem.hosthandler.GemHostHandler(address, port, active, session_id, name, custom_connection_handler=None)[source]

Bases: secsgem.gem.handler.GemHandler

Baseclass for creating host models. Inherit from this class and override required functions.

clear_collection_events()[source]

Clear all collection events.

subscribe_collection_event(ceid, dvs, report_id=None)[source]

Subscribe to a collection event.

Parameters:
  • ceid (integer) – ID of the collection event
  • dvs (list of integers) – DV IDs to add for collection event
  • report_id (integer) – optional - ID for report, autonumbering if None
send_remote_command(rcmd, params)[source]

Send a remote command.

Parameters:
  • rcmd (string) – Name of command
  • params (list of strings) – DV IDs to add for collection event
delete_process_programs(ppids)[source]

Delete a list of process program.

Parameters:ppids (list of strings) – Process programs to delete
get_process_program_list()[source]

Get process program list.

go_online()[source]

Set control state to online.

go_offline()[source]

Set control state to offline.

enable_alarm(alid)[source]

Enable alarm.

Parameters:alid (secsgem.secs.dataitems.ALID) – alarm id to enable
disable_alarm(alid)[source]

Disable alarm.

Parameters:alid (secsgem.secs.dataitems.ALID) – alarm id to disable
list_alarms(alids=None)[source]

List alarms.

Parameters:alids (array of int/str) – alarms to list details for
list_enabled_alarms()[source]

List enabled alarms.

alarms

Dictionary of available alarms.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.alarms[137] = {'ceidon': 1371, 'ceidoff': 1372}

Key

Id of the alarm (integer)

Data

Dictionary with the following fields

ceidon
Collection event id for alarm on (integer)
ceidoff
Collection event id for alarm off (integer)
are_you_there()

Check if remote is still replying.

callbacks

Property for callback handling.

collection_events

Dictionary of available collection events.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.collection_events[123] = {'name': 'collectionEventName', 'dvids': [1, 5] }

Key

Id of the collection event (integer)

Data

Dictionary with the following fields

name
Name of the collection event (string)
dvids
Data values for the collection event (list of integers)
data_values

Dictionary of available data values.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, False, 0, "test")
>>> handler.data_values[5] = {'name': 'dataValueName', 'ceid': 123 }

Key

Id of the data value (integer)

Data

Dictionary with the following fields

name
Name of the data value (string)
ceid
Collection event the data value is used for (integer)
disable()

Disables the connection.

disable_ceid_reports()

Disable all Collection Event Reports.

disable_ceids()

Disable all Collection Events.

enable()

Enables the connection.

events

Property for event handling.

get_ceid_name(ceid)

Get the name of a collection event.

Parameters:ceid (integer) – ID of collection event
Returns:Name of the event or empty string if not found
Return type:string
get_dvid_name(dvid)

Get the name of a data value.

Parameters:dvid (integer) – ID of data value
Returns:Name of the event or empty string if not found
Return type:string
get_next_system_counter()

Returns the next System.

Returns:System for the next command
Return type:integer
list_ecs(ecs=None)

Get list of available Equipment Constants.

Returns:available Equipment Constants
Return type:list
list_svs(svs=None)

Get list of available Service Variables.

Returns:available Service Variables
Return type:list
on_commack_requested()

Get the acknowledgement code for the connection request.

override to accept or deny connection request

Returns:0 when connection is accepted, 1 when connection is denied
Return type:integer
on_connection_before_closed(_)

Connection is about to be closed.

on_connection_closed(connection)

Connection was closed.

on_connection_established(_)

Connection was established.

on_connection_packet_received(_, packet)

Packet received by connection.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – received data packet
register_stream_function(stream, function, callback)

Register the function callback for stream and function.

Parameters:
  • stream (integer) – stream to register callback for
  • function (integer) – function to register callback for
  • callback (def callback(connection)) – method to call when stream and functions is received
remote_commands

Dictionary of available remote commands.

Example:

>>> handler = SecsHandler("127.0.0.1", 5000, True, 0, "test")
>>> handler.remote_commands["PP_SELECT"] = {'params': [{'name': 'PROGRAM', 'format': 'A'}], 'ceids': [200, 343]}

Key

Name of the remote command (string)

Data

Dictionary with the following fields

params

Parameters for the remote command (list of dictionaries)

Parameters

The dictionaries have the following fields

name
name of the parameter (string)
format
format character of the parameter (string)
ceids
Collection events ids the remote command might return (list of integers)
request_ec(ec)

Request contents of one Equipment Constant.

Parameters:ec (int) – id of Equipment Constant
Returns:value of requested Equipment Constant
Return type:various
request_ecs(ecs)

Request contents of supplied Equipment Constants.

Parameters:ecs (list) – Equipment Constants to request
Returns:values of requested Equipment Constants
Return type:list
request_process_program(ppid)

Request a process program.

Parameters:ppid (string) – Transferred process programs ID
request_sv(sv)

Request contents of one Service Variable.

Parameters:sv (int) – id of Service Variable
Returns:value of requested Service Variable
Return type:various
request_svs(svs)

Request contents of supplied Service Variables.

Parameters:svs (list) – Service Variables to request
Returns:values of requested Service Variables
Return type:list
secs_decode(packet)

Get object of decoded stream and function class, or None if no class is available.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – packet to get object for
Returns:matching stream and function object
Return type:secsSxFx object
send_and_waitfor_response(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
Returns:Packet that was received
Return type:secsgem.hsms.packets.HsmsPacket
send_deselect_req()

Send a Deselect Request to the remote host.

Returns:System of the sent request
Return type:integer
send_deselect_rsp(system_id)

Send a Deselect Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_equipment_terminal(terminal_id, text)

Set text to equipment terminal.

Parameters:
  • terminal_id (int) – ID of terminal
  • text (string) – text to send
send_linktest_req()

Send a Linktest Request to the remote host.

Returns:System of the sent request
Return type:integer
send_linktest_rsp(system_id)

Send a Linktest Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_process_program(ppid, ppbody)

Send a process program.

Parameters:
  • ppid (string) – Transferred process programs ID
  • ppbody (string) – Content of process program
send_reject_rsp(system_id, s_type, reason)

Send a Reject Response to the remote host.

Parameters:
  • system_id (integer) – System of the request to reply for
  • s_type (integer) – s_type of rejected message
  • reason (integer) – reason for rejection
send_response(function, system)

Send response function for system.

Parameters:
send_select_req()

Send a Select Request to the remote host.

Returns:System of the sent request
Return type:integer
send_select_rsp(system_id)

Send a Select Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_separate_req()

Send a Separate Request to the remote host.

send_stream_function(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
set_ec(ec, value)

Set contents of one Equipment Constant.

Parameters:
  • ec (int) – id of Equipment Constant
  • value (various) – new content of Equipment Constant
set_ecs(ecs)

Set contents of supplied Equipment Constants.

Parameters:ecs (list) – list containing list of id / value pairs
stream_function(stream, function)

Get class for stream and function.

Parameters:
  • stream (int) – stream to get function for
  • function (int) – function to get
Returns:

matching stream and function class

Return type:

secsSxFx class

unregister_stream_function(stream, function)

Unregister the function callback for stream and function.

Parameters:
  • stream (integer) – stream to unregister callback for
  • function (integer) – function to register callback for
waitfor_communicating(timeout=None)

Wait until connection gets into communicating state. Returns immediately if state is communicating.

Parameters:timeout (float) – seconds to wait before aborting
Returns:True if state is communicating, False if timed out
Return type:bool
EquipmentHandler
class secsgem.gem.equipmenthandler.GemEquipmentHandler(address, port, active, session_id, name, custom_connection_handler=None, initial_control_state='ATTEMPT_ONLINE', initial_online_control_state='REMOTE')[source]

Bases: secsgem.gem.handler.GemHandler

Baseclass for creating equipment models. Inherit from this class and override required functions.

control_switch_online()[source]

Operator switches to online control state.

control_switch_offline()[source]

Operator switches to offline control state.

control_switch_online_local()[source]

Operator switches to the local online control state.

control_switch_online_remote()[source]

Operator switches to the local online control state.

data_values

The list of the data values.

Returns:Data value list
Return type:list of secsgem.gem.equipmenthandler.DataValue
on_dv_value_request(dvid, dv)[source]

Get the data value depending on its configuation.

Override in inherited class to provide custom data value request handling.

Parameters:
Returns:

The value encoded in the corresponding type

Return type:

secsgem.secs.variables.SecsVar

status_variables

The list of the status variables.

Returns:Status variable list
Return type:list of secsgem.gem.equipmenthandler.StatusVariables
on_sv_value_request(svid, sv)[source]

Get the status variable value depending on its configuation.

Override in inherited class to provide custom status variable request handling.

Parameters:
Returns:

The value encoded in the corresponding type

Return type:

secsgem.secs.variables.SecsVar

collection_events

The list of the collection events.

Returns:Collection event list
Return type:list of secsgem.gem.equipmenthandler.CollectionEvent
registered_reports

The list of the subscribed reports.

Returns:Collection event report list
Return type:dictionary of subscribed reports
registered_collection_events

The list of the subscribed collection events.

Returns:Collection event list
Return type:dictionary of secsgem.gem.equipmenthandler.CollectionEventLink
trigger_collection_events(ceids)[source]

Triggers the supplied collection events.

Parameters:ceids (list of various) – List of collection events
equipment_constants

The list of the equipments contstants.

Returns:Equipment constant list
Return type:list of secsgem.gem.equipmenthandler.EquipmentConstant
on_ec_value_request(ecid, ec)[source]

Get the equipment constant value depending on its configuation.

Override in inherited class to provide custom equipment constant request handling.

Parameters:
Returns:

The value encoded in the corresponding type

Return type:

secsgem.secs.variables.SecsVar

on_ec_value_update(ecid, ec, value)[source]

Set the equipment constant value depending on its configuation.

Override in inherited class to provide custom equipment constant update handling.

Parameters:
alarms

The list of the alarms.

Returns:Alarms list
Return type:list of secsgem.gem.equipmenthandler.Alarm
set_alarm(alid)[source]

The list of the alarms.

Parameters:alid (str/int) – Alarm id
clear_alarm(alid)[source]

The list of the alarms.

Parameters:alid (str/int) – Alarm id
remote_commands

The list of the remote commands.

Returns:Remote command list
Return type:list of secsgem.gem.equipmenthandler.RemoteCommand
are_you_there()

Check if remote is still replying.

callbacks

Property for callback handling.

disable()

Disables the connection.

disable_ceid_reports()

Disable all Collection Event Reports.

disable_ceids()

Disable all Collection Events.

enable()

Enables the connection.

events

Property for event handling.

get_ceid_name(ceid)

Get the name of a collection event.

Parameters:ceid (integer) – ID of collection event
Returns:Name of the event or empty string if not found
Return type:string
get_dvid_name(dvid)

Get the name of a data value.

Parameters:dvid (integer) – ID of data value
Returns:Name of the event or empty string if not found
Return type:string
get_next_system_counter()

Returns the next System.

Returns:System for the next command
Return type:integer
list_ecs(ecs=None)

Get list of available Equipment Constants.

Returns:available Equipment Constants
Return type:list
list_svs(svs=None)

Get list of available Service Variables.

Returns:available Service Variables
Return type:list
on_commack_requested()

Get the acknowledgement code for the connection request.

override to accept or deny connection request

Returns:0 when connection is accepted, 1 when connection is denied
Return type:integer
on_connection_before_closed(_)

Connection is about to be closed.

on_connection_established(_)

Connection was established.

on_connection_packet_received(_, packet)

Packet received by connection.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – received data packet
register_stream_function(stream, function, callback)

Register the function callback for stream and function.

Parameters:
  • stream (integer) – stream to register callback for
  • function (integer) – function to register callback for
  • callback (def callback(connection)) – method to call when stream and functions is received
request_ec(ec)

Request contents of one Equipment Constant.

Parameters:ec (int) – id of Equipment Constant
Returns:value of requested Equipment Constant
Return type:various
request_ecs(ecs)

Request contents of supplied Equipment Constants.

Parameters:ecs (list) – Equipment Constants to request
Returns:values of requested Equipment Constants
Return type:list
request_process_program(ppid)

Request a process program.

Parameters:ppid (string) – Transferred process programs ID
request_sv(sv)

Request contents of one Service Variable.

Parameters:sv (int) – id of Service Variable
Returns:value of requested Service Variable
Return type:various
request_svs(svs)

Request contents of supplied Service Variables.

Parameters:svs (list) – Service Variables to request
Returns:values of requested Service Variables
Return type:list
secs_decode(packet)

Get object of decoded stream and function class, or None if no class is available.

Parameters:packet (secsgem.hsms.packets.HsmsPacket) – packet to get object for
Returns:matching stream and function object
Return type:secsSxFx object
send_and_waitfor_response(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
Returns:Packet that was received
Return type:secsgem.hsms.packets.HsmsPacket
send_deselect_req()

Send a Deselect Request to the remote host.

Returns:System of the sent request
Return type:integer
send_deselect_rsp(system_id)

Send a Deselect Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_equipment_terminal(terminal_id, text)

Set text to equipment terminal.

Parameters:
  • terminal_id (int) – ID of terminal
  • text (string) – text to send
send_linktest_req()

Send a Linktest Request to the remote host.

Returns:System of the sent request
Return type:integer
send_linktest_rsp(system_id)

Send a Linktest Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_process_program(ppid, ppbody)

Send a process program.

Parameters:
  • ppid (string) – Transferred process programs ID
  • ppbody (string) – Content of process program
send_reject_rsp(system_id, s_type, reason)

Send a Reject Response to the remote host.

Parameters:
  • system_id (integer) – System of the request to reply for
  • s_type (integer) – s_type of rejected message
  • reason (integer) – reason for rejection
send_response(function, system)

Send response function for system.

Parameters:
send_select_req()

Send a Select Request to the remote host.

Returns:System of the sent request
Return type:integer
send_select_rsp(system_id)

Send a Select Response to the remote host.

Parameters:system_id (integer) – System of the request to reply for
send_separate_req()

Send a Separate Request to the remote host.

send_stream_function(packet)

Send the packet and wait for the response.

Parameters:packet (secsgem.secs.functionbase.SecsStreamFunction) – packet to be sent
set_ec(ec, value)

Set contents of one Equipment Constant.

Parameters:
  • ec (int) – id of Equipment Constant
  • value (various) – new content of Equipment Constant
set_ecs(ecs)

Set contents of supplied Equipment Constants.

Parameters:ecs (list) – list containing list of id / value pairs
stream_function(stream, function)

Get class for stream and function.

Parameters:
  • stream (int) – stream to get function for
  • function (int) – function to get
Returns:

matching stream and function class

Return type:

secsSxFx class

unregister_stream_function(stream, function)

Unregister the function callback for stream and function.

Parameters:
  • stream (integer) – stream to unregister callback for
  • function (integer) – function to register callback for
waitfor_communicating(timeout=None)

Wait until connection gets into communicating state. Returns immediately if state is communicating.

Parameters:timeout (float) – seconds to wait before aborting
Returns:True if state is communicating, False if timed out
Return type:bool
on_connection_closed(connection)[source]

Connection was closed.

class secsgem.gem.equipmenthandler.DataValue(dvid, name, value_type, use_callback=True, **kwargs)[source]

Bases: object

Data value definition.

class secsgem.gem.equipmenthandler.StatusVariable(svid, name, unit, value_type, use_callback=True, **kwargs)[source]

Bases: object

Status variable definition.

class secsgem.gem.equipmenthandler.CollectionEvent(ceid, name, data_values, **kwargs)[source]

Bases: object

Collection event definition.

Bases: object

Representation for registered/linked collection event.

reports

The list of the data values.

Returns:List of linked reports
Return type:list of secsgem.gem.equipmenthandler.CollectionEventReport
class secsgem.gem.equipmenthandler.CollectionEventReport(rptid, variables, **kwargs)[source]

Bases: object

Report definition for registered collection events.

class secsgem.gem.equipmenthandler.EquipmentConstant(ecid, name, min_value, max_value, default_value, unit, value_type, use_callback=True, **kwargs)[source]

Bases: object

Equipment constant definition.

Common functionality

Contains helper functions.