PLCNEXT#Let’ use Python with the SECS/GEM library and Test with Ignition!

In this article, we will install Ignition on a PC and also install the SECS/GEM module inside. Next, we will use Python and the secsgem library in Phoenix Contact’s AXCF2152 to

SECS/GEM communication (both HOST and Equipment).

Let’s enjoy FA.

Reference Link

Opto22#Let’s use Ignition edge

SECS/GEM?

SECS/GEM (SEMI Equipment Communication Standard/Generic Equipment Model) is a communication standard used in semiconductor manufacturing to facilitate data exchange and equipment control between manufacturing equipment (etch systems, exposure systems, metrology systems, etc.) and host computers that manage manufacturing operations. 

It is a communication standard used to facilitate data exchange and equipment control between manufacturing equipment (etch systems, exposure systems, metrology systems, etc.) and host computers that manage manufacturing operations in semiconductor manufacturing. This standard is defined by Semiconductor Equipment and Materials International (SEMI) and is widely used in the semiconductor industry.

SECS-I (SEMI Equipment Communication Standard 1, SEMI E4):

Protocol for serial communication between a device and a host system. Suitable for environments where RS-232 or RS-422 is used for data transmission and high-speed data exchange is not critical.

HSMS(High-Speed SECS Message Services、SEMI E37):

A protocol designed for high-speed communication over TCP/IP networks. This protocol is often used in modern manufacturing sites where rapid and reliable data exchange is essential.

GEM (Generic Equipment Model)

The GEM complements the SECS by defining a set of standard functions for equipment communication and control. the GEM provides the following standardized interfaces

Equipment State Management

Monitor and manage equipment operating status (initialization, ready, in operation, errors, etc.).

Terminal Services

Enables remote command execution of equipment.

Data Collection

Define mechanisms for collecting and reporting data on equipment and processes, including trace data and event reports.

Alarm Management

Standardize how devices report alarms and how these are managed by the host.

Recipe Management:

Standardize the download and upload of recipes (process instructions).

Remote Control

Allows the host to start, stop, or change the operation of the equipment.

Implementation1‐Install Ignition

Initially, you will install Ignition on your own PC. The software itself is paid for if you want to actually operate it, but the DEMO mode allows you to run it for 2 hours all the time.

Once Ignition has been running for two hours, the Runtime stops and you must click on the Reset Trial button.

Then Ignition will return to Full operating mode for another 2 hours.

Download the installation File

Download the Ignition installation file from the link below.

https://inductiveautomation.com/downloads/

Click on “Download Ignition.”

Click Download for Windows.

After entering simple personal information, you can download the Installation File.

Done!

Install Ignition

Launch the Ignition Setup File that you downloaded earlier and install Ignition.

Proceed with Next.

Please wait a moment…

Done!

Ignition is running, please wait a moment…

Start Ignition!

Done!The Browser will automatically launch and select the Ignition installation version.

Ignition will be used in this article.

Accept the license and proceed with Next.

Create a User account and proceed with Next.

Please wait a moment…

Done!

Download SECS/GEM Module

I would like to try SECS/GEM Protocol for this article, but of course I do not have semiconductor manufacturing equipment. However, by using Ignition’s SECS/GEM module, I can take advantage of SECS/GEM’s equipment simulator and other functions.

Download the SECS/GEM module from the Link below.

https://inductiveautomation.com/downloads/ignition/8.1.42

Done!

Install Module

Click Config>Modules to install the SECS/GEM module downloaded earlier.

Click Install or Upgrade a Module.

Select the SECS/GEM module you have just downloaded in Browse and click Install.

Please agree to the license.

Install the SECS/GEM module.

Done!

The SECS/GEM module is now installed in Ignition.

Configure Database Connection

Click CONNECTIONS>Databases to set up Ignition’s database.

This is Ignition’s database connection screen.

Click the Configuration button to configure the database connection settings.

Click Create new Database Connection.

The DB type for the connection should be SQLITE and the Connection URL should be the Path where you want the DB to be stored.

Implementation2‐Start up a Host in PLCNEXT

After completing the setup of Ignition’s SECS/GEM module, the next step is to install the SECS/GEM Python library on the PLCNEXT side. But first, I would like to talk a little more about SECS/GEM.

The SECS/GEM (SEMI Equipment Communications Standard/Generic Equipment Model) module enables the Ignition project and third-party applications to communicate with semiconductor manufacturing equipment. This module is an implementation of the GEM standard (SEMI E30-0307), the SECS-II standard (SEMI E5-0712), and the HSMS standard (SEMI E37-0308).

