Python scripting - Introduction

Change log

 

Change log of the Python interface

 

Release 2024-2

 

Action

From / To

Subject

Comment

Added

OlpCore

OlpCore

Added the OlpCore chapter, that defines the base Python library for writing a downloader with Python.

Added

Upload

Upload

Added the Upload chapter, that defines the Python library for writing an uploader with Python.

Modified

Download

Download

Added new methods, link to base classes.

Modified

Embedded Python

Python interpreter version

Updated from 3.7.4 to 3.12.4 version

Modified

site-packages

debugpy

Debugpy library is used instead of ptvsd python debug

Added

site-packages

numpy

Numpy library is included in standard delivery package

 

 

Release 2024-1-3

 

Action

From / To

Subject

Comment

Added

IOlpEventRule

CENPyOlpEventRuleOperator

Added predefined constants TechRequestIDs used to flag TPEs in some LeadIn, LeadOut, Approach and Retract (method FindTpeByTechRequestId)




 

 

Release 2024-1

 

Action

From / To

Subject

Comment

Added

nls.py

class NLSUtility()

Added Method GetETwoNLS to get Language set in E2.

Added

arcreport.py

class ArcReportUtility(PDF)

Added a Base Class to create an ArcWelding PDF Report.

Added

CENPyOlpProgramModifyOperator

CreateMatrix

Get an initial empty CenPyOlpMatrix Object.

Added

CENPyOlpResource

GetHomePositions

Return home positions as objects of CENPyOlpHomePosition class.

Added

CENPyOlpHomePosition

GetJointAt

Returns object CENPyOlpJoint representing the joint at the desired index.

Added

CENPyOlpHomePosition

GetCount,GetName, GetPositionOf

New methods.

Added

CENPyOlpJoint

GetName,GetKinType,GetJointType,GetJointIndex

New methods.

Added

CENPyOlpContoller

GetWeldingDataSetsFromDataBase

Get defined welding data sets from weld database of the active controller.

Added

CENPyOlpEventHandler

GetAllRuleBasedEvents

GetAllNonRuleBasedEvents

Get a list of all existing rule-based or Olp events on the given toolpath element.

Added

CENPyOlpEventObject

GetOlpEventName

Get the current Event's Name.

Added

CENPyOlpEvent_EventComputeOperator

IsPythonEvent

Checks if the reference event is a C++ or python event.

 

Release 2023-2-5

 

Action

From / To

Subject

Comment

Added

CENPyOlpWM_AttribChangedOperator

GetChangedComponent

With the added methods, it is now possible to control attribute values at levels below the callback.

GetOperatorForComponent

CENPyOlpTech_AttribChangedOperator

GetChangedComponent

GetOperatorForComponent

 

Release 2023-2

 

Action

From / To

Subject

Comment

Added

CENPyOlpContoller

GetMainResourcesMaxTCPFeedrate

Gets the maximum TCP Feedrate Value of the Main Resource.

 

Added

CENPyOlpTpElement

GetTrack

GetTeachFlags

Get the track corresponding to this toolpath element.

Get the teach flags.

CENPyOlpTeachHandler

RemoveTeachFlags

Remove the teach flags.

CENPyOlpOperation

GetTracks

Get all toolpath tracks of the operation.

CENPyOlpOperationGroup

GetTracks

Get all toolpath tracks of the operation group.

CENPyOlpProgram

GetTracks

Get all toolpath tracks of the program.

CENPyOlpTrack

-

New class.

CENPyOlpProgramModifyOperator

GetInterpolationHandler

Get interpolation handler.

CENPyOlpInterpolationHandler

CreatePathInterpolation

DeletePathInterpolation

SwitchPathInterpolationType

AddPathInterpolationSupport

RemovePathInterpolationSupport

CreateSurfaceInterpolation

DeleteSurfaceInterpolation

SwitchSurfaceInterpolationType

AddSurfaceInterpolationSupport

RemoveSurfaceInterpolationSupport

IsInterpolated

IsSupport

New class.

Constants

ErrorCodes

InterpolationErrorCodes

InterpolationType

TeachFlags

New constants.

DynamicLimits

CheckJointsDynamicLimits

