Command Buttons

Q-SYS Control 101 Training : Simple Communication

3 ) Simple Communication

12m 49s

4 ) Feature License Activation

4m 12s

5 ) Block Controller

19m 7s

7 ) Flow Control

34m 20s

8 ) Control 101 Conclusion

1m 42s

Lesson Description

Command Buttons 6m 11s

Send simple one-way communication strings to third party devices using Command Buttons.

Video Transcript

Command Buttons 6m 11s
0:08
Sometimes, third-party control can be as simple as sending a command to a device, and you’re done!
0:14
There are a lot of devices that can be controlled externally, such as projectors, video switchers,
0:20
lighting controllers, etc. If all you need to do is send a command to that device and you don’t need to
0:25
collect any return information from it, then you can use the Command Buttons.
0:30
These are designed to send simple one-way communication strings to a networked device or a serial
0:35
connection. In the Command Buttons’ properties, you can decide how many Command Buttons you
0:39
you would like. Each button will send one specific string, and you can add up to 64 buttons in the
0:46
component. You can also specify if you’re sending commands via TCP, UDP, or Serial. TCP and UDP
0:53
commands are simply sent out onto the network, but Serial commands are sent to a physical
0:58
Serial connection. When you select Serial, you’ll notice that a trapezoidal pin is added to the
1:03
component, which can only be wired to another Serial pin. Many Q-SYS devices have an RS-232
1:10
port, which is represented within Designer as an Inventory component associated with that device.
1:16
Simply connect this component to your Command Buttons.
1:20
If you’re wiring to a Serial port, this is one of the few times you should forget the rule that pins on
1:25
the left of an object are inputs and pins on the right are outputs. Don’t worry that it looks like
1:31
Command Buttons are only receiving information, because – in this case – that single connection
1:35
works in both directions.
1:38
Inside the Command Buttons’ control panel, you’ll need to configure some information about the
1:42
receiving device. In Serial mode, you’ll need to input the Baud Rate, Data Bits, Parity, and Stop Bits.
1:49
For TCP and UDP commands, you’ll need the device’s IP address and its communication Port. The IP
1:55
address is something you may have configured yourself, but you should be able to find all the rest
2:00
of this information in your device’s user manual or documentation.
2:03
Let’s push our Designer file to the Core. Now that we’re up and running, let’s look inside the Serial
2:09
Port Block. When you send a message, there are counters in the block that will show you how many
2:15
bytes of data is transmitted or received through the Serial Port. This is very useful for
2:20
troubleshooting purposes, like the RS-232 cable not being wired correctly.
2:24
Other than that – there’s not much to do! Type in the command string here, and when you press the
2:31
trigger button on the left it will send that command to the end-device. You could also expose the
2:37
Control Pins for each of these triggers, allowing something else within Q-SYS to fire the command.
2:42
Or, like any other control, you could add these triggers to the Named Controls Bin, allowing you to
2:49
schedule these triggers to be activated from your Administrator’s Command Scheduler.
2:54
Once again, Command Buttons offer one-way communication, so you won’t get any sort of feedback
2:59
from the device indicating that it received the command, or has performed the action. You do have a
3:04
Status indicator that will tell you the health of the connection, but this does not report any
3:08
information about the device’s activity. However, if you’re using Command Buttons, it’s probably
3:15
because you don’t need, or care, about any information returning. For instance, if you can see the
3:20
lights change, well then you know the lighting controller received your command.
3:26
So the final question, but unfortunately the only difficult one, is this: how do you know what to type
3:32
as a command? These commands vary wildly by manufacturer, and you may need to do a little bit of
3:37
legwork in order to find them. But most manufacturers, if they’re worth their salt, will have a list of
3:43
their device’s commands available somewhere – maybe it’s in a user guide, a supplemental guide, or
3:49
you may need to e-mail them directly.
3:51
Since there are over 9 trillion different manufacturers of third-party devices, we can’t do much to
3:56
help you find those commands. However, we do want to point out one common mistake a lot of
4:02
people make. A lot of manufacturers require a carriage return at the end of the command to note
4:07
that the command string is complete. This information might be displayed in different ways
4:11
for instance, this manual display it like so: .
4:17
As a quick history lesson, “Carriage return” is sort of an archaic term, referring to a time way before
4:24
computers when we typed with typewriters. The typewriter’s carriage moved to the left by one
4:30
character every time you pressed a key, and when it got the end of the page you would press
4:34
“carriage return” to bring it back to the right. The idea of “Carriage Return” has been replaced with
4:40
the “Enter” key on most keyboards, but you’ll still find this terminology associated with the
4:45
execution of computer commands.
4:48
The tricky part is that this text: should not be typed literally. A carriage return is represented in
4:55
different ways in different coding languages, so this instruction here is telling you to input a carriage
5:01
return, based on whatever language you’re using. Since Q-SYS uses Lua as it scripting language, you
5:08
can enter a carriage return by typing “backslash-r.” The backslash character in Lua tells the compiler
5:15
that the following character should not be interpreted literally, and is instead a secret code to
5:20
perform some other function. R stands for Return. You could also execute a “new line” command,
5:27
which some manuals might call for, with the “backslash-n” command. Or you could use “backslash-x”
5:34
to signify that the following two characters should be interpreted as a hexadecimal value.
5:39
Hopefully you won’t have to dig too deep into these types of conversions when using Command
5:44
Buttons, but knowing that the backslash-r is often required to cap off your command string that's an
5:50
important one. These same concepts will actually be useful again if you start coding bi-directional
5:55
communications using either the Lua script or the Block Controller, which we’ll look at in future
6:00
videos. Until then, we have an exercise on the Command Buttons in your Control Training worksheet,
6:05
so take a look at that before moving on to the next video.