Documentation search search close
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg
v10.0.1.x for R2026a
View other versions

speedgoat.restbus.IO723BlockConfig

speedgoat.restbus.IO723BlockConfig — Create an IO723 Block Config instance

Description

This IO723 Block Config class constructs a class object for interacting with an IO723 Read or Write Interface block in Simulink®. The Config instance is connected to the specified Interface block. Upon construction, it checks for instances of the IO723 Read or Write Interface application—these must be closed to proceed.

Several methods are available to retrieve or modify settings relevant to the functionality of the connected Interface block; these methods operate on the data managed by the Config instance itself. Only after applying or saving the Config instance, is data passed to the connected Interface block.

Some methods act on the IO723 Setup block, which itself is linked to the Interface block, referenced by the Config instance. The linked Setup block may be changed to a different one using the 'ModuleID' or 'SetupBlock' parameter of the Config instance.

Syntax

Get an IO723 Block Config instance for a specified IO723 Read or Write Interface block:

configObj = speedgoat.restbus.IO723BlockConfig(blockPath)

Get the value for one or more specified parameters:

configObj.getParameter(parameter1,...,parameterN)

Set the value for one or more specified parameters:

configObj.setParameter(parameter1,value1,...,parameterN,valueN)

Update data from the RBS project file defined in the linked IO723 Setup block:

configObj.updateFromProjectFile()

Enable or disable one or more network items, global variables, or manipulation values including any underlying items:

configObj.setEnable(itemType, items, action)

Map one or more Simulink input signals to corresponding network signals, global variables, or manipulation values in a network:

configObj.setMapping(itemType, inputSignals, items)

Refresh the list of Simulink input signals on the input port of the connected IO723 Read or Write Interface block:

configObj.refreshSimulinkInputSignals()

Save persistent data to the connected IO723 Read or Write Interface block without applying changes:

configObj.save()

Apply the mapping to the connected IO723 Read or Write Interface block and save persistent data:

configObj.apply()

Delete the IO723 Block Config instance without saving persistent data or applying changes to the connected IO723 Read or Write Interface block:

configObj.delete()

Examples

Get an IO723 Block Config instance and connect it to the currently selected IO723 Read or Write Interface block in a loaded Simulink model:

configObj = speedgoat.restbus.IO723BlockConfig(gcb)

Get an IO723 Block Config instance and connect it to the specified IO723 Read or Write Interface block in a loaded Simulink model:

configObj = speedgoat.restbus.IO723BlockConfig('myModel/IO723 Interface block ')

Get the sample time of the connected IO723 Read or Write Interface block:

sampleTime = configObj.getParameter('SampleTime')

Get the list of available Simulink input signals:

inputSignals = configObj.getParameter('SimulinkInputSignals')

Get the module ID of the linked IO723 Setup block:

moduleId = configObj.getParameter('ModuleId')

Get the list of all signal items for all networks:

dbItems = configObj.getParameter('SignalItems')

Get the table of all networks configurations:

networks = configObj.getParameter('Networks')

Set the module ID to select the IO723 Setup block to link (clears all persistent data on the connected IO723 Read or Write Interface block):

configObj.setParameter('ModuleId', 2)

Set the module ID to select the IO723 Setup block to link (clears all persistent data on the connected IO723 Read or Write Interface block) and the sample time:

configObj.setParameter('ModuleId', 2, 'SampleTime', '0.01')

Set the Setup block path directly to select the IO723 Setup block to link (clears all persistent data on the connected IO723 Read or Write Interface block):

configObj.setParameter('SetupBlock', 'myModel/IO723 Setup')

Set the RBS Project file to be used in the linked IO723 Setup block (also parses the project):

configObj.setParameter('ProjectFile', [pwd, '/myProject.fcr'])

Update from the RBS project file defined in the linked IO723 Setup block:

configObj.updateFromProjectFile()

Enable a single network item including underlying items:

configObj.setEnable('SignalItems', 'CAN.Ecu.signal', true)

Disable the mapping of a single global variable in order to use the default value from the RBS project file:

configObj.setEnable('GlobalVariables', 'globalVar1', false)

Enable multiple network items including underlying items:

configObj.setEnable('SignalItems', {'CAN.Ecu1.signal1', 'CAN.Ecu1.signal2', ...
'CAN.Ecu2'}, true)

Map one Simulink input signal to one signal item in a network:

configObj.setMapping('SignalItems', 'simulink.signal', 'CAN.Ecu.signal')

Map each Simulink input signal to a single signal item in the network:

configObj.setMapping('SignalItems',  ...
{'simulink.signal1', 'simulink.signal2'}, ...
{'CAN.Ecu1.signal1', 'CAN.Ecu1.signal2'})

Map specific Simulink input signals and scalars to specific manipulation values:

configObj.setMapping('Manipulations', ...
{{1, 'simulink.signal1'}, {'simulink.enableSignal1', '1', '12', '3e3'}}, ...
{'OffsetManipulation1', 'RampManipulation1'})

Clear the mapping for a signal item in a network by mapping it to 'Ground(0)':

configObj.setMapping('SignalItems', 'Ground(0)', 'CAN.Ecu.signal')

Clear the mapping for manipulation values by mapping to '0':

configObj.setMapping('Manipulations', '0', 'RampManipulation1')

Refresh the list of Simulink input signals on the input port of the connected IO723 Read or Write Interface block:

configObj.refreshSimulinkInputSignals()

Save persistent data to the connected IO723 Read or Write Interface block without applying changes:

configObj.save()

Apply the mapping to the connected IO723 Read or Write Interface block and save persistent data:

configObj.apply()

Delete the IO723 Block Config instance without saving persistent data or applying changes to the connected IO723 Read or Write Interface block:

configObj.delete()

Input Arguments

'blockPath' - Path to an IO723 Read or Write Simulink block [character vector | string]. The path to an IO723 Read or Write Interface block in a loaded Simulink model file.

Output Arguments

'configObj' – Instance of the IO723 Block Config class [IO723BlockConfig]. The IO723 Block Config instance initialized for interacting with the specified IO723 Read or Write Interface block. The Interface block remains connected to the Config instance until the Config instance is deleted.

Notes

This constructor requires a loaded Simulink model with at least one IO723 Setup block and one IO723 Read or Write Interface block.