Si command subscribe

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

si_command_subscribe(command_name,callback_function)

si_command_subscribe is used to subscribe on one or more global commands. Global commands can be used to communicate between instruments.

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 command_name String Reference to a global variable
2 callback_function Function The function to call when a new command has been sent

Example

-- This function will be called when the dial has gone up
 function master_dial_up(typecmd)
   print("Dial has gone up")

   -- Can be BEGIN, ONCE or END
   print("Command type = " .. typecmd)
 end

 -- subscribe to command
 si_command_subscribe("MASTER_DIAL_UP", master_dial_up)