Dynamic limits check.

Updated

report.py

class ReportUtility(FPDF)

Extend new commands for PDF Report

Added

CENPyOlpSeamFindingOperator

GetSeamFindingPoint

GetSeamTrackingPoint

SeamFindingApproachRetractPoint

SeamFindingApproachRetractPointAlt

New class.

 

Release 2023-1-2

 

Action

From / To

Subject

Comment

Added

nls.py

class NLSUtility()

Added a Base Class to do NLS Translation.

 

Release 2023-1-2

 

Action

From / To

Subject

Comment

Added

report.py

class ReportUtility(FPDF)

Added a Base Class to create a PDF Report.

 

Release 2023-1-1

 

Action

From / To

Subject

Comment

Added

CENPyOlpBuiltInEvent

GetBuiltInEventInsertPosition

Added a Method to get BuildIn Event´s Insert Position.

Added

CENPyOlpEventObject

GetOlpEventInsertPosition

Added a Method to get OLP Event´s Insert Position.

 

Release 2023-1

 

Action

From / To

Subject

Comment

Updated

CENPyOlpTpElement

 

CENPyOlpTeachHandler

GetCollisionStatus

 

ModifyTpElement

Updated an existing function to include both cost evaluation and simulation results.

Add a return value to the function.

Added

CENPyOlpTpElement

GetSimulationCollisionStatus

GetTurnUserString

Get the simulation collision status.

Get the turn user string of the underlying toolpath element.

 

Release 2022-3-2

 

Action

From / To

Subject

Comment

Added

CENPyOlpEvent_EventComputeOperator

ExecuteBrushEventCompute

ExecuteGunEventCompute

Additional overloads with optional trigger parameters.

 

Release 2022-3-1

 

Action

From / To

Subject

Comment

Updated

PostTechOnFrameChanged

PostWmOnFrameChanged

CENPyOlpFrameChangedOperator

Add a return value to PostTechOnFrameChanged and PostWmOnFrameChanged callbacks.

 

Added

CENPyOlpController

GetControllerType

GetSeries

GetModel

GetActiveToolFrameName

GetActiveToolResourceName

GetLastGeneratedFilePathsFromDownload

GetLastSelectedFilePathsFromUpload

DownloadProgramByName

New functions.

cenpylib

FileUtility

The paths to the Cenit and E2 logos are available in cenpylib.

CENPyOlpWM_SyncPgAttribOperator

GetController

Get parent controller.

CENPyOlpEvent_PEOperator

GetController

Get parent controller.

CENPyOlpEvent_EventComputeOperator

GetCurrentToolResourceName

Get the name of the current tool.

CENPyOlpOperationGroup

SetName

Set the operation group name.

CENPyOlpOperation

SetName

Set the operation name.

Constants

DownloadErrorCodes

ControllerType

ColumnType

New constants.

CENPyOlpAttributeTable

Whole topic

Table attribute for controller profiles and operator especially for import/export of table.

CENPyOlpAttributeTableOperator

Whole topic

CENPyOlpAttribGetter

GetAttributeTableByName

GetScopeSortedTableRows

New functions.

CENPyOlpEvent_EventComputeOperator

ExecuteBrushEventCompute

ExecuteGunEventCompute

New functions to easily implement events that set brushes for guns and events that turn guns on or off.

 

Release 2022-3

 

Action

From / To

Subject

Comment

 

 

 

Added

Python Code Style Guide

Style Guide for Python Code

General CENIT style recommendations

General guidelines for CENIT code style.

Python libraries

cenpylib

Python package, developed by CENIT AG, contains IntelliSense and all the utilities implemented for easy scripting.

Visual Studio Code configurations

Recommended VS Code extensions

IntelliSense settings

Recommended Visual Studio Code configurations.

AuxiliaryCommandsCallbacks

ProgramProcessGeometries callback

ProcessGeometry auxiliary command entries

First implementation of the ProgramProcessGeometries auxiliary commands.

CENPyOlpProgramProcessGeometryOperator

GetLoggerOperator

GetCsvParserOperator

GetController

GetActiveProgram

GetSelectedProcessGeometries

GetStartStateNames

