Control Script Component

VIDEO TUTORIAL: A basic video tutorial is available online for Control Scripts.

The Control Script component is used to write scripts, using the Lua language, for control and monitoring from within Q-SYS Designer. You can change or monitor the position, value, string, metadata and other attributes of controls. The script you write interacts with components through their control pins.

For a complete listing of available scripting commands and examples specific to Q-SYS, refer to the Using Lua in Q-SYS topic. For a complete Lua Language reference refer to the Lua 5.3 Reference Manual topic.

When you double click the Control Script component, the script editing tab displays.

NOTE:  If you open a Q-SYS 3.3 or earlier design containing a Control Script component in Q-SYS 4.0 or later, the component with become a Control Script v1 component. The existing v1 script will continue to function as before. However, if the v1 script is pasted into a newly placed Control Script component, it will most likely fail. We have made it simpler to convert a v1 script to v2 by adding a property to the Control Script v1 block by adding a property to use the New Script Engine (Yes/No). This is to avoid having to copy and paste code to a v2 Script component.

Controls

Control

Function

Script Area

Text-edit area to write script. You can edit the script in the Design, Emulate, or Run modes, but any errors are only detected in the Run or Emulate modes.

TIP:   While in the Script area, press F1 for help on the Lua scripting language.

Yellow information bar at the top of the script area.

"Script has changed and is out of sync. Click to update script."

Click the yellow info bar to reload (not run) the script. Any errors display in debug log area.

Debug Output

Displays error messages from the Lua engine describing errors in the script, and displays any "print" output. The output is limited to 16 lines.

Using the Control Script

Properties

Property

Function

Choices

Input Count

Sets the number of inputs.

0 to 512

Serial Count

Sets the number of serial connections. Use with the Core, I/O Frame, and Page Station Serial Port components.

0 to 512

Output Count

Sets the number of outputs.

0 to 512

New Script Engine

Available only when a Control Script V1 is contained and selected in Q-SYS Designer 4.0 or later. You can select the New Script Engine or not. The Control Script V1 can be used in Q-SYS 4.0 or later, however it is not available in the 4.0 or later Schematic Library.

No / Yes

Control Pins

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

Log Clear

Trigger input and output. Clears the debug log.

Input / Output

Log History

Text output of the debug log.

Output

Reload

Trigger input and output. Reloads the code.

Input / Output

Related Topics Link IconRelated Topics


 

© 2009 - 2016 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.