Main Content

enableCallback

R2026b

Enable or disable callbacks in Safety Analysis Manager spreadsheets

Since R2024a

Description

enableCallback(spreadsheet,callbacks,status) enables or disables the custom callbacks, callbacks, in the Safety Analysis Manager spreadsheet, spreadsheet, based on the value of status.

example

enableCallback(faultTreeDocument,callbacks,status) enables or disables the custom callbacks in the Safety Analysis Manager fault tree document, faultTreeDocument. (since R2026b)

example

Examples

collapse all

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add custom callbacks named myCustomCallback1, myCustomCallback2, and myCustomCallback3 to the spreadsheet.

addCallback(mySpreadsheet,"myCallback1")
addCallback(mySpreadsheet,"myCallback2")
addCallback(mySpreadsheet,"myCallback3")

Enable the first two callbacks, and disable the third. To retrieve the names of the callbacks, use the getCustomCallbackNames function (since R2026b).

callbackNames = getCustomCallbackNames(mySpreadsheet);
enableCallback(mySpreadsheet,callbackNames,[1,1,0])

Since R2026b

Create a new fault tree document in the Safety Analysis Manager.

myFaultTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Add custom callbacks named myCustomCallback1, myCustomCallback2, and myCustomCallback3 to the spreadsheet.

addCallback(myFaultTreeDoc,"myCallback1")
addCallback(myFaultTreeDoc,"myCallback2")
addCallback(myFaultTreeDoc,"myCallback3")

Enable the first two callbacks, and disable the third.

callbackNames = getCustomCallbackNames(myFaultTreeDoc);
enableCallback(myFaultTreeDoc,callbackNames,[1,1,0])

Input Arguments

collapse all

Spreadsheet in the Safety Analysis Manager, specified as a Spreadsheet object.

Fault tree document in the Safety Analysis Manager, specified as a FaultTreeDocument object.

Custom callback names, specified as a string array or cell array of character vectors.

Data Types: char | string

Status of callbacks, specified as an array of numeric or logical values, 1 (true) or 0 (false). The size of status must match the size of callbacks. Enter 1 or true to enable the callbacks.

Data Types: logical

Version History

Introduced in R2024a

expand all