As the title suggests, Implementation 2 will launch the SECS/GEM Host on PLCNEXT. Communication with the device is done in the message format defined in the SECS-II standard and referred to as SECS messages or simply messages. A simple definition file can be used to support any SECS message (including custom ones).

Once the module is installed, a new header is provided in the Config section of the gateway web page to configure the connection to the equipment and the simulator to be used for testing.

The SECS/GEM module has the ability to create and configure an equipment simulator. Simulators are not a complete implementation of the GEM standard. Equipment connections can be made to the simulator and various messages can be exchanged. The simulator supports a variety of SECS messages. This functionality exists to get started with the SECS/GEM module and to test the application.

Ignition Side

To create a SECS/GEM simulator (Equipment) on the Ignition side, let’s select Simulator from the Search Bar.

This is the screen for creating a simulator.

Click on “Create new Simulator” to create a new simulator.

Let’s configure the simulator for your application. We will explain the configuration items along with Python Script later.

Done!A simulator has been created.

PLCNEXT Side

Since the AXCF2152 will be used in this article, a small amount of preparation is required.

Firmware Update

Please refer to the following article for Firmware updates for PLCNEXT.

PLCNEXT#Firmware update

Install pip

Since we will be using a Python library, please install pip on AXCF2152 using the following article.

PLCNEXT#Install pip

Install Library

The library we will be using is called secsgem, and the link below is the Github for the library.

https://github.com/bparzella/secsgem

Please install secsgem with this command.

$ pip install secsgem

Script

Here is the program.

def s01f13_handler(connection, packet):
        print(“S1F13 got..”)

def on_connect(event):
        print(“Connected..”)
        s01f01 = secsgem.SecsS01F01()
        data=client.send_and_waitfor_response(s01f01)
        print(data.data)

        s01f03 = secsgem.SecsS01F03()
        #Clock SVID=1
        s01f03.append(secsgem.secs.variables.SecsVarU4(1))

        #ControlState SVID=2
        s01f03.append(secsgem.secs.variables.SecsVarU4(2))

        data=client.send_and_waitfor_response(s01f03)
        print(data.data)



import secsgem
import time

IPADDRESS=”192.168.13.72″
PORT=5002

client = secsgem.SecsHandler(“192.168.13.72”, 5002, True, 0, “test”)
client.register_stream_function(1, 13, s01f13_handler)
client.events.hsms_connected += on_connect

client.enable()
print(client.enable)

time.sleep(5)

client.disable()

IPADDRESS/PORT

Since the Passive IP address was set earlier in Simulator with Localhost, the IP address of Script should be set to match the IP address of the PC installed in Ignition.

The PORT should also match the Passive Port setting.

IPADDRESS=”192.168.13.72″
PORT=5002

SecsHandler

Create a SecsHandler here and set the parameters according to the IP address and Port of the Simulator.

client = secsgem.SecsHandler(“192.168.13.72”, 5002, True, 0, “test”)

The third True/False parameter sets whether the connection is Active or Passive.

  • True=Active
  • False=Passive

Since the Simulator side was set to Passive mode, the AXCF2152 Python Script side must of course be set to Active mode.

register_stream_function

This is to register a function to be executed when new information is received from S01F13. In the sample code below, we registered a function called s01f13_handler.

client.register_stream_function(1, 13, s01f13_handler)

The s01f13_handler function is defined at the beginning of the script, and in this article, it only prints a simple string, but in the actual application, it does logging and works with other systems.

def s01f13_handler(connection, packet):
        print(“S1F13 got..”)

hsms_connected

This one picks up the event of a successful connection between HOST and Equipment and executes the on_connect function.

client.events.hsms_connected += on_connect

Its on_connect function is defined at the beginning of the Script and executes S01F01 and S01F03 inside.

def on_connect(event):
        print(“Connected..”)
        s01f01 = secsgem.SecsS01F01()
        data=client.send_and_waitfor_response(s01f01)
        print(data.data)

        s01f03 = secsgem.SecsS01F03()
        #Clock SVID=1
        s01f03.append(secsgem.secs.variables.SecsVarU4(1))

        #ControlState SVID=2
        s01f03.append(secsgem.secs.variables.SecsVarU4(2))

        data=client.send_and_waitfor_response(s01f03)
        print(data.data)

client.enable()

This script connects to Equipment.

print(client.enable)

client.disable()

Disconnect Equipment with this Script.

client.disable()

Result

Done!I was able to communicate with the Host launched from Python on AXCF2152 and the Simulator created with Ignition.

Default Messages

