Use the Block Controller component to easily declare a number of controls and their connections, and then build the Lua script associated with those controls using a visual block interface.
After you configure your controls and connections in the elements configurator, you can then build your configuration using a visual programming tool that uses interlocking graphical blocks to represent common code programming concepts including logical expressions and loops. Rapid code creation and editing allows you to compose simple or sophisticated AV scripts while ensuring that the generated code is always syntactically correct.
The underlying script interacts with components through their control pins. You can write scripts to control elements entirely within the Q-SYS Designer file, or you can use it to interface Q-SYS with third-party hardware accessible via TCP, UDP or Serial.
NOTE: This component uses the Q-SYS Scripting Engine, which is a licensed feature on certain Cores manufactured with Q-SYS 7.0 and later. For more information, see Feature Licensing.
Control |
Function |
---|---|
Controls area |
Click to add a new control to the list, and then configure its properties. See See Controls Properties. |
Connections area |
Click to add a new connection to the list, and then configure its properties. See See Connections Properties. |
Edit button |
Opens the Blocks editor or Lua text editor, depending on the component you are using. |
Property |
Function |
Choices |
---|---|---|
Name |
Specify a name for the input. |
Text input |
Control Count |
Specify the number of controls of the specified type to create. |
1 to 256 |
Category |
Button
Select a Button Type:
Knob
Specify a Max Value and Min Value for a specified Control Unit:dB, Hz, Float, Integer, Pan, Percent, Position, Seconds. Indicator
Specify an Indicator Type: LED, Meter, Text, Status. Text
Specify a Text Type: Text Box, Combo Box, List Box |
Button, Knob, Indicator, Text |
Pin Style |
Expose pins for these controls: None, Input (pins on the left), Output (pins on the right), or Both. |
None, Input, Output, Both |
Property |
Function |
Choices |
---|---|---|
Connection Type |
Specify how to communicate with the external device: TCP
Expose IP Address, Port, and Status pins for these controls: None, Input (pins on the left), Output (pins on the right), or Both.
UDP
Expose IP Address, Port, and Status pins for these controls: None, Input (pins on the left), Output (pins on the right), or Both. Serial
Expose Baud Rate, Bits, Parity, and Status pins for these controls: None, Input (pins on the left), Output (pins on the right), or Both. Note that this will expose a serial control pin that needs to be wired to a matching pin on the component that represents the hardware. |
TCP, UDP, Serial |
Control Name |
Specify a name for the connection and its controls. |
Text input |
After configuring your controls and connections, click Edit to open the Blocks editor (Blocks tab). Controls and connections are presented as graphical blocks that you can drag into the script and configure with values and statements.
For examples of creating controls using the visual block interface, see Block Examples. To modify your script in a traditional script editor, see See Using the Script Editor.
To edit the script using a text-based editor, click the button and select Convert to Script.
WARNING: When you switch to the text-based editor, the editor is initially populated with the Lua script generated from the Block editor. If you later switch back to the Block editor ( > Revert to Blocks), your text editor changes are lost. Any text-based script you enter is overwritten by text generated by the Block editor.
The script editor contains three areas:
TIP: While in the Script area, press F1 for help on the Lua scripting language.
The available Control Pins depend on settings in Properties.
Pin Name |
Function |
Pins Available |
---|---|---|
Code |
Text input and output. Allows you to enter code. |
Input / Output |
Script Start |
Starts the script running. |
Input / Output |
Script Status |
Current status of the script. |
Output |
Script Stop |
Stops the script. |
Input / Output |
This section demonstrates how you can create controls using the visual block interface, which then generates the underlying Lua script. Refer to the Using Lua in Q-SYS Overview topic for information on Lua scripting.
Serial port communication is supported via the RS-232 ports on some Q-SYS devices. To create a connection:
In this example, a trigger button is used to send data (entered in a text box) through the serial port on a Core 110f. For more information on serial port connections, and to see an example of the Lua script used to create this example, see SerialPorts.
Double-click the Block Controller component to open the elements editor. In this example, two controls and one connection are defined.
TIP: You can drag individual control and connection components into your schematic or copy them to the User Control Interface editor.
Click Edit to open the Blocks editor. Define the controller configuration using the available blocks in the left menu. The Controls and Connections categories contain the elements defined in the elements editor.
In this example, there are four groups of blocks that do the following:
Blocks | Script Equivalent |
---|---|
Controls['send'].EventHandler = function() local tx = Controls['data'].String tx = tostring(Controls['data'].String) .. tostring('\r') sp:Write(tx) print(tostring('sending data out to serial port ') .. tostring(Controls['data'].String)) end |
|
spStatusConnectedFunctions['W20|n-~B=8xbb@M)EUz]'] = function() print('serial port connected') print(tostring('baudrate ') .. tostring(Controls['sp.Baud_Rate'].String)) print(tostring('databits ') .. tostring(Controls['sp.Data_Bits'].String)) print(tostring('parity ') .. tostring(Controls['sp.Parity'].String)) end |
|
spStatusClosedFunctions['ik3z-W^jqC}cB9g*Vt!9'] = function(error_message) print('serial port disconnected') end |
|
sp.Data = function() message = sp:ReadLine(SerialPorts.EOL.Any) while (message ~= nil) do print(tostring('read line ') .. tostring(message)) message = sp:ReadLine(SerialPorts.EOL.Any) end end |
---- QSYS Initialization ---- ---- BEGIN CODE THAT RUNS LAST ListOfCodeThatRunsLast = {} ExecuteCodeThatRunsLast = function() for ectrl_i, ectrl_fun in pairs(ListOfCodeThatRunsLast) do ectrl_fun() end end ---- END CODE THAT RUNS LAST -- Available Controls -- --[[ Controls['send'] Controls['data'] Controls['sp.Baud_Rate'] Controls['sp.Data_Bits'] Controls['sp.Parity'] Controls['sp.Status'] ]]-- -- Available Connections -- -- ### sp ### Controls['sp.Status'].Value = 4 Controls['sp.Status'].String = '' sp = SerialPorts[1] Controls["sp.Parity"].Choices = {"Even", "Odd", "None"} Controls["sp.Data_Bits"].Choices = {"5", "6", "7", "8"} Controls["sp.Baud_Rate"].Choices = {"75","150","300","600","1200","2400","4800","9600","19200","38400","57600","115200","230400"} spBaud_RateEventFunctions = {} Controls['sp.Baud_Rate'].EventHandler = function() for spBaud_Rate_i, spBaud_Rate_confun in pairs(spBaud_RateEventFunctions) do spBaud_Rate_confun() end end spBaud_RateEventFunctions['Baud_RateChanged'] = function() -- SERIAL RE-CONNECT print('reconnecting serial port because of control property change') Controls['sp.Status'].Value = 5 Controls['sp.Status'].String = 'Reconnecting' sp:Close() do if (not (Controls['sp.Baud_Rate'].String == '')) and (not (Controls['sp.Data_Bits'].String == '')) and (not (Controls['sp.Parity'].String == '')) then local success, err = pcall(function() sp:Open(Controls['sp.Baud_Rate'].String, Controls['sp.Data_Bits'].String, string.sub(Controls['sp.Parity'].String, 1, 1)) end) if not success then Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial pin.' print("Could not open serial port. Check that the serial port 'sp' is wired to a serial port in the Design.") end if sp.IsOpen then Controls['sp.Status'].Value = 0 end else Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial connection properties.' end end end spData_BitsEventFunctions = {} Controls['sp.Data_Bits'].EventHandler = function() for spData_Bits_i, spData_Bits_confun in pairs(spData_BitsEventFunctions) do spData_Bits_confun() end end spData_BitsEventFunctions['Data_BitsChanged'] = function() -- SERIAL RE-CONNECT print('reconnecting serial port because of control property change') Controls['sp.Status'].Value = 5 Controls['sp.Status'].String = 'Reconnecting' sp:Close() do if (not (Controls['sp.Baud_Rate'].String == '')) and (not (Controls['sp.Data_Bits'].String == '')) and (not (Controls['sp.Parity'].String == '')) then local success, err = pcall(function() sp:Open(Controls['sp.Baud_Rate'].String, Controls['sp.Data_Bits'].String, string.sub(Controls['sp.Parity'].String, 1, 1)) end) if not success then Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial pin.' print("Could not open serial port. Check that the serial port 'sp' is wired to a serial port in the Design.") end if sp.IsOpen then Controls['sp.Status'].Value = 0 end else Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial connection properties.' end end end spParityEventFunctions = {} Controls['sp.Parity'].EventHandler = function() for spParity_i, spParity_confun in pairs(spParityEventFunctions) do spParity_confun() end end spParityEventFunctions['ParityChanged'] = function() -- SERIAL RE-CONNECT print('reconnecting serial port because of control property change') Controls['sp.Status'].Value = 5 Controls['sp.Status'].String = 'Reconnecting' sp:Close() do if (not (Controls['sp.Baud_Rate'].String == '')) and (not (Controls['sp.Data_Bits'].String == '')) and (not (Controls['sp.Parity'].String == '')) then local success, err = pcall(function() sp:Open(Controls['sp.Baud_Rate'].String, Controls['sp.Data_Bits'].String, string.sub(Controls['sp.Parity'].String, 1, 1)) end) if not success then Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial pin.' print("Could not open serial port. Check that the serial port 'sp' is wired to a serial port in the Design.") end if sp.IsOpen then Controls['sp.Status'].Value = 0 end else Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial connection properties.' end end end spStatusEventFunctions = {} Controls['sp.Status'].EventHandler = function() for spStatus_i, spStatus_confun in pairs(spStatusEventFunctions) do spStatus_confun() end end spStatusEventFunctions['StatusChanged'] = function() -- SERIAL RE-CONNECT print('reconnecting serial port because of control property change') Controls['sp.Status'].Value = 5 Controls['sp.Status'].String = 'Reconnecting' sp:Close() do if (not (Controls['sp.Baud_Rate'].String == '')) and (not (Controls['sp.Data_Bits'].String == '')) and (not (Controls['sp.Parity'].String == '')) then local success, err = pcall(function() sp:Open(Controls['sp.Baud_Rate'].String, Controls['sp.Data_Bits'].String, string.sub(Controls['sp.Parity'].String, 1, 1)) end) if not success then Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial pin.' print("Could not open serial port. Check that the serial port 'sp' is wired to a serial port in the Design.") end if sp.IsOpen then Controls['sp.Status'].Value = 0 end else Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial connection properties.' end end end spStatusConnectedFunctions = {} spStatusConnectedFunctions['StandardConnected'] = function() Controls['sp.Status'].Value = 0 Controls['sp.Status'].String = '' end spStatusClosedFunctions = {} spStatusClosedFunctions['StandardClosed'] = function() Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Closed' end sp.Connected = function() for sp_i, sp_confun in pairs(spStatusConnectedFunctions) do sp_confun() end end sp.Closed = function() for sp_i, sp_clofun in pairs(spStatusClosedFunctions) do sp_clofun() end end sp.Reconnect = function() Controls['sp.Status'].Value = 5 Controls['sp.Status'].String = 'Reconnect' end sp.Timeout = function() Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Timeout' end spConnectionErrorFunctions = {} spConnectionErrorFunctions['StandardError'] = function(error_message) Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = error_message end sp.Error = function(connection, error_message) if error_message == nil then error_message = '' end for sp_i, sp_errfun in pairs(spConnectionErrorFunctions) do sp_errfun(error_message) end end -- SERIAL STARTUP CONNECT ListOfCodeThatRunsLast['spStartupConnect'] = function() if (not (Controls['sp.Baud_Rate'].String == '')) and (not (Controls['sp.Data_Bits'].String == '')) and (not (Controls['sp.Parity'].String == '')) then local success, err = pcall(function() sp:Open(Controls['sp.Baud_Rate'].String, Controls['sp.Data_Bits'].String, string.sub(Controls['sp.Parity'].String, 1, 1)) end) if not success then Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial pin.' print("Could not open serial port. Check that the serial port 'sp' is wired to a serial port in the Design.") end if sp.IsOpen then Controls['sp.Status'].Value = 0 Controls['sp.Status'].String = 'Connected' end else Controls['sp.Status'].Value = 2 Controls['sp.Status'].String = 'Check serial connection properties.' end end ---- QSYS Initialization ---- Controls['send'].EventHandler = function() local tx = Controls['data'].String tx = tostring(Controls['data'].String) .. tostring('\r') sp:Write(tx) print(tostring('sending data out to serial port ') .. tostring(Controls['data'].String)) end sp.Data = function() message = sp:ReadLine(SerialPorts.EOL.Any) while (message ~= nil) do print(tostring('read line ') .. tostring(message)) message = sp:ReadLine(SerialPorts.EOL.Any) end end spStatusConnectedFunctions['W20|n-~B=8xbb@M)EUz]'] = function() print('serial port connected') print(tostring('baudrate ') .. tostring(Controls['sp.Baud_Rate'].String)) print(tostring('databits ') .. tostring(Controls['sp.Data_Bits'].String)) print(tostring('parity ') .. tostring(Controls['sp.Parity'].String)) end spStatusClosedFunctions['ik3z-W^jqC}cB9g*Vt!9'] = function(error_message) print('serial port disconnected') end ExecuteCodeThatRunsLast()
The Block Controller automatically produces script for handling the setting of baud rate, data bits, and parity. When you emulate or save and run your design to the Core, open the Block Controller control panel to set baud rate, data bits, and parity using the drop-down menus.
The TcpSocket object allows Q-SYS cores to make client TCP/IP connections to devices on the network. In this example, a trigger button is used to send data entered in a text box to a TCP device with a specified IP address and port number. For more information, and to see an example of the Lua script used to create this example, see TcpSocket.
Double-click the Block Controller component to open the elements editor. In this example, two controls and one connection are defined.
TIP: You can drag individual control and connection components into your schematic or copy them to the User Control Interface editor.
Click Edit to open the Blocks editor. Define the controller configuration using the available blocks in the left menu. The Controls and Connections categories contain the elements defined in the elements editor.
Blocks | Script Equivalent |
---|---|
sendData = 'Hello\x0d\x0a' |
|
sockStatusConnectedFunctions['rq{I?iu_o,WJQo?H:W2X'] = function() print('socket connected') end |
|
sockStatusClosedFunctions['jArNCFTp,o|3t(#/z?sc'] = function(error_message) print('TCP socket was closed by the remote end') end |
|
sock.Data = function() message = sock:ReadLine(TcpSocket.EOL.Any) while (message ~= nil) do print(tostring('TCP socket has data:\t') .. tostring(message)) message = sock:ReadLine(TcpSocket.EOL.Any) end end |
|
Controls['Trigger button'].EventHandler = function() -- A comment for this block sock:Write(sendData) print('sending data') end |
|
sockStatusEventFunctions['sEeUv*1X#B]WOPpjFN~h'] = function() print('sock status change') end |
---- QSYS Initialization ---- ---- BEGIN CODE THAT RUNS LAST ListOfCodeThatRunsLast = {} ExecuteCodeThatRunsLast = function() for ectrl_i, ectrl_fun in pairs(ListOfCodeThatRunsLast) do ectrl_fun() end end ---- END CODE THAT RUNS LAST -- Available Controls -- --[[ Controls['Trigger button'] Controls['sendData'] Controls['sock.IP_Address'] Controls['sock.Port'] Controls['sock.Status'] ]]-- -- Available Connections -- -- ### sock ### Controls['sock.Status'].Value = 4 Controls['sock.Status'].String = '' sock = TcpSocket.New() sock.ReconnectTimeout = 5 sockIP_AddressEventFunctions = {} Controls['sock.IP_Address'].EventHandler = function() for sockIP_Address_i, sockIP_Address_confun in pairs(sockIP_AddressEventFunctions) do sockIP_Address_confun() end end sockIP_AddressEventFunctions['IP_AddressChanged'] = function() -- TCP RE-CONNECT print('reconnecting TCP because of control property change') Controls['sock.Status'].Value = 5 Controls['sock.Status'].String = 'Reconnecting' sock:Disconnect() do if (not (Controls['sock.IP_Address'].String == '')) and (not (Controls['sock.Port'].String == '')) then local success, err = pcall(function() sock:Connect(Controls['sock.IP_Address'].String, Controls['sock.Port'].Value) end) if not success then Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = err end else Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Check TCP connection properties.' end end end sockPortEventFunctions = {} Controls['sock.Port'].EventHandler = function() for sockPort_i, sockPort_confun in pairs(sockPortEventFunctions) do sockPort_confun() end end sockPortEventFunctions['PortChanged'] = function() -- TCP RE-CONNECT print('reconnecting TCP because of control property change') Controls['sock.Status'].Value = 5 Controls['sock.Status'].String = 'Reconnecting' sock:Disconnect() do if (not (Controls['sock.IP_Address'].String == '')) and (not (Controls['sock.Port'].String == '')) then local success, err = pcall(function() sock:Connect(Controls['sock.IP_Address'].String, Controls['sock.Port'].Value) end) if not success then Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = err end else Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Check TCP connection properties.' end end end sockStatusEventFunctions = {} Controls['sock.Status'].EventHandler = function() for sockStatus_i, sockStatus_confun in pairs(sockStatusEventFunctions) do sockStatus_confun() end end sockStatusEventFunctions['StatusChanged'] = function() -- TCP RE-CONNECT print('reconnecting TCP because of control property change') Controls['sock.Status'].Value = 5 Controls['sock.Status'].String = 'Reconnecting' sock:Disconnect() do if (not (Controls['sock.IP_Address'].String == '')) and (not (Controls['sock.Port'].String == '')) then local success, err = pcall(function() sock:Connect(Controls['sock.IP_Address'].String, Controls['sock.Port'].Value) end) if not success then Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = err end else Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Check TCP connection properties.' end end end sockStatusConnectedFunctions = {} sockStatusConnectedFunctions['StandardConnected'] = function() Controls['sock.Status'].Value = 0 Controls['sock.Status'].String = '' end sockStatusClosedFunctions = {} sockStatusClosedFunctions['StandardClosed'] = function() Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Closed' end sock.Connected = function() for sock_i, sock_confun in pairs(sockStatusConnectedFunctions) do sock_confun() end end sock.Closed = function() for sock_i, sock_clofun in pairs(sockStatusClosedFunctions) do sock_clofun() end end sock.Reconnect = function() Controls['sock.Status'].Value = 5 Controls['sock.Status'].String = 'Reconnect' end sock.Timeout = function() Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Timeout' end sockConnectionErrorFunctions = {} sockConnectionErrorFunctions['StandardError'] = function(error_message) Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = error_message end sock.Error = function(connection, error_message) if error_message == nil then error_message = '' end for sock_i, sock_errfun in pairs(sockConnectionErrorFunctions) do sock_errfun(error_message) end end -- TCP STARTUP CONNECT ListOfCodeThatRunsLast['sockStartupConnect'] = function() if (not (Controls['sock.IP_Address'].String == '')) and (not (Controls['sock.Port'].String == '')) then local success, err = pcall(function() sock:Connect(Controls['sock.IP_Address'].String, Controls['sock.Port'].Value) end) if not success then Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = err end else Controls['sock.Status'].Value = 2 Controls['sock.Status'].String = 'Check TCP connection properties.' end end ---- QSYS Initialization ---- sock.Data = function() message = sock:ReadLine(TcpSocket.EOL.Any) while (message ~= nil) do print(tostring('TCP socket has data:\t') .. tostring(message)) message = sock:ReadLine(TcpSocket.EOL.Any) end end Controls['Trigger button'].EventHandler = function() -- A comment for this block sock:Write(sendData) print('sending data') end sendData = 'Hello\x0d\x0a' sockStatusConnectedFunctions['rq{I?iu_o,WJQo?H:W2X'] = function() print('socket connected') end sockStatusClosedFunctions['jArNCFTp,o|3t(#/z?sc'] = function(error_message) print('TCP socket was closed by the remote end') end -- prints received messages -- Trigger button EvenHandler (sends data) sockStatusEventFunctions['sEeUv*1X#B]WOPpjFN~h'] = function() print('sock status change') end ExecuteCodeThatRunsLast()
The Timer object is used to create delays or trigger events after a defined elapsed time. It should be used instead of Lua’s native delay and time functions. For more information, and to see an example of the Lua script used to create this example, see System.
Blocks | Script Equivalent |
---|---|
timer1 = Timer.New() timer2 = Timer.New() timer_1 = 'timer1!' timer_2 = 'timer2' timer = 'timer2' |
|
function timerFunc() if timer == timer_1 then print(timer_1) elseif timer == timer_2 then print(timer_2) end end |
|
timer1.EventHandler = function() timer = timer_1 timerFunc() end |
|
timer2.EventHandler = function() timer = timer_2 timerFunc() end |
|
timer1:Start(1) timer2:Start(2) |
---- QSYS Initialization ---- ---- BEGIN CODE THAT RUNS LAST ListOfCodeThatRunsLast = {} ExecuteCodeThatRunsLast = function() for ectrl_i, ectrl_fun in pairs(ListOfCodeThatRunsLast) do ectrl_fun() end end ---- END CODE THAT RUNS LAST -- Available Controls -- --[[ ]]-- -- Blockly Timers -- timer1 = Timer.New() timer2 = Timer.New() -- Available Connections -- ---- QSYS Initialization ---- function timerFunc() if timer == timer_1 then print(timer_1) elseif timer == timer_2 then print(timer_2) end end timer1.EventHandler = function() timer = timer_1 timerFunc() end timer2.EventHandler = function() timer = timer_2 timerFunc() end timer_1 = 'timer1!' timer_2 = 'timer2' timer = 'timer2' -- change to pink timer1:Start(1) timer2:Start(2) ExecuteCodeThatRunsLast()
This example shows how you can use the Block Controller component to create multiple controls (trigger buttons) and then use those controls in a user control interface with layer transitions.
This example UCI allows the user to push one of six buttons to either show a Q-SYS product category image or remove the current image and show the Q-SYS logo:
There are three overall steps to creating this UCI:
Double-click the Block Controller component to open the elements editor. In this example, six controls and no connections are defined.
(None)
NOTE: For information on creating UCIs, see User Control Interface.
Now, you will have a UCI with one page ("Page 1") containing seven layers:
Finally, use the Blocks editor to define the UCI functionality.
In this example, there are three groups of blocks that do the following:
Blocks | Script Equivalent |
---|---|
function clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'cores', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'network', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'conference', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'touchscreen', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'amplifiers', false, 'fade') end |
|
clear() |
|
Controls['cores'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'cores', true, 'left') end Controls['network'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'network', true, 'right') end Controls['conference'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'conference', true, 'bottom') end Controls['touchscreens'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'touchscreen', true, 'top') end Controls['amplifiers'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'amplifiers', true, '') end Controls['logo'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', true, 'fade') end |
---- QSYS Initialization ---- ---- BEGIN CODE THAT RUNS LAST ListOfCodeThatRunsLast = {} ExecuteCodeThatRunsLast = function() for ectrl_i, ectrl_fun in pairs(ListOfCodeThatRunsLast) do ectrl_fun() end end ---- END CODE THAT RUNS LAST -- Available Controls -- --[[ Controls['cores'] Controls['network'] Controls['conference'] Controls['touchscreens'] Controls['amplifiers'] Controls['logo'] ]]-- -- Available Connections -- ---- QSYS Initialization ---- function clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'cores', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'network', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'conference', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'touchscreen', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'amplifiers', false, 'fade') end Controls['cores'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'cores', true, 'left') end Controls['network'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'network', true, 'right') end Controls['conference'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'conference', true, 'bottom') end Controls['touchscreens'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'touchscreen', true, 'top') end Controls['amplifiers'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', false, 'fade') Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'amplifiers', true, '') end Controls['logo'].EventHandler = function() clear() Uci.SetLayerVisibility('Q-SYS', 'Page 1', 'logo', true, 'fade') end clear() ExecuteCodeThatRunsLast()
For further explanation of the Block Controller component, see the following videos:
Learn about the Block Controller component through a navigational overview. In this lesson, you'll learn how to manipulate a simple button control using blocks.
Learn about sections of the Block Controller, including control change, flow control, if statements, operators, boolean values, and converting blocks to lua script.
QSC.com | Software and Firmware | Resources | QSC Self Help Portal
© 2009 - 2018 QSC, LLC. All rights reserved. QSC and the QSC logo are trademarks of QSC, LLC in the U.S. Patent and Trademark office and other countries. All other trademarks are the property of their respective owners.
http://patents.qsc.com