IScriptDriverInfo

class

IScriptDriverInfo.

IScriptDriverInfo

Bases: object

This interface provides access to the information needed in order to configure the driver and supporting objects of a device or connector.

bus_cycle_task

Retrieves or sets the name of the task, in which to call "start buscycle".

Type

string

This example shows how to modify the bus cycle task.

# Script searches for a specific device and prints all parameters
# We enable the new python 3 print syntax
from __future__ import print_function

# The path to our project
project_path = r"D:\PythonProjects\ModifyBusCycleTask.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:

	# Print the bus cycle task
	device.driver_info_ext.bus_cycle_task
 
	# Set the bus cycle task to TASK_SR_Main
	device.driver_info_ext.bus_cycle_task = 'TASK_SR_Main'
	
	# Print the bus cycle task again
	device.driver_info_ext.bus_cycle_task

bus_cycle_task_guid

Retrieves or sets the the bus cycle task.

Type

Guid

This example shows how to modify the bus cycle task.

# Script searches for a specific device and prints all parameters
# We enable the new python 3 print syntax
from __future__ import print_function

# The path to our project
project_path = r"D:\PythonProjects\ModifyBusCycleTask.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:

	# Print the bus cycle task
	device.driver_info_ext.bus_cycle_task
 
	# Set the bus cycle task to TASK_SR_Main
	device.driver_info_ext.bus_cycle_task = 'TASK_SR_Main'
	
	# Print the bus cycle task again
	device.driver_info_ext.bus_cycle_task

update_ios_in_stop

Defines if the bus should update IOs in stop or not.

Type

bool

This example shows how to modify the 'Update IOs settings'.

# The path to our project
project_path = r"D:\PythonProjects\ModifyUpdateIOsSettings.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:
    if device.driver_info_ext.update_ios_in_stop == False:
        
        # Ensure update IOs in stop is enabled
        device.driver_info_ext.update_ios_in_stop = True
        
        # set update mode; valid values:
        # - AlwaysUpdateVariablesMode.Disabled
        # - AlwaysUpdateVariablesMode.OnlyIfUnused
        # - AlwaysUpdateVariablesMode.AlwaysInBusCycle
        device.driver_info_ext.always_update_variables_mode = AlwaysUpdateVariablesMode.AlwaysInBusCycle
        
        # set the behaviour for outputs in stop; valid values:
        # - StopResetBehaviour.KeepCurrentValues
        # - StopResetBehaviour.SetToDefault
        # - StopResetBehaviour.ExecuteProgram
        device.driver_info_ext.stop_reset_behaviour = StopResetBehaviour.SetToDefault
        
        # set a user program to call when outputs are in stop/reset
        # Note: This automatically sets 'stop_reset_behaviour' to 'StopResetBehaviour.execute_program'
        # Alert: The value is not validated. You have to ensure, the specified PRG exists in your application
        device.driver_info_ext.stop_reset_behaviour_user_program = 'SR_Main'
        

stop_reset_behaviour

Retrieves or sets the behaviour when stop/reset.

Type

StopResetBehaviour

This example shows how to modify the 'Update IOs settings'.

# The path to our project
project_path = r"D:\PythonProjects\ModifyUpdateIOsSettings.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:
    if device.driver_info_ext.update_ios_in_stop == False:
        
        # Ensure update IOs in stop is enabled
        device.driver_info_ext.update_ios_in_stop = True
        
        # set update mode; valid values:
        # - AlwaysUpdateVariablesMode.Disabled
        # - AlwaysUpdateVariablesMode.OnlyIfUnused
        # - AlwaysUpdateVariablesMode.AlwaysInBusCycle
        device.driver_info_ext.always_update_variables_mode = AlwaysUpdateVariablesMode.AlwaysInBusCycle
        
        # set the behaviour for outputs in stop; valid values:
        # - StopResetBehaviour.KeepCurrentValues
        # - StopResetBehaviour.SetToDefault
        # - StopResetBehaviour.ExecuteProgram
        device.driver_info_ext.stop_reset_behaviour = StopResetBehaviour.SetToDefault
        
        # set a user program to call when outputs are in stop/reset
        # Note: This automatically sets 'stop_reset_behaviour' to 'StopResetBehaviour.execute_program'
        # Alert: The value is not validated. You have to ensure, the specified PRG exists in your application
        device.driver_info_ext.stop_reset_behaviour_user_program = 'SR_Main'
        

stop_reset_behaviour_user_program

Retrieves or sets the behaviour programm when stop/reset.

Type

string

This example shows how to modify the 'Update IOs settings'.

# The path to our project
project_path = r"D:\PythonProjects\ModifyUpdateIOsSettings.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:
    if device.driver_info_ext.update_ios_in_stop == False:
        
        # Ensure update IOs in stop is enabled
        device.driver_info_ext.update_ios_in_stop = True
        
        # set update mode; valid values:
        # - AlwaysUpdateVariablesMode.Disabled
        # - AlwaysUpdateVariablesMode.OnlyIfUnused
        # - AlwaysUpdateVariablesMode.AlwaysInBusCycle
        device.driver_info_ext.always_update_variables_mode = AlwaysUpdateVariablesMode.AlwaysInBusCycle
        
        # set the behaviour for outputs in stop; valid values:
        # - StopResetBehaviour.KeepCurrentValues
        # - StopResetBehaviour.SetToDefault
        # - StopResetBehaviour.ExecuteProgram
        device.driver_info_ext.stop_reset_behaviour = StopResetBehaviour.SetToDefault
        
        # set a user program to call when outputs are in stop/reset
        # Note: This automatically sets 'stop_reset_behaviour' to 'StopResetBehaviour.execute_program'
        # Alert: The value is not validated. You have to ensure, the specified PRG exists in your application
        device.driver_info_ext.stop_reset_behaviour_user_program = 'SR_Main'
        

always_update_variables_mode

Retrieves or sets the always mapping mode for the controller as it is done in the controller settings page.

Type

AlwaysUpdateVariablesMode

This example shows how to modify the 'Update IOs settings'.

# The path to our project
project_path = r"D:\PythonProjects\ModifyUpdateIOsSettings.project"

# Clean up any open project:
if projects.primary:
    projects.primary.close()

# Load the project
proj = projects.open(project_path);

# Set the project as primary project
proj = projects.primary

# Search a specific device in the project by name
device = proj.find('LMC_PacDrive', True)[0]

# If device is found, read the address and modify it
if device != None:
    if device.driver_info_ext.update_ios_in_stop == False:
        
        # Ensure update IOs in stop is enabled
        device.driver_info_ext.update_ios_in_stop = True
        
        # set update mode; valid values:
        # - AlwaysUpdateVariablesMode.Disabled
        # - AlwaysUpdateVariablesMode.OnlyIfUnused
        # - AlwaysUpdateVariablesMode.AlwaysInBusCycle
        device.driver_info_ext.always_update_variables_mode = AlwaysUpdateVariablesMode.AlwaysInBusCycle
        
        # set the behaviour for outputs in stop; valid values:
        # - StopResetBehaviour.KeepCurrentValues
        # - StopResetBehaviour.SetToDefault
        # - StopResetBehaviour.ExecuteProgram
        device.driver_info_ext.stop_reset_behaviour = StopResetBehaviour.SetToDefault
        
        # set a user program to call when outputs are in stop/reset
        # Note: This automatically sets 'stop_reset_behaviour' to 'StopResetBehaviour.execute_program'
        # Alert: The value is not validated. You have to ensure, the specified PRG exists in your application
        device.driver_info_ext.stop_reset_behaviour_user_program = 'SR_Main'