Function to retrieve the Bus object of a bus in the specified Element object. For example,
this.parent specifies the parent of the script module as the Element object to be searched in. This function does not search in subelements. A particular bus can be searched by name or position. The position is the number indexing the busses in the specified Element object. If several busses share the same name, only the first match will be returned. If no argument is set, the function returns the first bus it finds.
Available in: Controller, Processor.
|nameOrPosition||The name or position of the bus. Set this to |
nil to deactivate the search filter.
|string or number, optional|
Returns the Bus object of the found bus. Returns
nil if no bus is found.
-- locate the first bus in the program and print its name
bus = this.program:getBus()
if bus then
print("Could not find a bus!")