API v1. Pharos LPC X, DESIGNER, LPC 1/2/4, TPC, BPS, Rio
Below you will find brief information for software Designer, controller LPC 1/2/4, controller LPC X, controller TPC, remote device RIO and remote device BPS. This document describes the software Designer, which is used to program Pharos Lighting Playback Controllers (LPCs), Touch Panel Controllers (TPCs), and Remote Devices such as RIOs and BPSs. The software is designed to be user-friendly and intuitive, with most operations performed with mouse clicks and drag-and-drop. You can create a project by working through a series of steps, each with its own tab for a clear, step-by-step process.
Advertisement
Advertisement
Pharos Designer User Manual
API V1
The Pharos system includes multiple API options: l l l
Lua (used internally with Conditions and Actions)
HTTP (used with external devices/software to communicate with a controller)
JavaScript (used with Custom Web Interfaces)
These APIs have been unified to simplify their use as much as possible.
API Queries
Below are the ways of getting data from the controller.
show
Glossary: l l l l l l l l l l l l
Object - A collection of key value pairs e.g. "name" = "Controller 1" (syntax will differ between languages).
String - A series of characters e.g."Th1s_is-4(string)"
Number - Any whole or floating point(decimal) number e.g. 1,2,3,1.5,12.3456)
Integer - A whole number
Bounded integer - An integer with a range (e.g. 10:100 = 10%)
Float/real/number - A decimal number (e.g. 3.2 or 1.0)
JSON - (JavaScript Object Notation) a way of transferring information in the form of a JavaScript Object
GET - A HTTP method to request data from a server
POST - A HTTP method to request data in a more secure way
PUT - A HTTP method to send data to a server
Variant - See
[] - anything shown within square brackets is optional. The square brackets should be omitted if the optional section is used.
System
Returns data about the controller.
show
Lua
The system namespace has the following properties:
Property
.hardware_type
.channel_capacity
.serial_number
.memory_total
.memory_used
.memory_free
.storage_size
Return type string integer string string string string string
.bootloader_version
string
.firmware_version
string
.reset_reason
.last_boot_time
string
DateTime object
Return Example
"lpc"
512
"006321"
"12790Kb"
"24056Kb"
"103884Kb"
"1914MB"
"0.9.0"
"2.3.2"
"Software Reset"
- 368 -
.ip_address
.subnet_mask
.default_gateway
string string string
"192.168.1.3"
"255.255.255.0"
"192.168.1.3"
Example: capacity = system.channel_capacity
boot_time = system.last_boot_time.time_string
HTTP
GET /api/system
Returns an object with the following properties:
Property hardware_type channel_capacity serial_number memory_total memory_used memory_free storage_size bootloader_version firmware_version reset_reason last_boot_time ip_address subnet_mask default_gateway string string string string string string string
Return type Return Example string "LPC" integer string
512
"006321" string string string string
"12790Kb"
"24056Kb"
"103884Kb"
"1914MB"
"0.9.0"
"2.3.2"
"Software Reset"
"01 Jan 2017 09:09:38"
"192.168.1.3"
"255.255.255.0"
"192.168.1.3"
JavaScript
get_system_info(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_system_info( function(system){ var capacity = system.channel_capacity
}
Project
Returns data about the project.
Show
Lua
get_current_project()
- 369 -
API v1
Pharos Designer User Manual
Returns an object with the following properties:
Property name author filename
Return type string string string unique_id string
Return Example
"Help Project"
"Pharos"
"help_project_v1.pd2"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
Example: project_name = get_current_project().name
HTTP
GET /api/project
Returns an object with the following properties:
Property name author filename
Return type string string string unique_id string upload_date string
Return Example
"Help Project"
"Pharos"
"help_project_v1.pd2"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
"2017-01-30T15:19:08"
JavaScript
get_project_info(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_project_info( function(project){
} var author = project.author
Time
Returns data about the time stored in the controller.
Show
Lua
The time namespace has the following functions which return a
l l l l l l l get_current_time() get_sunrise() get_sunset() get_civil_dawn() get_civil_dusk() get_nautical_dawn() get_nautical_dusk()
- 370 -
l l l l get_new_moon() get_first_quarter() get_full_moon() get_third_quarter() and the following properties
Property is_dst gmt_offset
Return Type boolean string
Return Example
Each function returns a
DateTime object , with the following properties:
Property
.year
.month
.monthday
.weekday
.hour
.minute
Return Type integer integer (0-11) integer (0-30) integer(0-6) integer(0-23) integer (0-59)
.second
integer (0-59)
.utc_timestamp
integer
.time_string
.date_string
string string
8
1
13
21
Return Example
2017
5
46
1494249706
Example: current_hour = get_current_time().hour
HTTP
GET /api/time
Returns an object with the following properties:
Property Return Type datetime string utc integer (controller's local time in milliseconds uptime integer (time since last boot)
JavaScript
get_current_time(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_current_time( function(time){ var uptime = time.uptime
}
Return Example
"01 Feb 2017 13:44:42"
1485956682
493347
- 371 -
API v1
Pharos Designer User Manual
Timeline
Returns data about the timelines in the project and their state on the controller.
Show
Lua
get_timeline(timelineNum)
Returns a single Timeline object for the timeline with user number timelineNum.
The returned object has the following properties
Property name length source_ bus timecode_ format audio_ band audio_ channel audio_ peak time_offset state onstage position
Return Type string integer integer (equivalent to constants: DEFAULT, TCODE_1 ... TCODE_6, AUDIO_
1 ... AUDIO_4) string integer (0 is equivalent to constant VOLUME) integer (equivalent to constants: LEFT, RIGHT or COMBINED) boolean priority integer integer (equivalent to constants: Timeline.NONE, Timeline.RUNNING,
Timeline.PAUSED, Timeline.HOLDING_AT_END, Timeline.RELEASED) boolean integer integer (equivalent to constants: HIGH_PRIORITY, ABOVE_NORMAL_
PRIORITY, NORMAL_PRIORITY, BELOW_NORMAL_PRIORITY or LOW_
PRIORITY)
Example: tl = get_timeline(1) name = tl.name
state = tl.state
if (tl.source_bus == TCODE_1) then
-- do something end
1 false
5000
1 true
5000
0
Return
Example
"Timeline 1"
10000
1
"SMPTE30"
0
- 372 -
API v1
HTTP
GET /api/timeline[?num=timelineNumbers] l num can be used to filter which timelines are returned and can be a single number or a string representing the required timelines (e.g. "1,2,5-9")
Returns an object with the following properties: timelines array of timeline objects
Each timeline object contains the following properties:
Property name length source_bus timecode_format audio_band audio_channel audio_peak time_offset state onstage position priority
Return Type string integer string integer (0 is volume band) string ('left', 'right', 'combined') boolean integer string ('none', 'running', 'paused', 'holding_at_end', 'released') boolean integer string ('high', 'above_normal', 'normal', 'below_normal', 'low')
Return Example
"Timeline 1"
10000 string ('internal', 'timecode_1',...'timecode_6', 'audio_1',...'audio_4') 100
"SMPTE30"
1
"combined" false
5000
"running" true
10000
"normal"
JavaScript
get_timeline_info(callback[, filter]) l num can be used to filter which timelines are returned and can be a single number or a string representing the required timelines (e.g. "1,2,5-9")
Returns an array of timelines in the same way as the HTTP call
Example:
Query.get_timeline_info( function(timeline){
} var name = timeline[0].name //name of the first timeline
Scene
Returns data about the Scenes in the project and their state on the controller.
Show
Lua
get_scene(sceneNum)
Returns a single Scene object for the Scene with user number SceneNum.
- 373 -
Pharos Designer User Manual
The returned object has the following properties
Property name state onstage
Return Type string string ('none', 'started') boolean
Return Example
"Scene 1"
"none" false
Example: scn = get_scene(1) name = scn.name
state = scn.state
HTTP
GET /api/scene[?num=sceneNumbers] num can be used to filter which scenes are returned and can be a single number or array
Returns an object with the following properties: scenes array of scene objects
Each scene object contains the following properties:
Property name num state onstage
Return Type string integer
Return Example
"Scene 1"
1 string ('none', 'started') "none" boolean false
JavaScript
get_scene_info(callback[, filter]) filter may contain a num property which is used to filter which scenes are returned
Returns an array of scenes in the same way as the HTTP call
Example:
Query.get_scene_info( function(scene){
} var name = scene[0].name //name of the first scene
Group
Returns data about the groups in the project.
Show
Lua
get_group(groupNum)
- 374 -
Returns a Group object for the group with user number groupNum.
The returned object has the following properties:
Property name master_intensity_level
Return Type string
Variant
Return Example
"Group 1"
Example: grp = get_grp(1) name = grp.name
HTTP
GET /api/group[?num=groupNumbers] num can be used to filter which groups are returned and can be a single number or array
Returns an object with the following properties: groups array of group objects
Each group object contains the following properties:
Property num name level
Return Type integer string integer (0-100)
Return Example
1
"Group 1"
100
JavaScript
get_group_info(callback[, filter]) filter may contain a num property which is used to filter which groups are returned
Returns an array of groups in the same way as the HTTP call
Example:
Query.get_group_info( function(group){
} var name = group[0].name // name of the first group
Controller
Returns data about the controller.
Show
Lua
get_current_controller()
Returns an object for the containing the following properties:
- 375 -
API v1
Pharos Designer User Manual
Property number name
Return Type integer string
Return Example
1
"Controller 1"
Example: cont = get_current_controller name = cont.name
is_controller_online(controllerNumber)
Returns true if the controller with user number controllerNum has been discovered, and false otherwise
Example: if (is_controller_online(2)) then log("Controller 2 is online") else end log("Controller 2 is offline")
HTTP
GET /api/controller
Returns an object with the following properties: controllers array of controller objects (one for each controller in the project)
Each controller object contains the following properties:
Property num type name serial ip_ address online
Return Type number string string string string (if the controller is discovered)/empty (if the controller is not discovered or is the queried controller) boolean
JavaScript
get_controller_info(callback)
Returns an array of controllers in the same way as the HTTP call
Example:
Query.get_controller_info( function(controller){
Return
Example
1
"LPC"
"Controller 1"
"009060"
"192.168.1.3" or "" true
- 376 -
} var name = controller[0].name // name of the first controller
Temperature
Returns data about the controller's temperature.
Show
Lua
Not currently available.
HTTP
GET /api/temperature
Returns an object with the following properties:
Property sys_temp core1_temp
Return Type number (only for LPC X and VLC) number (only for LPC X and VLC) core2_temp number (only for LPC X rev 1 ambient_temp number (only for TPC, LPC X rev 1) cc_temp number (only for LPC X rev 2 and VLC)
Return Example
40
44
44
36.900001525878906
44
JavaScript
get_temperature(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_temperature( function(temp){
} var ambient = temp.ambient_temp // ambient temperature of the controller
Remote Device
Returns data about the Remote Device/s in the project.
Show
Lua
get_rio(type, num):get_input(inputNum) l l l type can be RIO80, RIO44 or RIO08 num is the remote device number inputNum is the number of the input
Returns a boolean if the input is set to Digital or Contact Closure, or an integer if the input is set to Analog.
Example: rio = get_rio(RIO44, 1)
- 377 -
API v1
Pharos Designer User Manual input = rio:get_input(1) get_bps(num):get_state(buttonNum) l l num is the BPS number buttonNum is the number of the button
Returns the state of the button, which can be RELEASED, PRESSED, HELD or REPEAT
Example: bps = get_bps(1) btn = bps:get_state(1)
HTTP
GET /api/remote_device
Returns an array of all remote devices in the project.
The returned object has the following structure remote_devices array of Remote Device objects
Each Remote Device object contains the following properties:
Property num type serial outputs inputs online
Return Type integer string ('RIO08', 'RIO44',
'RIO80', 'BPS', 'BPI', 'RIO
A', 'RIO D') array (all discovered serial number for the address and type) array (of Output objects, only present for RIO44 and
RIO08 that are on the queried controller) array (of Input objects, only present for RIO44 and
RIO80 that are on the queried controller) boolean (if the remote device is detected as being online)
Return Example
1
"RIO 44"
["001234"]
[{"output":1,"value":true},{"output":2,"value":true},{"output":3,"value":true},{"output":4,"value":true}]
[{"input":1,"type":"Contact Closure","value":true},{"input":2,"type":"Contact Closure","value":true},{"input":3,"type":"Contact
Closure","value":true},{"input":4,"type":"Contact Closure","value":true}] true
The Output object has the following properties:
Property output state
Return Type integer boolean (true means the output is on, false means it is off)
The Input object has the following properties:
Return Example
1 false
- 378 -
Property input type value
Return Type integer string ('Analog', 'Digital', 'Contact Closure') integer or bool (depends on type)
Return Example
1
'Digital' true
JavaScript
get_remote_device_info(callback)
Returns an array of all remote devices in the project with the same properties as in the HTTP call.
Example:
Query.get_remote_device_info( function(remote){
} var type = remote[0].type // type of the first remote device
Text Slots
Returns data about the text slots in the project.
Show
Lua
get_text_slot(slotName) l slotName is the name of the text slot
Returns the value of slotName
Example: log(get_text_slot("test_slot"))
HTTP
GET /api/text_slot[?names=slotNames] slotNames can be used to filter which text slots are returned and can be a single name or array
The returned object has the following structure text_slots array of Text Slot objects
Each Text Slot object contains the following properties:
Property name value
Return Type string string
Return Example
"text"
"example"
JavaScript
get_text_slot(callback[, filter]) filter may contain a names property which is used to filter which text slot values are returned
- 379 -
API v1
Pharos Designer User Manual
Returns an array of all text slots in the project with the same properties as in the HTTP call.
Example:
Query.get_text_slot( function(text){ var value = text[0].value // value of the first text slot
}, {names: "test_slot1", "test_slot2"})
Log
Returns the log from the queried controller.
Show
Lua
Not currently available.
HTTP
GET /api/log
The returned object has the following structure
Property Return Type log string (containing the whole log of the controller)
JavaScript
Not currently available.
Protocol
Returns the protocols and universes being output from the queried controller.
Show
Lua
Not currently available.
HTTP
GET /api/protocol
Returns all the universes on the queried controller
The returned object has the following structure outputs array of Protocol objects
Each Protocol object has the following properties:
Property type name universes
Return Type integer string array (Universe objects)
Return Example
1
"DMX"
{"key":{"index":1},"name":"1"},{"key":{"index":2},"-
- 380 -
dmx_ proxy
DMX Proxy Object (where appropriate)
Each Universe object has the following properties: name":"2"}
{ "ip_address": "192.168.1.17", "name": "Controller 1" }
Property name key
Return Type string
Universe Key object
Return Example
"1"
{"index":1}
Each DMX Proxy object has the following properties:
Property name ip_address
Return Type string (name of the controller that is outputting this universe) string IP Address of the controller outputting this universe
Return Example
'Controller 1'
'192.168.1.23'
The properties of the Universe Key object depends upon the type:
For DMX, Pathport, sACN and Art-Net:
Property index
Return Type integer
Return Example
1
For KiNET:
Property kinet_port kinet_power_supply_num
Return Type integer integer
Return Example
1
1
JavaScript
get_protocols(callback)
Returns all the universes on the queried controller
The returned object has the following structure outputs array of Protocol objects
Each Protocol object has the following properties:
Property type name universes dmx_ proxy
Return Type integer string array (Universe objects)
DMX Proxy Object (where appropriate)
Each Universe object has the following properties:
Property Return Type Return Example
Return Example
1
"DMX"
[{"key":{"index":1},"name":"1"},{"key":{"index":2},"name":"2"}]
API v1
- 381 -
Pharos Designer User Manual name key string
Universe Key object
"1"
{"index":1}
Each DMX Proxy object has the following properties:
Property name ip_address
The properties of the Universe Key object depends upon the type:
For DMX, Pathport, sACN and Art-Net:
Property index
For KiNET:
Return Type string (name of the controller that is outputting this universe) string IP Address of the controller outputting this universe
Return Type integer
Return Example
1
Property kinet_port kinet_power_supply_num
Return Type integer integer
Return Example
1
1
Return Example
'Controller 1'
'192.168.1.23'
Output
Returns the levels being output from the queried controller.
Show
Lua
get_dmx_universe(idx) get_artnet_universe(idx) get_pathport_universe(idx) get_sacn_universe(idx) l idx is the required universe number get_kinet_universe(power_supply_num, port_num) l l power_supply_num is the power supply to return the output from port_num is the port to return the output from
These all return a Universe object, which has the following function get_channel_value(chnl) l chnl is the channel to get the value from
Example: uni = get_dmx_universe(1) -- get DMX Universe 1 level = uni:get_channel_value(1) -- get channel 1 from the returned universe
- 382 -
API v1
HTTP
GET /api/output?universe=universeKey l l l universeKey is a string in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for
RIO DMX.
protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80
Example:
GET /api/output?universe=dmx:1
GET /api/output?universe=rio-dmx:rio44:1
The returned object has the following structure
Property channels proxied_ tpc_name
Return Type array (of channel values) string (only if controller is LPC, universe is DMX
2, DMX Proxy has been enabled and the TPC is offline)
Return Example
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255]
'Controller 2'
JavaScript
get_output(universeKey, callback)
Argument universekey
Type string or an object containing protocol and either index, kinet_power_supply_num and kinet_port or remote_device_type and remote_device_num
Example dmx:1 l universeKey can be either a string, or an object containing protocol and either index, kinet_power_supply_ num and kinet_port or remote_device_type and remote_device_num as received from get_protocols
Returns an object with the same structure as in the HTTP call
Input
Returns the inputs on the queried controller.
Show
Lua
get_input(idx)
Argument idx
Type integer
Example
1
Returns the value of the controllers input as a boolean or integer
Example: in1 = get_input(1) if in1 == true then
- 383 -
Pharos Designer User Manual log("Input 1 is digital and high") elseif in1 == false then log("Input 1 is digital and low") else log("Input 1 is analog at " .. in1) get_dmx_input(chnl)
Argument chnl l
Type Example integer 1 chnl is the required channel number
Returns the value of the DMX input at channel chnl as an integer
HTTP
GET /api/input
The returned object has the following structure
Property gpio dmxIn
Return
Type array (of
Input objects, on
LPC or
TPC+EXT) object
(DMX Input object, if
DMX Input is configured)
Return Example
[{"input":1,"type":"Contact Closure","value":true},{"input":2,"type":"Contact Closure","value":true},{"input":3,"type":"Contact Closure","value":true},{"input":4,"type":"Contact Closure","value":true},{"input":5,"type":"Contact
Closure","value":true},{"input":6,"type":"Contact Closure","value":true},{"input":7,"type":"Contact Closure","value":true},{"input":8,"type":"Contact Closure","value":true}]
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255]
The Input object has the following properties:
Property input type value
Return Type integer
Return Example
1 string ('Analog', 'Digital', 'Contact Closure') "Contact Closure" integer or bool (depends on type) true
The DMX Input object has the following properties:
Property error
Return Type string (if DMX Input is configured but no
DMX is received) dmxInFrame array (of channel values)
Return Example
"No DMX received"
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255]
- 384 -
JavaScript
Not currently available.
Trigger
Returns the triggers in the project.
Show
Lua
Not currently available.
HTTP
GET /api/trigger
The returned object has the following structure triggers array (of Trigger objects)
The Trigger object has the following properties:
Property type num name trigger_text conditions actions
Return Type string integer string string array (of Condition objects) array (of Action objects
Return Example
"Startup"
1
"Startup"
"At startup"
[{"text":"Before 12:00:00 every day"}]
[{"text":"Start Timeline 1"}]
The Condition and Action objects have the following properties:
Property text
Return Type string
Return Example
"Start Timeline 1"
JavaScript
Not currently available.
Lua Variable
Returns the current value of the specified Lua variable.
Show
Lua
Not currently available.
HTTP
GET /api/lua?variables=luaVariables
Argument luaVariables
Type string or comma separated list
Example
'myVar' or 'myVar, myVar2, myVar3'
- 385 -
API v1
Pharos Designer User Manual
Returns an object containing all the Lua variables requested and their values.
JavaScript
get_lua_variables(luaVariables, callback)
Argument luaVariables
Type string or array
Example
'myVar' or 'myVar, myVar2, myVar3'
Returns an object containing all the Lua variables requested and their values.
Example:
Query.get_lua_variables("myVar", function(lua){ var value = lua.myVar
}
Trigger Variable
Returns the value of a variables from the trigger that ran the script.
Show
Lua
get_trigger_variable(idx)
Argument idx
Type integer
Example
1
Returns the trigger variable at idx as a Variant object.
Example:
-- Use with a TPC Colour Move Trigger red = get_trigger_variable(1).integer
green = get_trigger_variable(2).integer
blue = get_trigger_variable(3).integer
HTTP
Not currently available.
JavaScript
Not currently available.
Resources
Use to locate resources in the controller's memory.
Show
Lua
get_resource_path(filename)
- 386 -
Argument filename
Type string
Example
'settings.txt'
Returns a path to the resource filename.
Example: dofile(get_resource_path("my_lua_file.lua"))
HTTP
Not currently available.
JavaScript
Not currently available.
API Actions
Below are the ways of changing properties or changing output on the controller.
show
Start Timeline
Start a timeline in the project Show
Lua
get_timeline(timelineNum):start()
Argument timelineNum
Type integer
Example
1
HTTP
POST /api/timeline
{
"action": "start",
"num": timelineNum
}
Argument timelineNum
Type integer
Example
1
JavaScript
Query.start_timeline({ "num": timelineNum}, callback)
Argument timelineNum
Type integer
Example
1
- 387 -
API v1
Pharos Designer User Manual
Start Scene
Start a scene in the project Show
Lua
get_scene(sceneNum):start()
Argument Type sceneNum integer
Example
1
HTTP
POST /api/scene
{
"action": "start",
"num": sceneNum
}
Argument Type sceneNum integer
Example
1
JavaScript
Query.start_scene({ "num": sceneNum}, callback)
Argument Type Example sceneNum integer 1
Release Timeline
Release a timeline in the project Show
Lua
get_timeline(timelineNum):release([fade])
Argument timelineNum fade
Type integer float
HTTP
POST /api/timeline
{
"action": "release",
"num": timelineNum[,
Example
1
2.0
- 388 -
"fade": fade]
}
Argument timelineNum fade
Type integer float
Example
1
2.0
JavaScript
Query.release_timeline({ "num": timelineNum[, "fade": fade]}, callback)
Argument timelineNum fade
Type integer float
Example
1
2.0
Release Scene
Release a scene in the project Show
Lua
get_scene(sceneNum):release([fade])
Argument sceneNum fade
Type integer float
Example
1
2.0
HTTP
POST /api/scene
{
"action": "release",
"num": sceneNum[,
"fade": fade]
}
Argument sceneNum fade
Type integer float
Example
1
2.0
JavaScript
Query.release_scene({ "num": sceneNum[, "fade": fade]}, callback)
Argument sceneNum fade
Type integer float
Example
1
2.0
- 389 -
API v1
Pharos Designer User Manual
Release All
Release all timelines and/or scenes in the project Show
Lua
release_all([fade]) release_all_timelines([fade]) release_all_scenes([fade])
Argument fade
Type Example float 2.0
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Toggle Timeline
Toggle a timeline in the project (if it is running, stop it, and if it is not running, start it) Show
Lua
get_timeline(timelineNum):toggle([fade])
Argument timelineNum fade
Argument timelineNum fade
Type integer float
HTTP
POST /api/timeline
{
"action": "toggle",
"num": timelineNum[,
"fade": fade]
}
Type integer float
Example
1
2.0
Example
1
2.0
- 390 -
JavaScript
Query.toggle_timeline({ "num": timelineNum[, "fade": fade]}, callback)
Argument timelineNum fade
Type integer float
Example
1
2.0
Toggle Scene
Toggle a scene in the project (if it is running, stop it, and if it is not running, start it) Show
Lua
get_scene(sceneNum):toggle([fade])
Argument sceneNum fade
Type integer float
HTTP
POST /api/scene
{
"action": "toggle",
"num": sceneNum[,
"fade": fade]
}
Example
1
2.0
Argument sceneNum fade
Type integer float
Example
1
2.0
JavaScript
Query.toggle_scene({ "num": sceneNum[, "fade": fade]}, callback)
Argument sceneNum fade
Type integer float
Example
1
2.0
Pause Timeline
Pause a timeline in the project Show
Lua
get_timeline(timelineNum):pause()
- 391 -
API v1
Pharos Designer User Manual
Argument timelineNum
Type integer
Example
1
HTTP
POST /api/timeline
{
"action": "pause",
"num": timelineNum
}
Argument timelineNum
Type integer
Example
1
JavaScript
Query.pause_timeline({ "num": timelineNum}, callback)
Argument timelineNum
Type integer
Example
1
Resume Timeline
Resume a timeline in the project Show
Lua
get_timeline(timelineNum):resume()
Argument timelineNum
Type integer
Example
1
HTTP
POST /api/timeline
{
"action": "resume",
"num": timelineNum
}
Argument timelineNum
Type integer
Example
1
JavaScript
Query.resume_timeline({ "num": timelineNum}, callback)
Argument Type Example
- 392 -
timelineNum integer 1
Pause All
Pause all timelines in the project Show
Lua
pause_all()
HTTP
POST /api/timeline
{
}
"action": "pause"
JavaScript
Query.pause_all(callback)
Resume All
Resume all timelines in the project Show
Lua
resume_all()
HTTP
POST /api/timeline
{
}
"action": "resume"
JavaScript
Query.resume_all(callback)
Set Timeline Rate
Set the rate of a timeline in the project Show
Lua
get_timeline(timelineNum):set_rate(rate)
Argument timelineNum rate
Type integer float or bounded integer
Example
1
10:100 or 0.1
- 393 -
API v1
Pharos Designer User Manual
HTTP
POST /api/timeline
{
"action": "set_rate",
"num": timelineNum,
"rate": rate
}
Argument timelineNum rate
Type Example integer 1 float or bounded integer 10:100 or 0.1
JavaScript
Query.set_timeline_rate({"num": timelineNum, "rate": rate }, callback)
Argument timelineNum rate
Type integer
Example
1 float or bounded integer 10:100 or 0.1
Set Timeline Position
Set the position of a timeline in the project Show
Lua
get_timeline(timelineNum):set_position(position)
Argument timelineNum position
Type integer
Example
1 float or bounded integer 10:100 or 0.1
HTTP
POST /api/timeline
{
"action": "set_position",
"num": timelineNum,
"position": position
}
Argument timelineNum position
Type Example integer 1 float or bounded integer 10:100 or 0.1
- 394 -
API v1
JavaScript
Query.set_timeline_position({"num": timelineNum, "position": position }, callback)
Argument timelineNum position
Type integer float or bounded integer
Enqueue Trigger
Fire a trigger in the project Show
Lua
enqueue_trigger(num[,var...])
Example
1
10:100 or 0.1
Argument num - the trigger number to enqueue var... - 0 or more variables to pass to the trigger
Type integer comma separated variables
Example
1
1,2,"string"
Example enqueue_trigger(1,1,2,"string")
HTTP
POST /api/trigger
{
"num": num[,
"var": var...][,
"conditions": test_conditions]
}
Argument num var...
Type integer comma separated variables
Example
1
1,2,"string" test_conditions l l l boolean true num - the trigger number to enqueue var... - 0 or more variables to pass to the trigger test_conditions - Should the conditions on the trigger be tested?
JavaScript
Query.fire_trigger({"num": num[, "var": var...][, "conditions": test_conditions]
}, callback)
Argument num
Type integer
Example
1
- 395 -
Pharos Designer User Manual var...
test_conditions l l l comma separated variables boolean
"1,2,'string'" true num - the trigger number to enqueue var... - 0 or more variables to pass to the trigger. If passing multiple variables, they must be a single string surrounded by double quotes (").
test_conditions - Should the conditions on the trigger be tested?
Run Script
Run a script or parse into the command line on the controller Show
Lua
Not currently available.
HTTP
POST /api/cmdline
{
"input": chunk,
}
Note: returns "Executed" if successful, or an error string if not
Argument Type chunk - the script to parse or run string
Example
"tl = 1 get_timeline(tl):start()"
JavaScript
Query.run_command({ "input": chunk }, callback)
Note: returns "Executed" if successful, or an error string if not
Argument Type chunk - the script to parse or run string
Example
"tl = 1 get_timeline(tl):start()"
Hardware Reset
Reset the controller (power reboot) Show
Lua
Not currently available.
HTTP
POST /api/reset
JavaScript
Not currently available.
- 396 -
API v1
Master Intensity
Master the intensity of a group or content target (applied as a multiplier to output levels) Show
Lua
Non-VLC get_group(groupNum):set_master_intensity(level[, fade[, delay]])
VLC get_content_target():set_master_intensity(level, [fade, [delay]])
VLC + get_content_target(compositionNum, type):set_master_intensity(level, [fade,
[delay]])
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used string (from options) float or integer (0-255) float float
Example
1
'primary', 'secondary', 'overlay_1', 'overlay_2'
128 or 0.5
2.0
2.0
Example: get_group(1):set_master_intensity(128,3) -- master group 1 to 50% (128/255 = 0.5) in 3 seconds)
HTTP
Non-VLC
POST /api/group
{
"action": "master_intensity",
"num": groupNum,
"level": level,
["fade": fade,]
["delay": delay]
}
VLC
POST /api/content_target
- 397 -
Pharos Designer User Manual
{
"action": "master_intensity",
"level": level,
["fade": fade,]
["delay": delay]
}
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used
Example
1 string (from options) 'primary', 'secondary', 'overlay_1', 'overlay_2' float or bounded integer 0.5 or "50:100" float float
2.0
2.0
JavaScript
Non-VLC master_intensity({ "num": groupNum, "level": level, ["fade": fade,] ["delay": delay] }, callback)
VLC master_content_target_intensity({ "level": level, ["fade": fade,] ["delay": delay] }, callback)
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used
Example
1 string (from options) 'primary', 'secondary', 'overlay_1', 'overlay_2' float or bounded integer 0.5 or "50:100" float float
2.0
2.0
Example:
Query.master_intensity({"num":1,"level":"50:100","fade":3) -- master group 1 to
50% (50/100 = 0.5) in 3 seconds)
Set RGB
Set the Intensity, Red, Green, Blue levels for a fixture or group.
Show
Lua
get_fixture_override(num) get_group_override(num)
- 398 -
API v1
:set_irgb(intensity, red, green, blue, [fade, [path]])
:set_intensity(intensity, [fade, [path]])
:set_red(red, [fade, [path]])
:set_green(green, [fade, [path]])
:set_blue(blue, [fade, [path]])
:set_temperature(temperature, [fade, [path]])
Argument num - group or fixture intensity red green blue temperature fade path
Type integer integer (0-255) integer (0-255) integer (0-255) integer (0-255) integer (0-255) float string (from options)
Example
1
255
255
255
255
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Example: ov = get_fixture_override(1) -- Get fixture 1 ov:set_rgb(255, 255, 0, 0) -- Set the fixture to Red
HTTP
PUT /api/override
{
"target": target,
"num": num,
["intensity": intensity,]
["red": red,]
["green": green,]
["blue": blue,]
["temperature": temperature,]
["fade": fade,]
["path": path]
}
- 399 -
Pharos Designer User Manual
Argument num - group or fixture intensity red green blue temperature fade path
Argument num - group or fixture intensity red green blue temperature fade path
Type integer integer (0-255) integer (0-255) integer (0-255) integer (0-255) integer (0-255) float string (from options)
Example
1
255
255
255
255
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Javascript
set_group_override({ "num": num, ["intensity": intensity,] ["red": red,] ["green": green,] ["blue": blue,] ["temperature": temperature,] ["fade": fade,] ["path": path] }, callback) set_fixture_override({ "num": num, ["intensity": intensity,] ["red": red,]
["green": green,] ["blue": blue,] ["temperature": temperature,] ["fade": fade,]
["path": path] }, callback)
Type integer integer (0-255) integer (0-255) integer (0-255) integer (0-255) integer (0-255) float string (from options)
Example
1
255
255
255
255
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Example:
Query.set_fixture_override({ "num": 1, "intensity": 255, "red": 255, "green": 0,
"blue": 0});
Clear RGB
Remove any overrides on fixtures or groups.
Show
Lua
get_fixture_override(num) get_group_override(num)
:clear([fade])
- 400 -
clear_all_overrides([fade])
Argument num - group or fixture fade
Type integer float
Example
1
2.0
Example: ov = get_fixture_override(1) -- Get fixture 1 ov:clear() -- Clear the override on fixture 1
HTTP
DELETE /api/override
{
["target": target,]
["num": objectNum,]
["fade": fade]
}
If num is not included, target is ignored and all overrides are cleared.
Argument target num - group or fixture fade
Type Example string (from options) "group" or "fixture" integer 1 float 2.0
JavaScript
clear_group_overrides({ ["fade": fade] }, callback) clear_fixture_overrides({ ["fade": fade] }, callback) clear_overrides({ ["fade": fade] }, callback)
Argument fade
Type float
Example
2.0
Example:
Query.clear_overrides({"fade":3})
Set Text Slot
Set the value of a text slot used in the project.
Show
Lua
set_text_slot(name, value)
- 401 -
API v1
Pharos Designer User Manual
Argument name value
Type Example string (matching text slot name) "myTextSlot" string "Hello World!"
Example: set_text_slot("myTextSlot", "Hello World!")
HTTP
PUT /api/text_slot
{
"name": name,
"value": value
}
Argument name value
Type Example string (matching text slot name) "myTextSlot" string "Hello World!"
JavaScript
set_text_slot({"name": name, "value": value}, callback)
Argument name value
Type Example string (matching text slot name) "myTextSlot" string "Hello World!"
Example:
Query.set_text_slot("name:"myTextSlot", "value":"Hello World!")
Set BPS Button LED
Set the effect and intensity on BPS button LEDS.
Show
Lua
get_bps(num):set_led(button, effect, [intensity], [fade])
Argument num button effect intensity fade
Type integer integer
OFF, ON, SLOW_FLASH, FAST_FLASH, DOUBLE_FLASH, BLINK, PULSE,
SINGLE, RAMP_ON, RAMP_OFF integer (1-255) float
Example:
Example
1
1
FAST_
FLASH
255
0.0
- 402 -
get_bps(1):set_led(1,FAST_FLASH,255) -- Set button 1 on BPS 1 to Fast Flash at full intensity
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set TPC Control Value
Set the value on a TPC Slider or Color Picker.
Show
Lua
set_control_value(name, [index,] value[, emitChange])
Argument name - control Key index - axis of movement (slider has 1, colour picker has 3) value emitChange
Type string integer (1-3) (default 1) integer (0-255) boolean (default false)
Example
"slider001"
1
128 false
Example: set_control_value("slider001", 1, 128) -- set slider001 to half and don't fire associated triggers
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set TPC Control State
Set the state on a TPC control.
Show
Lua
set_control_state(name, state)
Argument Type Example
API v1
- 403 -
Pharos Designer User Manual name - control Key string state - the state name form Interface string (from options in Interface)
"slider001"
"Green"
Example: set_control_state("slider001", "Green") -- set slider001 to a state called
"Green"
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set TPC Control Caption
Set the caption on a TPC control.
Show
Lua
set_control_caption(name, caption)
Argument name - control Key caption - text to display
Type string string
Example
"button001"
"On"
Example: set_control_caption("button001", "On") -- set button001's caption to "On"
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set TPC Page
Change the page on a TPC interface.
Show
Lua
set_interface_page(number)
- 404 -
Argument number
Type integer
Example
4
Example: set_interface_page(4) -- change the page on the TPC's interface to page 4
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Disable Page
Disable the TPC touchscreen.
Show
Lua
set_interface_enabled([enable])
Argument enable
Type boolean (default true)
Example true
Example: set_interface_enabled(false) -- disable the TPC's touch screen set_interface_enabled() -- enable the TPC's touch screen
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Lock TPC
Lock the TPC (requires Lock code to be set within Interface).
Show
Lua
set_interface_locked([lock])
Argument Type Example
- 405 -
API v1
Pharos Designer User Manual lock boolean (default true) true
Example: set_interface_enabled(false) -- disable the TPC's touch screen set_interface_enabled() -- enable the TPC's touch screen
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Transition Content Target
Move or rotate a Content Target.
Show
Lua
get_content_target(compositionNum, type)
:transition_rotation([offset], [count], [period], [delay], [useShortestPath])
:transition_x_position([offset], [count], [period], [delay])
:transition_y_position([offset], [count], [period], [delay])
Argument compositionNum type offset count period delay useShortestPath
Type Example integer 1
PRIMARY, SECONDARY, OVERLAY_1, OVERLAY_2 PRIMARY integer integer integer integer boolean (default false)
10
1
5
0 false
Example: tar = get_composition_target(1,PRIMARY) tar:transition_x_position(10,1,5) -- Move 10 pixels right in 5 seconds tar:transition_y_position(10,1,5) -- Move 10 pixels down in 5 seconds tar:transition_rotation(90,1,5) -- Rotate by 90 degrees in 5 seconds
- 406 -
API v1
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Beacon Controller
Beacons the controller (flashes Status LEDs or screen).
Show
Lua
Not currently available.
HTTP
POST /api/beacon
JavaScript
toggle_beacon(callback)
Example:
Query.toggle_beacon()
Output To Log
Writes a message to the controller's Log.
Show
Lua
log([level, ]message)
Argument level
Type option (LOG_DEBUG, LOG_TERSE, LOG_NORMAL, LOG_EXTENDED,
LOG_VERBOSE, LOG_CRITICAL, default LOG_NORMAL) message string
Example: log(LOG_CRITICAL, "This is a criticial message!") -- logs the message at Critical log level log("This is a normal message.") -- logs the message at Normal log level.
Example
LOG_
CRITICAL
"Some message to log."
- 407 -
Pharos Designer User Manual
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Send Variables To Web Interface
Sends data to the web interface in a JSON Object.
Show
Lua
push_to_web(name, value)
Argument name value
Type string
Example
"myVar" variable "Some value"
Example: myVar = 15 push_to_web("myVar", myVar) -- will push the object {"myVar": 15}
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Park A Channel
Parks an output channel at a specified level.
Show
Lua
Universe:park(channel, value)
Argument
Universe channel value
Type
integer (1-512) integer (0-255)
Example get_dmx_universe(1)
1
128
Example:
- 408 -
API v1 get_dmx_universe(1):park(1,128) -- Park channel 1 of DMX Universe 1 at 128 (50%)
HTTP
POST /api/channel
{
"universe": universeKey,
"channels": channelList,
"level": level
}
Argument universeKey channelList value
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512) integer (0-255)
Example
"dmx:1"
"1-3,5"
128
JavaScript
park_channel({ "universe": universeKey, "channels": channelList, "level": level }, callback)
Argument universeKey channelList value
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512) integer (0-255)
Example
"dmx:1"
"1-3,5"
128
Example: park_channel({ "universe": "dmx:1","channels": 1, "level":128}); // Park channel
1 of DMX Universe 1 at 128 (50%)
Unpark A Channel
Unparks an output channel.
Show
Lua
Universe:unpark(channel)
- 409 -
Pharos Designer User Manual
Argument
Universe channel
Type
integer (1-512)
Example get_dmx_universe(1)
1
Example: get_dmx_universe(1):unpark(1) -- Unpark channel 1 of DMX Universe 1 (it will go back to normal output levels)
HTTP
POST /api/channel
{
"universe": universeKey,
"channels": channelList
}
Argument universeKey channelList
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512)
Example
"dmx:1"
"1-3,5"
JavaScript
park_channel({ "universe": universeKey, "channels": channelList }, callback)
Argument universeKey channelList
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512)
Example
"dmx:1"
"1-3,5"
Example: park_channel({ "universe": "dmx:1","channels": 1}); //Unpark channel 1 of DMX Universe 1 (it will go back to normal output levels)
Set Timeline Source Bus
Set the time source for a timeline.
Show
Lua
Timeline:set_default_source()
- 410 -
Timeline:set_timecode_source(timecodeBus[, offset])
Timeline:set_audio_source(audioBus, band, channel[,peak])
Argument
Timeline timecodeBus audioBus band channel peak
Type
Timeline Object
TCODE_1 ... TCODE_6
AUDIO_1 ... AUDIO_4 integer (0=volume)
LEFT, RIGHT or COMBINED boolean (default false)
Example get_timeline(1)
TCODE_1
AUDIO_1
0
LEFT false
Example: get_timeline(1):set_timecode_source(TCODE_1) -- Set the timecode source of timeline 1 to timecode bus 1
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Enable Timecode Bus
Enables or disables a timecode bus.
Show
Lua
set_timecode_bus_enabled(bus[, enable]) l l bus is the timecode bus to enable or disable (TCODE_1 ... TCODE_6) enable determines whether the bus should be enabled or disabled (boolean, default true)
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
API Objects
Below are the helper functions and objects in theproject.
show
API v1
- 411 -
Pharos Designer User Manual
Variant
A Lua object that allows a type and range to be associated with a variable.
Show
Lua
See
HTTP
Not currently available.
JavaScript
Not currently available.
DateTime
A Lua object containing time data.
Show
Lua
The DateTime object contains the following properties:
Property
.year
.month
.monthday
Return Type integer integer (0-11) 5 integer (0-30) 8
Return Example
2017
.weekday
.hour
.minute
.second
.utc_timestamp
.time_string
integer(0-6) integer(0-23) integer string
1
13 integer (0-59) 21 integer (0-59) 46
1494249706
.date_string
string
HTTP
Not currently available.
JavaScript
Not currently available.
Printing An Enum
Lua functions to convert integers returned from some functions as text.
Show
Lua
digital_input_to_string() button_state_to_string()
- 412 -
Examples: log(digital_input_to_string(get_input(1))) str = button_state_to_string(get_bps(1):get_state(1))
HTTP
Not currently available.
JavaScript
Not currently available.
API v1
- 413 -
Download
Advertisement
Key features
Intuitive graphical interface
Timeline programming for advanced lighting and show control
Trigger definition to connect programming with the real world
Simulation mode for testing programming
Network management for connected hardware
Frequently asked questions
Yes, you can have multiple versions of Designer on your computer. However, you will need to make sure that you are using the correct version for your project.
The number of timelines and fixtures you can program is dependent on the hardware you are using. Refer to the hardware documentation for specific capacity information.
If you need a fixture that isn't in the library, you can create a custom fixture by entering the DMX commands manually.