New operator with its functions.

CENPyOlpProcessGeometryOperator

GetContourLength

Get the curve length of the contour process geometry.

CENPyOlpTech_RecipeOperator

GetSelectedProcessGeometries

Replaces the GetActiveProcessGeometries function.

CENPyOlpProgram

ProgramProcessGeometries

IsMain

Function to program selected process geometries.

Get if the program has the "main" flag or is a subprogram.

CENPyOlpOperationGroup

GetParentProgramName

Get the name of the parent program.

CENPyOlpTpElement

SetName

Set the new name of the toolpath element.

CENPyOlpController

CreateProgram

GetAttributeByName

GetAttributeIntegerByName

GetAttributeFloatByName

GetAttributeStringByName

GetAttributeBoolByName

GetOutputDirectory

Functions to create a new controller program.

 

Functions to get user-defined attribute objects by the given name and an output directory path.

AutoExecute auxiliary command entries

PostProgramDownload

PostProgramDownloadOnsite

PostProgramUpload

PostProgramUploadOnsite

PrevProgramDownloadOnsite

PrevProgramUpload

PrevProgramUploadOnsite

New AutoExecute auxiliary script entries.

CENPyOlpTech_RuleInitOperator

OverrideEventRuleInsertPosition

New functions to override the default insert position for an event rule.

CENPyOlpTech_RuleUpdateOperator

OverrideEventRuleInsertPosition

CENPyOlpWM_RuleInitOperator

OverrideEventRuleInsertPosition

CENPyOlpWM_RuleUpdateOperator

OverrideEventRuleInsertPosition

 

Release 2022-2-4

 

Action

From / To

Subject

Comment

Added

CENPyOlpEvent_PEOperator

IsEventCreatedAutomatically

Get if the reference event was created by a rule, another event, or inserted manually.

CENPyOlpEvent_EventComputeOperator

IsEventCreatedAutomatically

CENPyOlpEvent_AttribChangedOperator

IsEventCreatedAutomatically

 

Release 2022-2-3

 

 

Release 2022-2-1

 

Action

From / To

Subject

Comment

Added

CENPyOlpWM_SyncPgAttribOperator

GetCurrentToolFrameIndex

GetCurrentBaseFrameIndex

GetCurrentToolFrameMatrix

GetCurrentBaseFrameMatrix

Methods return the current tool and base frames of the parent operation.

 

Release 2022-2

 

Action

From / To

Subject

Comment

Added

Python libraries

fpdf2

Added fpdf package for PDF document generation.

 

Release 2022-1

 

Action

From / To

Subject

Comment

 

 

 

 

Added

AutoExecute auxiliary command entries

PostProgramProcessGeometries

PrevProgramDownload

The first implementation of the AutoExecute auxiliary script entries.

AuxiliaryCommandsCallbacks

ModifyActiveProgram callback

OlpProgram auxiliary command entries

First implementation of the ModifyActiveProgram auxiliary commands.

CENPyOlpProgramModifyOperator

GetAttribGetter

GetAttribSetter

GetLoggerOperator

GetController

GetCsvParserOperator

GetActiveProgram

GetComputeHandler

GetTeachHandler

GetEventHandler

GetProgramTpElementsByName

This operator is called withing the scope of the ModifyActiveProgram callback.

CENPyOlpPosition

X

Y

Z

RX

RY

RZ

GetCoordinates

SetCoordinates

GetViaPointCoordinates

SetViaPointCoordinates

GetOrientation

SetOrientation

GetRefTpElement

SetRefTpElement

GetPositionRelation

SetPositionRelation

GetMatrix

GetViaPointMatrix

TranslatePosition

TranslateViaPointPosition

RotatePosition

GetViaPointName

GetJointValues

SetJointValues

GetExternalJointValues

SetExternalJointValues

Handles all modifications and translations of a toolpath element using simplified functions and working with Cartesian coordinates.

CENPyOlpProgram

GetName

GetAttribGetter

GetAttribSetter

GetOperationGroups

GetlOperations

GetLastCreatedOperations

GetTpElements

GetTpElementsWithEvent

Provides access to the program level.

CENPyOlpComputeHandler

