Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gem300_scripts [2024/02/01 14:25] wikiadmin |
gem300_scripts [2024/09/19 14:54] (current) wikiadmin |
||
---|---|---|---|
Line 173: | Line 173: | ||
} | } | ||
</ | </ | ||
- | | + | ==== E40 Python Example ==== |
+ | <code python> | ||
+ | # | ||
+ | import jpype | ||
+ | from jpype import JProxy, JArray, JInt | ||
+ | import jpype.imports | ||
+ | from jpype.types import * | ||
+ | |||
+ | jpype.startJVM(classpath=[' | ||
+ | |||
+ | # Importing the necessary Java classes | ||
+ | from com.ergotech.secs.e39 import E39MessageHandler | ||
+ | from com.ergotech.secs.e40 import E40MessageHandler, | ||
+ | from com.ergotech.transsecs.secs import TransSecsController | ||
+ | from java.lang import Thread | ||
+ | |||
+ | # Create the callback interface using a proxy | ||
+ | class E40CallbackImplementation(E40CallbackInterface): | ||
+ | def prStateChange(self, | ||
+ | print(f" | ||
+ | # Send the new state for the process job to the PLC | ||
+ | # / | ||
+ | # / | ||
+ | |||
+ | def prJobCreate(self, | ||
+ | print(f" | ||
+ | # Indicate that this job is not allocated | ||
+ | # / | ||
+ | # Record the id | ||
+ | # / | ||
+ | |||
+ | def prSetRecipeVariable(self, | ||
+ | if recVarList is not None: | ||
+ | for counter in range(recVarList.size()): | ||
+ | print(f" | ||
+ | |||
+ | def prSetMtrlOrder(self, | ||
+ | # Set the order in which process jobs should be processed | ||
+ | pass | ||
+ | |||
+ | def prCommandCallback(self, | ||
+ | print(f" | ||
+ | cmds = [' | ||
+ | # First indicate which process job the command is being executed on | ||
+ | # / | ||
+ | |||
+ | if prCmdParameterList is not None: | ||
+ | for counter in range(prCmdParameterList.size()): | ||
+ | print(f" | ||
+ | |||
+ | # Get the index of the command | ||
+ | cmdId = cmds.index(prCmd) | ||
+ | # / | ||
+ | |||
+ | # Instantiate the callback | ||
+ | E40Callback = E40CallbackImplementation() | ||
+ | |||
+ | # Main Python code | ||
+ | print(" | ||
+ | |||
+ | controller = None | ||
+ | while controller is None: | ||
+ | Thread.sleep(50) | ||
+ | controller = TransSecsController.findController(" | ||
+ | |||
+ | try: | ||
+ | E39MessageHandler.addMessageHandler(controller.getControllerName()) | ||
+ | E40MessageHandler.addMessageHandler() | ||
+ | except Exception as e: | ||
+ | print(e) | ||
+ | |||
+ | # Register the callback | ||
+ | E40ServiceWrapper.getInstance().registerCallback(E40Callback) | ||
+ | |||
+ | print(" | ||
+ | |||
+ | </ | ||
==== E94 ==== | ==== E94 ==== | ||
Line 180: | Line 256: | ||
=== E94 Service Wrapper === | === E94 Service Wrapper === | ||
- | The E94 Service Wrapper provides access to control the flow of E94, however there are not actions required by the tool controller to manage a control job. | + | The E94 Service Wrapper provides access to control the flow of E94, however there are no actions required by the tool controller to manage a control job. |
=== E94 Callback Interface === | === E94 Callback Interface === |