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()