Screen Script
  • 12 Jun 2024
  • 1 Minute to read

Screen Script


Article summary

Run a screen script to set CX Portal statuses for the connected screen, instead of using a RS-232 or network protocol connection.

Screen Status

Set a screen status of the given type in the CX Portal.

Screen.AddStatus("status type", "value")

Status type can be one of the following:

Status Type
Type
Description
Example
DisplayUnit
String
Status for the entire screen (ok, warning, error).
Screen.AddStatus("DisplayUnit", "ok")
DisplayUnitPower
String
Power status for the screen (off, on).
Screen.AddStatus("DisplayUnitPower", "off")
Temperature
Integer
A reading from a temperature sensor.
Screen.AddStatus("Temperature", "46")
TemperatureError
Bool
Set if the temperature is too high (true, false).
Screen.AddStatus("TemperatureError", "true")
FanError
Bool
Set if the screen fan has an issue (true, false).
Screen.AddStatus("FanError", "true")
Input
Bool
Set if the screen has any inputs (true, false).
Screen.AddStatus("Input", "false")
Current
Float
Value in amps (A).
Screen.AddStatus("Current", "0.9")
Voltage
Float
Value in volts (V).
Screen.AddStatus("Voltage", "229.4")
ExternalTemperature
Integer
A reading from an external temperature sensor.
Screen.AddStatus("ExternalTemperature", "22")
ExternalTemperatureError
Bool
Set if the external temperature is too high (true, false).
Screen.AddStatus("ExternalTemperatureError", "true")
Brightness
Integer
Brightness value (percentage)
Screen.AddStatus("Brightness", "70")
Contrast
Integer
Contrast value
Screen.AddStatus("Contrast", "70")
Color
Integer
Color value
Screen.AddStatus("Color", "70")
Sharpness
Integer
Sharpness value
Screen.AddStatus("Sharpness", "70")

Log

Log a message to the system log and CX Portal.

Screen.Log("message", "log level")

Log level can be one of the following:

  • debug (default)
  • info
  • notice
  • warning
  • error
  • critical
  • alert
  • emergency

Power  State

Get the power state of the screen.

Screen.PowerState()

Get Variable

Return the value of a specified variable from the CX Portal.

Screen.GetVariable("name")

Set Variable

Set the value of a specified variable. Variables can only be read from scripts running on the same screen.

Screen.SetVariable("name", "value")



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.