Also, Ignition’s Simulator can handle this Message.

  • S1F1 – Are You Online
  • S1F3 – Selected Equipment Status Request
  • S1F11 – Status Variable Namelist Request
  • S1F13 – Establish Communications Request
  • S1F15 – Request OFF-LINE
  • S1F17 – Request ON-LINE
  • S2F13 – Equipment Constant Request
  • S2F15 – New Equipment Constant Send
  • S2F17 – Data and Time Request
  • S2F23 – Trace Initialize Send
  • S2F29 – Equipment Constant Namelist Request
  • S2F31 – Date and Time Set Request
  • S2F33 – Define Report

Implementation3‐Start up a Equipment in PLCNEXT

In Implementation 3, SECS/GEM Equipment is launched on PLCNEXT and connected from the Ignition side.

That connection is used by the ignition to communicate with the dedicated equipment in the semiconductor plant. The equipment connection is configured in the configuration section of the gateway web page. The connection can be made via Ethernet using TCP/IP (HSMS protocol) or via a direct serial connection using an RS-232 cable (SECS-I protocol).

This database stores messages sent and received for auditing purposes and holds some configuration data. Each equipment connection connects to one tool and one database and transfers SECS messages between the gateway and the tool. As long as the license allows, the gateway can be configured with any number of equipment connections, and different equipment connections can be configured to use the same database connection or different database connections.

The SECS/GEM host module is implemented as a host that can talk to one or more tools via an equipment connection set up in the gateway. Although it has built-in simulation capabilities to assist with initial setup, the module functions only as a host and cannot respond as if it were an instrument.

Ignition Side

To launch HOST on the Ignition side, click SECS/GEM>Equipment.

This is Ignition’s SECS/GEM Equipment setup screen.

Add new Equipment with “Create new Equipment Connection”.

Let’s set up the Equipment to be connected to the application. We will explain the configuration items along with Python Script later.

For Database Connection, set the Connection you just created.

Save your settings with Save Changes.

PLCNEXT Side

Script

Here is the program.

import secsgem.gem
import code

class SampleEquipment(secsgem.gem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.gem.GemEquipmentHandler.__init__(self, address, port, active, session_id, name, custom_connection_handl>
        self.MDLN = “gemhost”
        self.SOFTREV = “1.0.1”

        self.sv1 = 123
        self.sv2 = “sample sv”

h = SampleEquipment(“127.0.0.1”, 5002, False, 0, “plcnext2152”)
h.enable()

code.interact(“equipment object is available as variable ‘h’, press ctrl-d to stop”, local=locals())

h.disable()

class SampleEquipment

This one creates a SampleEquipment to Extend from GemEquipmentHandler.

class SampleEquipment(secsgem.gem.GemEquipmentHandler):
    def __init__(self, address, port, active, session_id, name, custom_connection_handler=None):
        secsgem.gem.GemEquipmentHandler.__init__(self, address, port, ™active, session_id, name, custom_connection_handl>
        self.MDLN = “gemhost”
        self.SOFTREV = “1.0.1”

        self.sv1 = 123
        self.sv2 = “sample sv”

Setup Connection

Call Equipment Object; leave the IP address as PLCNEXT Localhost and set the Port to match Ignition; to pass the False parameter, set it as Equirment on the AXCF2152 side, so PASSIVE Use it as.

h = SampleEquipment(“127.0.0.1”, 5002, False, 0, “plcnext2152”)

On the Ignition side, the Active IP Address setting is the IP address of AXCF2152.

And Connection Mode is ACTIVE.

h.enable()

Use this program to launch Equipment Connection.

h.enable()

Result

Done!I was able to connect to AXCF2152 from Ignition. using DB Browser, I opened the SQLite DB and the communication of S1F13 and S1F14 was also recorded.

From the SECS-II standard:

“SECS-II defines how information is communicated between devices and hosts in the form of messages. These messages are organized into categories of activities called streams and contain specific messages called functions.

Each SECS message specifies a stream and a function. A particular SECS message is often referred to in the following form: S(number)F(number). For example, S1F13 refers to SECS message stream 1, function 13.

There are also two types of messages:

Request: Sometimes called the primary message. It originates from the host, which in the context of Ignition is the Ignition Gateway. Requests are odd-numbered functions such as S1F1.

Responses: Sometimes known as secondary messages. These originate from the device. Responses are even-numbered functions such as S1F2. Thus, the host may send an S1F1 request. In that case, the device responds with an S1F2 response, indicating that the device is online. Each request can have only one response message. This Request-and-Response pattern is the basis of the module and the standard.

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

  • このエントリーをはてなブックマークに追加

フォローする