EnableAutoRecompute

DisableAutoRecompute

TriggerRecompute

It is available only in ModifyActiveProgram callback.

CENPyOlpTeachHandler

GetTpElementPosition

ModifyTpElement

InsertNewTpElement

RemoveTpElement

Applies all modifications of the CENPyOlpPosition to the toolpath element.

CENPyOlpEventHandler

GetEventsByName

GetRuleBasedEventsByName

GetBuiltInEventsByType

AddEventByName

AddBuiltInEventByType

RemoveEvent

RemoveBuiltInEvent

Handles all event modifications.

CENPyOlpTpElement

GetName

GetProcessType

GetMotionType

New methods to get the toolpath element information.

CENPyOlpOperationGroup

GetName

OverrideAttribute

GetOperations

GetTpElements

GetTpElementsWithEvent

New methods to access operation group data.

CENPyOlpOperation

GetName

OverrideAttribute

GetProcessGeometryIdentifier

GetTpElements

GetTpElementsWithEvent

New methods to access operation data.

CENPyOlpController

GetProgramNames

GetLogicPortByName

New methods to get the program names and logic ports.

CENPyOlpResource

GetAttributeByName

GetValueOfIntegerAttributeByName

GetValueOfFloatAttributeByName

GetValueOfStringAttributeByName

GetValueOfBoolAttributeByName

New methods to get the resource attributes or directly the values of the resource attributes.

Constants

BuiltInEventTypes

ReComputeEnterStates

ComputeStateMatrix

AttribOverrideMode

MotionType

PosRelation

TpProcessType

New types have been added and old ones have been expanded.

Python libraries

tkinter

Added tkinter GUI package

CENPyOlpEvent_EventComputeOperator

GetTouchSensingOperator

Get touch sensing operator.

CENPyOlpTouchSensingOperator

Whole topic

New Touch Sensing operator.

 

Release 2021-6

 

Action

From / To

Subject

Comment

Added

PostTechOnFrameChanged

PostWmOnFrameChanged

CENPyOlpFrameChangedOperator

The callback PostTechOnFrameChanged and PostWmOnFrameChanged is called from kernel when the tool or base frame was changed at the operation level.

CENPyOlpBuiltInEvent

SetOutputTarget

GetOutputTarget

Methods to set/get target output for event.

CENPyOlpTech_UpdateOperator

GetAttribGetter

GetAttribSetter

GetAttribCreator

GetLoggerOperator

GetController

GetOlpProgram

RemoveAttribute

SetAttribOwner

GetTechEventRuleUpdateOperator

GetWmEventRuleUpdateOperator

GetCycleExplodeStatus

GetLastSavedPythonTechnologyVersion

Methods to get/set/create/remove attributes, to get program components, controller, logger operator, cycle explode status, last saved python technology version, to set owner of attribute, to update

CENPyOlpProgramComponent

GetType

GetParentComponent

GetChildComponents

GetCreatorName

Methods to get rule and active event names, add a new event or set an active event for the current event rule.

CENPyOlpTech_RuleUpdateOperator

AddEvent

GetRuleName

GetActiveEventName

SetActiveEvent

Methods to get rule and active event names, add a new event or set an active event for the current event rule.

CENPyOlpWM_RuleUpdateOperator

AddEvent

GetRuleName

GetActiveEventName

SetActiveEvent

Methods to get rule name and to add an event.

PostTechUpdate

CENPyOlpTech_UpdateOperator

The callback to update of program if the technology script was changed and the technology script version was increased.

CENPyOlpAttribCreator

AddInteger

AddInteger() replaces the old AddInt() method. AddInt() is still supported.

Updated

CENPyOlpCsvParserOperator

LoadCsvFile

Updated example of how to get the path to CSV file from TechTabs folder.

Debugging Python with Visual Studio Code

Debugging steps

Review the necessary debugging steps.

Added

CENPyOlpController

IsTeamController

GetTeamController

GetControllers

Add access to the Team controller and its resources.

CENPyOlpTpElement

GetMatrixToActiveBaseFrame

GetMatrixToBaseFrame

GetGlobalTransformedMatrix

GetGlobalTransformedMatrixUnaligned

