### Install Secsgem with Pip Source: https://github.com/bparzella/secsgem/blob/main/README.md Installs the latest official release of the secsgem library from PyPI. ```bash pip install secsgem ``` -------------------------------- ### Install Secsgem Development Version Source: https://github.com/bparzella/secsgem/blob/main/README.md Installs the current development code directly from the GitHub repository. This version might be unstable. ```bash pip install git+git://github.com/bparzella/secsgem ``` -------------------------------- ### SecsS12F01 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Provides an example of calling SecsS12F01 with detailed parameters for map set-up data and shows the resulting SECS message. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F01({ ... "MID": "materialID", ... "IDTYP": secsgem.secs.data_items.IDTYP.WAFER, ... "FNLOC": 0, ... "FFROT": 0, ... "ORLOC": secsgem.secs.data_items.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.secs.data_items.PRAXI.ROWS_TOP_INCR}) S12F1 W > > . ``` -------------------------------- ### SecsS01F15 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F15 for Request OFF-LINE (ROFL). Demonstrates how to call the function. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F15 Header only ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F15() S1F15 W . ``` -------------------------------- ### SecsS02F30 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of calling SecsS02F30 with a list of dictionaries to define equipment constants. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F30([ ... {"ECID": 1, ... "ECNAME": "EC1", ... "ECMIN": secsgem.secs.variables.U1(0), ... "ECMAX": secsgem.secs.variables.U1(100), ... "ECDEF": secsgem.secs.variables.U1(50), ... "UNITS": "mm"}, ... {"ECID": 1337, ... "ECNAME": "EC2", ... "ECMIN": "", ... "ECMAX": "", ... "ECDEF": "", ... "UNITS": ""}]) S2F30 > > > . ``` -------------------------------- ### SecsS01F17 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F17 for Request ON-LINE (RONL). Demonstrates calling the function. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F17 Header only ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F17() S1F17 W . ``` -------------------------------- ### SecsS02F46 Invocation Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Provides an example of calling SecsS02F46 with specific acknowledge values and data, showing the resulting output. ```pycon >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F46({ ... "VLAACK": secsgem.secs.data_items.VLAACK.LIMIT_DEF_ERROR, ... "DATA": [{ ... "VID": 2, ... "LVACK": secsgem.secs.data_items.LVACK.VARIABLE_UNKNOWN, ... "DATA": { ... "LIMITID": 3, ... "LIMITACK": secsgem.secs.data_items.LIMITACK.ASCII_ILLEGAL ... } ... }] ... }) S2F46 > > > > . ``` -------------------------------- ### SecsS05F16 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation of the SecsS05F16 function. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F16() S5F16 . ``` -------------------------------- ### SecsS02F42 Function Call Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows an example of calling SecsS02F42 with specific HCACK and PARAMS values, and the corresponding output. This helps in understanding how to format the acknowledge message. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F42({ ... "HCACK": secsgem.secs.data_items.HCACK.INVALID_COMMAND, ... "PARAMS": [ ... {"CPNAME": "PARAM1", "CPACK": secsgem.secs.data_items.CPACK.CPVAL_ILLEGAL_VALUE}, ... {"CPNAME": "PARAM2", "CPACK": secsgem.secs.data_items.CPACK.CPVAL_ILLEGAL_FORMAT}]}) S2F42 > > > > . ``` -------------------------------- ### SecsS06F01 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation and usage of the SecsS06F01 function with trace data parameters. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F01({ ... "TRID": 1, ... "SMPLN": 3, ... "STIME": "TIME", ... "SV": [1, 4]}) S6F1 > > . ``` -------------------------------- ### SecsS06F00 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation of the SecsS06F00 function. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F00() S6F0 . ``` -------------------------------- ### SecsS02F45 Invocation Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates how to invoke the SecsS02F45 function with specific parameters and shows the expected output format. ```pycon >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F45({ ... "DATAID": 1, ... "DATA": [{ ... "VID": 2, ... "DATA": [{ ... "LIMITID": 3, ... "DATA": [30, 20] ... }] ... }] ... }) S2F45 W > > > > > > . ``` -------------------------------- ### SecsS06F20 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows the structure and instantiation of SecsS06F20 for Individual Report Data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F20 [ V: L/BOOLEAN/U1/U2/U4/U8/I1/I2/I4/I8/F4/F8/A/B ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F20(["ASD", 1337]) S6F20 > . ``` -------------------------------- ### SecsS02F43 Function Call Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Provides an example of calling SecsS02F43 with a list of stream and function IDs, demonstrating the expected output format. Use this to verify your input data for resetting spooling. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F43([{"STRID": 1, "FCNID": [10, 20]}, {"STRID": 2, "FCNID": [30, 40]}]) S2F43 W > > > > > . ``` -------------------------------- ### SecsS02F47 Invocation Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates calling SecsS02F47 with a list of VID and variable names, and displays the resulting output. ```pycon >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F47([1, "VARIABLEID"]) S2F47 W > . ``` -------------------------------- ### SecsS05F15 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates how to instantiate and use the SecsS05F15 function with specific data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F15({ ... "TIMESTAMP": "161006221500", ... "EXID": "EX123", ... "DATA": { ... "ACKA": False, ... "DATA": { ... "ERRCODE": 10, ... "ERRTEXT": "Error" ... }}}) S5F15 > > > . ``` -------------------------------- ### settings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/gem/hosthandler.md Gets the settings object. ```APIDOC ## settings() -> [Settings](../common.md#secsgem.common.settings.Settings) ### Description Get the setting object. ``` -------------------------------- ### settings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/gem/handler.md Get the setting object. ```APIDOC ## settings ### Description Get the setting object. ### Returns * **Settings** - The settings object. ``` -------------------------------- ### SecsS10F01 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates how to call the SecsS10F01 function with specific parameters and shows the resulting output. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS10F01({"TID": 0, "TEXT": "hello?"}) S10F1 > . ``` -------------------------------- ### SecsS06F19 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the structure and usage of SecsS06F19 for Individual Report Request. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F19 RPTID: U1/U2/U4/U8/I1/I2/I4/I8/A ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F19(secsgem.secs.variables.U4(1337)) S6F19 W . ``` -------------------------------- ### SecsS06F02 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation of the SecsS06F02 function with an accepted status. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F02(secsgem.secs.data_items.ACKC6.ACCEPTED) S6F2 . ``` -------------------------------- ### SecsS02F44 Function Call Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates calling SecsS02F44 with specific RSPACK and DATA parameters, showing the resulting output. This example is useful for constructing valid reset spooling acknowledge messages. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F44({ ... "RSPACK": secsgem.secs.data_items.RSPACK.REJECTED, ... "DATA": [ ... {"STRID": 1, "STRACK": secsgem.secs.data_items.STRACK.NOT_ALLOWED, "FCNID": [10]}, ... {"STRID": 2, "STRACK": secsgem.secs.data_items.STRACK.FUNCTION_UNKNOWN, "FCNID": [20]}]}) S2F44 > > > > > > . ``` -------------------------------- ### Instantiate SecsS12F15 Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows how to instantiate SecsS12F15, which is Map Data Request Type 2 (MDR2). Similar to MDR1, it requires a material ID and ID type. The examples cover both the definition and a usage example. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F15 { MID: A/B[80] IDTYP: B[1] } ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F15({"MID": "materialID", "IDTYP": secsgem.secs.data_items.IDTYP.WAFER}) S12F15 W > . ``` -------------------------------- ### Instantiate SecsS12F17 Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows how to instantiate SecsS12F17, which is Map Data Request Type 3 (MDR3). It requires material ID, ID type, and SDBIN (Send Data Bit). The examples cover the structure and a usage example with SDBIN set to DONT_SEND. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F17 { MID: A/B[80] IDTYP: B[1] SDBIN: B[1] } ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F17({ ... "MID": "materialID", ... "IDTYP": secsgem.secs.data_items.IDTYP.WAFER, ... "SDBIN": secsgem.secs.data_items.SDBIN.DONT_SEND}) S12F17 W > . ``` -------------------------------- ### SecsS06F22 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the structure and instantiation of SecsS06F22 for Annotated Individual Report Data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.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 } ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS06F22([{"VID": "VID1", "V": "ASD"}, {"VID": 2, "V": 1337}]) S6F22 > > > . ``` -------------------------------- ### SecsS02F23 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates how to call the SecsS02F23 function with specific parameters and shows the resulting output. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F23({ ... "TRID":1, ... "DSPER":'000010', ... "TOTSMP":secsgem.secs.variables.U4(10), ... "REPGSZ":secsgem.secs.variables.U4(1), ... "SVID":[1002004,400210]}) S2F23 W > > . ``` -------------------------------- ### Sample Secsgem GEM Host Implementation Source: https://github.com/bparzella/secsgem/blob/main/README.md Demonstrates how to set up and run a basic SECS/GEM host using the secsgem library. Includes logging configuration and HSMS connection settings. ```python import logging import code import secsgem.common import secsgem.gem import secsgem.hsms from communication_log_file_handler import CommunicationLogFileHandler class SampleHost(secsgem.gem.GemHostHandler): def __init__(self, settings: secsgem.common.Settings): super().__init__(settings) self.MDLN = "gemhost" self.SOFTREV = "1.0.0" commLogFileHandler = CommunicationLogFileHandler("log", "h") commLogFileHandler.setFormatter(logging.Formatter("%(asctime)s: %(message)s")) logging.getLogger("communication").addHandler(commLogFileHandler) logging.getLogger("communication").propagate = False logging.basicConfig(format='%(asctime)s %(name)s.%(funcName)s: %(message)s', level=logging.DEBUG) settings = secsgem.hsms.HsmsSettings( address="127.0.0.1", port=5000, connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE, device_type=secsgem.common.DeviceType.HOST ) h = SampleHost(settings) h.enable() code.interact("host object is available as variable 'h'", local=locals()) h.disable() ``` -------------------------------- ### SecsS02F26 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS02F26 with a string to send diagnostic data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F26("Text") S2F26 . ``` -------------------------------- ### Initialize SecsITcpSettings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secsitcp.md Demonstrates how to initialize SecsITcpSettings with a device type and access its properties. Ensure the secsgem.common module is imported for DeviceType. ```python >>> import secsgem.secsitcp >>> >>> settings = secsgem.secsitcp.SecsITcpSettings(device_type=secsgem.common.DeviceType.EQUIPMENT) >>> settings.device_type Equipment >>> settings.address '127.0.0.1' ``` -------------------------------- ### SecsS05F18 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation and usage of the SecsS05F18 function with specific data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F18({ ... "EXID": "EX123", ... "DATA": { ... "ACKA": False, ... "DATA": { ... "ERRCODE": 10, ... "ERRTEXT": "Error"}}}) S5F18 > > > . ``` -------------------------------- ### Initialize Handlers with New Settings Classes Source: https://github.com/bparzella/secsgem/blob/main/docs/changes.md Demonstrates initializing handlers using new Settings classes for different protocols (HSMS, SECS-I, SECS-I over TCP). Import necessary modules and define settings objects before initializing the handler. ```python import secsgem.common import secsgem.hsms import secsgem.secsi import secsgem.secsitcp hsms_settings = secsgem.hsms.HsmsSettings( device_type=secsgem.common.DeviceType.EQUIPMENT, connect_mode=secsgem.hsms.HsmsConnectMode.ACTIVE, address="127.0.0.1", port=5001, ) secsi_settings = secsgem.secsi.SecsISettings( device_type=secsgem.common.DeviceType.HOST, port="COM1", speed=9600, ) secsi_tcp_settings = secsgem.secsitcp.SecsITcpSettings( device_type=secsgem.common.DeviceType.EQUIPMENT, connect_mode=secsgem.secsitcp.SecsITcpConnectMode.CLIENT, address="127.0.0.1", port=5555, ) # initialize handler with settings import secsgem.gem handler = secsgem.gem.GemEquipmentHandler(secsi_settings) ``` -------------------------------- ### SecsHandler Example Source: https://github.com/bparzella/secsgem/blob/main/docs/secs/handler.md Demonstrates how to set up a SecsHandler, register a callback for a specific stream and function (S1F13), and enable/disable the client. The connected event is also handled. ```python >>> def s01f13_handler(connection, packet): ... print "S1F13 received" ... >>> def on_connect(event, data): ... print "Connected" ... >>> settings = secsgem.hsms.Settings(address="127.0.0.1", port=5000, connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE, device_type=secsgem.common.DeviceType.HOST) >>> client = secsgem.secs.SecsHandler(settings) >>> client.events.connected += on_connect >>> client.register_stream_function(1, 13, s01f13_handler) >>> >>> client.enable() Connected S1F13 received >>> client.disable() ``` -------------------------------- ### Instantiate SecsS12F03 with Parameters Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Provides an example of instantiating the SecsS12F03 function with specific parameters for a Map Set-up Data Request. This shows how to populate the function with material and map information. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F03({ ... "MID": "materialID", ... "IDTYP": secsgem.secs.data_items.IDTYP.WAFER_CASSETTE, ... "MAPFT": secsgem.secs.data_items.MAPFT.ROW, ... "FNLOC": 0, ... "FFROT": 0, ... "ORLOC": secsgem.secs.data_items.ORLOC.LOWER_LEFT, ... "PRAXI": secsgem.secs.data_items.PRAXI.COLS_LEFT_INCR, ... "BCEQU": [1, 3, 5, 7], ... "NULBC": "{x}"}) S12F3 W > . ``` -------------------------------- ### Unit Test Example for SecsGem Source: https://github.com/bparzella/secsgem/blob/main/docs/firststeps/testing.md Demonstrates setting up a SecsGem host handler for testing and performing a link test request. Ensure the SecsGem server is running in passive mode on the specified address and port. ```python import unittest import secsgem.common import secsgem.gem import secsgem.hsms class TestExampleSecsGem(unittest.TestCase): def setUp(self): settings = secsgem.hsms.Settings( address="127.0.0.1", port=5000, connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE, device_type=secsgem.common.DeviceType.HOST ) self.handler = secsgem.gem.GemHostHandler.hsms(settings) self.handler.enable() self.handler.waitfor_communicating() def tearDown(self): self.handler.disable() def testLinktest(self): result_packet = self.handler.send_linktest_req() self.assertEqual(result_packet.header.s_type.value, 6) self.assertEqual(result_packet.header.device_id, 65535) ``` -------------------------------- ### SecsS02F24 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of calling SecsS02F24 with a specific TIAACK value to acknowledge a trace. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS02F24(secsgem.secs.data_items.TIAACK.SVID_EXCEEDED) S2F24 . ``` -------------------------------- ### SecsS01F18 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F18 for ON-LINE Acknowledge (ONLA). Shows how to provide the ONLACK parameter. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F18 ONLACK: B[1] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F18(secsgem.secs.data_items.ONLACK.ALREADY_ON) S1F18 . ``` -------------------------------- ### Initialize ExistingProtocolSettings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/hsms/settings.md Shows how to initialize ExistingProtocolSettings, which inherits from HsmsSettings, and access its properties. ```python >>> import secsgem.hsms >>> >>> settings = secsgem.hsms.HsmsSettings(device_type=secsgem.common.DeviceType.EQUIPMENT) >>> settings.device_type Equipment ``` -------------------------------- ### SecsS10F02 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Illustrates the usage of the SecsS10F02 function with an 'ACCEPTED' status, showing the expected output. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS10F02(secsgem.secs.data_items.ACKC10.ACCEPTED) S10F2 . ``` -------------------------------- ### SecsS05F01: Alarm Report (AR) - Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates how to instantiate and use the SecsS05F01 function with specific alarm details. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F01({ ... "ALCD": secsgem.secs.data_items.ALCD.PERSONAL_SAFETY | ... secsgem.secs.data_items.ALCD.ALARM_SET, ... "ALID": 100, ... "ALTX": "text"}) S5F1 > . ``` -------------------------------- ### SecsS10F03 Function Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates calling the SecsS10F03 function with text and a TID, and displays the resulting SECS message. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS10F03({"TID": 0, "TEXT": "hello!"}) S10F3 > . ``` -------------------------------- ### Initialize HsmsSettings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/hsms/settings.md Demonstrates how to initialize HsmsSettings with a device type and access its properties. ```python >>> import secsgem.hsms >>> >>> settings = secsgem.hsms.HsmsSettings(device_type=secsgem.common.DeviceType.EQUIPMENT) >>> settings.device_type Equipment >>> settings.address '127.0.0.1' ``` -------------------------------- ### SecsS01F16 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F16 for OFF-LINE Acknowledge (OFLA). Shows how to provide the OFLACK parameter. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F16 OFLACK: B[1] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F16(secsgem.secs.data_items.OFLACK.ACK) S1F16 . ``` -------------------------------- ### SecsS01F14 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F14 to represent a SECS message. It shows the structure of the message and how to populate it with data. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F14 { COMMACK: B[1] MDLN: [ DATA: A[20] ... ] } ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F14({"COMMACK": secsgem.secs.data_items.COMMACK.ACCEPTED, ... "MDLN": ["secsgem", "0.0.6"]}) S1F14 > > . ``` -------------------------------- ### Initialize SECS I Settings Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secsi.md Shows how to initialize SecsISettings with a serial port and access its properties. The default speed is 9600. ```python >>> import secsgem.secsi >>> >>> settings = secsgem.secsi.SecsISettings(port="COM1") >>> settings.port 'COM1' >>> settings.speed 9600 ``` -------------------------------- ### SecsS05F04: Enable/Disable Alarm Acknowledge (EAA) - Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS05F04 to acknowledge an alarm with the 'ACCEPTED' status. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F04(secsgem.secs.data_items.ACKC5.ACCEPTED) S5F4 . ``` -------------------------------- ### Initialize and Enable GemHostHandler Source: https://github.com/bparzella/secsgem/blob/main/docs/gem/handler.md Demonstrates how to initialize a GemHostHandler with specific settings and enable communication. It also shows how to wait for the 'communicating' state and interact with process programs. ```python >>> settings = secsgem.hsms.Settings(address="127.0.0.1", port=5000, connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE, device_type=secsgem.common.DeviceType.HOST) >>> client = secsgem.GemHostHandler(settings) >>> >>> 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() ``` -------------------------------- ### SecsS05F02: Alarm Report Acknowledge (ARA) - Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS05F02 to acknowledge an alarm with the 'ACCEPTED' status. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F02(secsgem.secs.data_items.ACKC5.ACCEPTED) S5F2 . ``` -------------------------------- ### Import SecsHandler and GemEquipmentHandler (Old) Source: https://github.com/bparzella/secsgem/blob/main/docs/changes.md Illustrates the old way of importing classes from the top-level secsgem namespace. ```python import secgem from secsgem import SecsHandler secsgem.GemEquipmentHandler(...) SecsHandler(...) ``` -------------------------------- ### SecsS01F22 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F22 for Data Variable Namelist (DVN). Demonstrates the structure for providing variable information. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F22 [ { VID: U1/U2/U4/U8/I1/I2/I4/I8/A DVVALNAME: A UNITS: A } ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F22([{"VID": 1, "DVVALNAME": "EC1", "UNITS": "mm"}]) S1F22 > > . ``` -------------------------------- ### HSMS Protocol Connection and Linktest Example Source: https://github.com/bparzella/secsgem/blob/main/docs/hsms/protocol.md Demonstrates connecting to an HSMS server, enabling the protocol, sending a linktest request, and then disabling the protocol. It also shows how to register a callback for the 'connected' event. ```python >>> def on_connect(event, data): ... print "Connected" ... >>> client = secsgem.hsms.HsmsProtocol("10.211.55.33", 5000, False, 0, "test") >>> client.events.connected += on_connect >>> client.enable() Connected >>> client.protocol.send_linktest_req() HsmsMessage({'header': HsmsHeader({device_id:0xffff, stream:00, function:00, p_type:0x00, s_type:0x06, system:0x75b78c48, require_response:False}), 'data': ''}) >>> client.disable() ``` -------------------------------- ### SecsS01F21 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F21 for Data Variable Namelist Request (DVNR). Shows the expected input format. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F21 [ VID: U1/U2/U4/U8/I1/I2/I4/I8/A ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F21([1, "VARIABLEID"]) S1F21 W > . ``` -------------------------------- ### Instantiate and Send SecsS05F11 Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows how to create and send a SecsS05F11 message (Exception Clear Notify) with specific parameters. This example details the expected output format. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F11({ ... "TIMESTAMP": "161006221500", ... "EXID": "EX123", ... "EXTYPE": "ALARM", ... "EXMESSAGE": "Exception"}) S5F11 > . ``` -------------------------------- ### SecsS01F24 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F24 for Collection Event Namelist (CEN). Demonstrates the structure for providing collection event information. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F24 [ { CEID: U1/U2/U4/U8/I1/I2/I4/I8/A CENAME: A VID: [ DATA: U1/U2/U4/U8/I1/I2/I4/I8/A ... ] } ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F24([{"CEID": 1, "CENAME": "CE1", "VID": [1, "VARIABLEID"]}]) S1F24 > > > . ``` -------------------------------- ### Instantiate SecsS12F04 with Parameters Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Shows an example of creating a SecsS12F04 function instance with detailed map data. This includes specifying material ID, die information, and reference points for map transmission. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F04({ ... "MID": "materialID", ... "IDTYP": secsgem.secs.data_items.IDTYP.FILM_FRAME, ... "FNLOC": 0, ... "ORLOC": secsgem.secs.data_items.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 > > . ``` -------------------------------- ### SecsS01F23 Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of using SecsS01F23 for Collection Event Namelist Request (CENR). Shows the expected input format for CEID. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F23 [ CEID: U1/U2/U4/U8/I1/I2/I4/I8/A ... ] ``` ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS01F23([1, "COLLEVTID"]) S1F23 W > . ``` -------------------------------- ### List Class Methods Source: https://github.com/bparzella/secsgem/blob/main/docs/reference.md Methods for the List class, including getting format information, setting, getting, encoding, and decoding list data. ```APIDOC ## List.get_format() ### Description Retrieves the format of the list. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## List.get_name_from_format(format_code) ### Description Gets the name corresponding to a given list format code. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters - **format_code** (int) - The format code to look up. ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## List.set(items) ### Description Sets the items within the list. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters - **items** (list) - A list of items to set. ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## List.get() ### Description Retrieves the items from the list. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## List.encode() ### Description Encodes the list data into SECS/GEM format. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## List.decode(encoded_data) ### Description Decodes SECS/GEM formatted data into a list. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters - **encoded_data** (bytes or similar) - The encoded data to decode. ### Request Example (Not applicable) ### Response (Not specified) ``` -------------------------------- ### Instantiate SecsS05F12 Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation of the SecsS05F12 function, which is used for Exception Clear Confirm. The output shows the resulting SECS message. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F12() S5F12 . ``` -------------------------------- ### SecsS05F07: List Enabled Alarms Request (LEAR) - Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of calling SecsS05F07 with no parameters to send the List Enabled Alarms Request. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F07() S5F7 W . ``` -------------------------------- ### SecsS14F01 Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Provides an example of constructing a SecsS14F01 request to retrieve attributes for a 'StripMap' object. It shows how to specify object IDs and the attributes to query. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS14F01({ ... "OBJSPEC": '', ... "OBJTYPE": 'StripMap', ... "OBJID": ['MAP001'], ... "FILTER": [], ... "ATTRID": ['OriginLocation', 'Rows', 'Columns', 'CellStatus', 'LotID']}) S14F1 W > > > . ``` -------------------------------- ### Instantiate SecsS12F05 with Parameters Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md An example of instantiating the SecsS12F05 function to inquire about map data. This demonstrates how to specify the material ID, type, and format for the inquiry. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS12F05({ ... "MID": "materialID", ... "IDTYP": secsgem.secs.data_items.IDTYP.WAFER, ... "MAPFT": secsgem.secs.data_items.MAPFT.ARRAY, ... "MLCL": 0}) S12F5 W > . ``` -------------------------------- ### SecsS05F06: List Alarms Data (LAD) - Usage Example Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Example of providing alarm data to SecsS05F06 to format and send the List Alarms Data message. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F06([ ... {"ALCD": secsgem.secs.data_items.ALCD.PERSONAL_SAFETY | ... secsgem.secs.data_items.ALCD.ALARM_SET, ... "ALID": 100, ... "ALTX": "text"}]) S5F6 > > . ``` -------------------------------- ### Instantiate SecsS05F10 Source: https://github.com/bparzella/secsgem/blob/main/docs/reference/secs/functions.md Demonstrates the instantiation of the SecsS05F10 function, which is used for Exception Post Confirm. The output shows the resulting SECS message format. ```python >>> import secsgem.secs >>> secsgem.secs.functions.SecsS05F10() S5F10 . ```