Returns the controller name.
[Example]
name = olpController.GetName()
Returns the controller type as unsigned integer.
[Example]
type = olpController.GetControllerType()
•
|
GetManufacturer(): string
|
|
|
the controller manufacturer
|
Returns the controller manufacturer.
[Example]
manufacturer = olpController.GetManufacturer()
Returns the controller series.
[Example]
series = olpController.GetSeries()
Returns the controller model.
[Example]
model = olpController.GetModel()
|
|
Specifies the item types to be returned
|
|
|
Specifies the item sub type to be returned
|
|
|
Specifies the actor type to be returned
|
|
|
list of CENPyOlpActor objects. Output of all specified actors in this controller
|
Returns the attached actors of specified type.
[Example]
controller = eco.GetController()
actors = controller.GetActors(FSITEMTYPE_PRODUCTION, ITEM_MACHINE_ROBOT, FSACTOR_NONE)
actorsCount = len(actors)
for i in range(0, actorsCount):
actor = actors[i]
actorName = actor.GetName()
actorResourceName = actor.GetResourceName()
logOperator.LogDebug('actor[' + str(i) +'] actorName = '+ actorName + '; actorResourceName = ' + actorResourceName)
logOperator.LogDebug('actor[' + str(i) +'] ItemType(): = '+ str(actor.AskItemType()) + '; ItemSubType = ' + str(actor.AskItemSubType()))
|
|
Specifies the item types to be returned
|
|
|
Specifies the item sub type to be returned, If equal to ItemSubType::SUBITEM_NONE no filtering is done by item subtype
|
|
|
Specifies the sensor type to be returned, If equal to FSSensorType::None, no filtering is done by sensor type
|
|
|
list of CENPyOlpSensor objects. Output of all specified sensors which respect the given filters
|
Gets all sensors of which are on a controlled item.
[Example]
sensors = controller.GetSensors(0, 0, 0)
•
|
GetSignalNumber (signalName: string): int
|
|
|
signal name
|
|
|
The signal number of the found signal
|
Searches for the first signal with the given name, found on a controller signal connection for this controller,
and returns its signal number.
[Example]
signalA_Num = olpController.GetSignalNumber('signalA')
|
|
current name of the controller
|
Returns the controller unique id.
[Example]
cID = olpController.GetUuId()
•
|
GetActiveToolFrameIndex(): int
|
|
|
Returns the index of the active tool frame defined in the unit setup, or -1 if active tool is not set
|
GetActiveToolframeIndex() with lowercase "frame" can also be used.
[Example]
activeToolFrameIndex = olpController.GetActiveToolFrameIndex()
•
|
GetActiveBaseFrameIndex(): int
|
|
|
Returns the index of the active base frame defined in the unit setup, or -1 if active tool is not set
|
GetActiveBaseframeIndex() with lowercase "frame" can also be used.
[Example]
activeBaseFrameIndex = olpController.GetActiveBaseFrameIndex()
|
|
Returns the matrix of the active tool frame defined in the unit setup
|
GetActiveToolframeMatrix() with lowercase "frame" can also be used.
[Example]
activeToolFrameMatrix = olpController.GetActiveToolFrameMatrix()
|
|
Returns the matrix of the active base frame defined in the unit setup
|
GetActiveBaseframeMatrix() with lowercase "frame" can also be used.
[Example]
activeBaseFrameMatrix = olpController.GetActiveBaseFrameMatrix()
•
|
GetActiveToolFrameName(): string
|
|
|
the name of the active tool frame
|
Returns the name of the active tool frame.
[Example]
toolFrameName = olpController.GetActiveToolFrameName()
•
|
GetActiveToolResourceName(): string
|
|
|
the resource name of the active tool
|
Returns the resource name of the active tool.
[Example]
resourceName = olpController.GetActiveToolResourceName()
|
|
Specifies the item type to be returned. If equal to ItemType::ITEM_NONE no filtering is done by item type
|
|
|
Specifies the item sub type to be returned. If equal to ItemSubType::SUBITEM_NONE no filtering is done by item subtype
|
|
|
list of CENPyOlpResource objects. Output of all specified resources which respect the given filters
|
Gets all resources that are controlled by this controller.
[Example]
resources = controller.GetResources(1, 0)
•
|
GetMainResourcesMaxTCPFeedrate(): double
|
|
|
returns the maximum TCP Feedrate Value of the Main Resource
|
Gets the maximum TCP Feedrate Value of the Main Resource.
[Example]
maxspd = Operator.GetController().GetMainResourcesMaxTCPFeedrate()
•
|
IsTeamController(): bool
|
|
|
True if the team controller is selected
|
Returns whether the controller is a team controller.
[Example]
controller = Operator.GetController()
logging.LogInfo("Is Team controller: " + str(controller.IsTeamController()))
Returns the Team controller to which the current controller is connected. If there is no Team controller, the return value will be None.
[Example]
controller = Operator.GetController()
if controller.IsTeamController() is False:
teamController = controller.GetTeamController()
logging.LogInfo("Team controller name: " + str(teamController.GetName()))
Gets all controllers connected to the current controller.
[Example]
controller = Operator.GetController()
connectedControllers = controller.GetControllers()
for connectedController in connectedControllers:
logging.LogInfo("Connected controller name: " + str(connectedController.GetName()))
•
|
GetProgramNames(): list
|
Gets a list of program names on this controller.
[Example]
olpController = Operator.GetController()
allProgramNames = olpController.GetProgramNames()
for prgName in allProgramNames:
if prgName == "PRG001":
allTpes = CENPyOlpProgramModifyOperator.GetProgramTpElementsByName(prgName)
|
|
Logic port name to search for
|
|
|
Found Olp port
|
Returns the first logic port found on the current controller with the given name.
[Example]
olpPort = olpController.GetLogicPortByName("TestOutputBool")
Gets a user-defined attribute object by the given name.
[Example]
attribObject = olpController.GetAttributeByName("AttributeName")
Gets the Integer attribute object by the given name.
[Example]
attribObject = olpController.GetAttributeIntegerByName("AttributeName")
Gets the Float attribute object by the given name.
[Example]
attribObject = olpController.GetAttributeFloatByName("AttributeName")
Gets the String attribute object by the given name.
[Example]
attribObject = olpController.GetAttributeStringByName("AttributeName")
Gets the Bool attribute object by the given name.
[Example]
attribObject = olpController.GetAttributeBoolByName("AttributeName")
•
|
GetOutputDirectory(): string
|
Returns the download output directory of the program. First gets the root download directory of an active program, and if it is empty, gets the output directory from the translator.
[Example]
outputDirectoryPath = olpController.GetOutputDirectory()
•
|
CreateProgram(name: string, startStateName: string, isMain: bool): CENPyOlpProgram
|
|
|
Name of the program to create. Optional. If not set, the default naming rule is applied.
|
|
|
Name of the start state to be used or to be created. Optional. In not set the default start state is used.
|
|
|
If true, a Main program will be created, otherwise a sub-program. Optional. If not set, the default value is used. Default value: True.
|
|
|
CENPyOlpProgram object
|
Creates a new controller program and sets it active.
[Example]
firstProgram = controller.CreateProgram()
secondProgram = controller.CreateProgram("NewProgram")
thirdProgram = controller.CreateProgram("NewProgram", "StartState_NewProgram_1")
fourthProgram = controller.CreateProgram("NewProgram", "StartState_NewProgram_2", False)
•
|
GetLastGeneratedFilePathsFromDownload(): list
|
|
|
list of strings with absolute paths to the last generated files. It is empty if the download is not done yet.
|
Gets the absolute file paths generated during the last download.
[Example]
downloadPaths = olpController.GetLastGeneratedFilePathsFromDownload()
•
|
GetLastSelectedFilePathsFromUpload(): list
|
|
|
list of strings with absolute paths to the last selected files. It is empty if the upload is not done yet.
|
Gets the absolute file paths selected during the last upload.
[Example]
uploadPaths = olpController.GetLastSelectedFilePathsFromUpload()
|
|
Name of the program to find and download, if it exists.
|
|
|
ERRDOWNLOAD_NOERROR if completed successful, error code otherwise
|
Downloads the program specified by its name from the current controller.
[Example]
from centypes import *
from cenpylib import *
def ModifyActiveProgram(Operator: CENPyOlpProgramModifyOperator):
logging = Operator.GetLoggerOperator()
programNameToDownload = "PRG001"
teamController = Operator.GetController().GetTeamController()
for counter, controller in enumerate(teamController.GetControllers(), 1):
controllerName = controller.GetName()
logging.LogInfo(f"Controller <{counter}> name: {controllerName}")
error = controller.DownloadProgramByName(programNameToDownload)
if error is ERRDOWNLOAD_NOERROR:
logging.LogInfo(f"Program named {programNameToDownload} was successfully downloaded from the controller {controllerName}.")
else:
logging.LogError(f"Failed to download program {programNameToDownload} from the controller {controllerName}. Error code: {error}.")
|