GetInitialPathMatrixTranslatedInBaseFrame

Methods to get a matrix of the current toolpath element.

Updated

CENPyOlpMatrix

GetRotation

Existing method changed: return rotation angles in radians by default and in degrees if input parameter (True) is specified.

 

 

Release 2021-5

 

Action

From / To

Subject

Comment

Added

CENPyOlpController

GetActiveToolFrameIndex()

GetActiveBaseFrameIndex()

GetActiveToolFrameMatrix()

GetActiveBaseFrameMatrix()

Methods return the active base frame defined in the unit setup.

CENPyOlpEvent_PEOperator

CENPyOlpEvent_PEOperatorUpload

CENPyOlpEvent_EventComputeOperator

GetCurrentToolFrameIndex()

GetCurrentBaseFrameIndex()

GetCurrentToolFrameMatrix()

GetCurrentBaseFrameMatrix()

Methods return the current base frame for a specific toolpath element, defined on the operation level.

CENPyOlpMatrix

IsValid()

Method that checks whether a matrix is valid or just a null object.

AttribOverrideMode

CENPyOlpAttribSetter

CENPyOlpSystemAttribSetter

AttribSetter operator was extended with the new AttribOverrideMode parameter, thereby all methods in CENPyOlpAttribSetter and CENPyOlpSystemAttribSetter were updated too.

 

 

Release 2021-4

 

Action

From / To

Subject

Comment

Added

CENPyOlpWaitForResourcePortEvent

AddResourcePortInt16

AddResourcePortByte

New Byte and Int16 resource port events in the CENPyOlpResourcePortEvent class

CENPyOlpSetResourcePortEvent

AddResourcePortInt16

AddResourcePortByte

 

 

Release 2021-3


Action

From / To

Subject

Comment

Added

CENPyOlpTech_AttribChangedOperator

CENPyOlpWM_AttribChangedOperator

CENPyOlpSeries_AttribChangedOperator

CENPyOlpEvent_AttribChangedOperator

GetChangedAttributeName()

Method to get the name of changed attribute, which triggered "*OnAttribChanged" callback

Deprecated

CENPyOlpTech_AttribChangedOperator

CENPyOlpWM_AttribChangedOperator

CENPyOlpSeries_AttribChangedOperator

GetChangedAttribute()

Please use GetChangedAttributeName() instead


 

Release 2021-2


Action

From / To

Subject

Comment

Added

CENPyOlpSystemAttribSetter

SetProcessFlowDirection

Enabled the SetProcessFlowDirection method for python API


 

Release 2020-5


Action

From / To

Subject

Comment

Added

OlpEvent

isEnabled

Specifies if the event should be shown in the event panel.

 


Release 2020-4

 

Action

From / To

Subject

Comment

Added

OlpEvent

CENPyOlpEvent_PEOperatorUpload

see PostProcessAttributesUpload



Release 2020-2

 

Action

From / To

Subject

Comment

Added

 

IOlpSeries callbacks

GetRegShapeStyle

+ Added support for ControllerPackage folder structure

CENPyOlpAccelerationEvent

SetUnit(unit: ATTRIBUTE_TYPE)

merged to SP 2019.5.3

IOlpEvent

CENPyOlpEvent_EventComputeOperator

Added method SetTechnologyRequestId

IOlpEventRule

CENPyOlpEventRuleOperator

Added method FindTpeByTechRequestId



Release 2019-6.0


Action

From / To

Subject

Comment

Added

E2

ptvsd 4.3.0

Debug with vsCode / vs2017 / vs2019

IOlpSeries

CENPyOlpSeries_AttribInitOperator

see PostSeriesInitAttributes

CENPyOlpSeries_EventInitOperator

see PostSeriesInitEvents

CENPyOlpSeries_AttribChangedOperator

see PostSeriesOnAttribChanged

CENPyOlpAttribute

IsValid() : bool

new method added to check if attribute exists in OLP

Deprecated

E2

ptvsd_v2.2.6 

Debug with vs2015 (still possible, but the library \Lib\site-packages\ptvsd should be downgraded manually)

 


Release 2019-5.0


Action

From / To

Subject

Comment

Added

Objects

CENPyOlpResource

Resource now accessible, can be used to retrieve Ports

CENPyOlpPort

Ports used to send signals during simulation

CENPyOlpSetResourcePortEvent

New event to work with Resource Ports

CENPyOlpWaitForResourcePortEvent

New event to work with Resource Ports

CENPyOlpEventOperator

AddSetResourcePortEvent()

Method to create new event

AddWaitForResourcePortEvent()

Method to create new event

CENPyOlpController

GetResources()

Method to retrieve controlled resources from the controller



Release 2018-2.0


Action

From / To

Subject

Comment

Added

IOlpEventCallbacks

GetCycleRotationAutoFlag

If not specified will call internally GetCycleRotationFlag()

GetCycleRotationManualFlag

If not specified will call internally GetCycleRotationAutoFlag()

GetCycleTranslationAutoFlag

If not specified will call internally GetCycleTranslationFlag()

GetCycleTranslationManualFlag

If not specified will call internally GetCycleTranslationAutoFlag()

Deprecated

IOlpEventCallbacks

GetCycleRotationFlag

Replaced with GetCycleRotationAutoFlag()

GetCycleTranslationFlag

Replaced with GetCycleTranslationAutoFlag()

centypes.py

from centypes import *

No need to call "from centypes import *" from customization script anumore. It is done internally.

Fixed

Customization script files

Python callback execution from wrong script

https://dfstrac.de.cenit-group.com/CENSEM207/ticket/9100


 

Release 2018-1.4


Action

From / To

Subject

Comment

Added

IOlpEvent

GetCycleReferenceBehavior

def GetCycleReferenceBehavior():

   return  CYCLEREFBEHAVIOR_NORMAL



Release 2018-1.3 (05.07.2018)


Action

From / To

Subject

Comment

Added

CENPyOlpEvent_EventComputeOperator

GetEventOperator

See. CENPyOlpEventOperator

IOlpEventRule

PostExecute


Constants

ReComputeEnterStates


Constants

TPINSERTPOS_INHERIT

See. TPINSERTPOSITION

CENPyOlpTech_MfGeoInitOperator

GetCurrentProcessGeometryOperator

See. CENPyOlpProcessGeometryOperator

PostWmSyncPgAttributes

CENPyOlpWM_SyncPgAttribOperator


CENPyOlpTech_AttribInitOperator

GetCsvParserOperator

See. CENPyOlpCsvParserOperator

CENPyOlpWM_POAttribOperator

GetGeometryOperator

See. CENPyOlpWM_GeometryOperator

file: WorkMethod.py

PostProcessOperationAttributes

See. CENPyOlpWM_POAttribOperator

file: WorkMethod.py

PostProcessOperationGroupAttributes

See. CENPyOlpTech_POGAttribOperator


CENPyOlpSetBoolSignalEvent

See. CENPyOlpEventOperator

 


CENPyOlpSetFloatSignalEvent


CENPyOlpSetIntSignalEvent


CENPyOlpWaitForBoolSignalEvent


CENPyOlpWaitForFloatSignalEvent


CENPyOlpWaitForIntSignalEvent


CENPyOlpWaitForBoolSensorEvent


CENPyOlpBoolActorEvent


CENPyOlpFloatArrayActorEvent


CENPyOlpAccelerationEvent

PostTechOnAttribChanged

CENPyOlpTech_AttribChangedOperator


PostWmOnAttribChanged

CENPyOlpWm_AttribChangedOperator


CENPyOlpEventOperator

AddAccelerationEvent


Removed

CENPyOlpEvent_EventComputeOperator

AddEvent

Moved to CENPyOlpEventOperator

See. eventComputeOperator.GetEventOperator()

AddActorEvent

AddSensorEvent

AddSetSignalEvent

AddWaitForSignalEvent

AddSpeed

AddToolEvent

AddAccuracyEvent

AddDwellEvent

CENPyEnums

CENPyEnums

All  “from CENPyEnums import *” has to be removed. ReComputeEnterStates constants should be used from now.

 

attrib.SetReComputeEnterState(ENTERSTATE_COMPLETE

 



Deprecated, still supported. 



Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante