Skip to main content

PSP Examples

Usage

When templates are loaded onto the terminal, screens can be accessed using PSP or CPS through UI request calls. The screen type should be set to 'template,' and the template layout name must be specified as a property.

The below examples all use this template code.

templateName: "my-first-screen"
elements {
name: "my-label"
value: "text"
colorRef: "title"
label {
font: "OpenSans"
fontSize: 24
fontStyle: BOLD
textAlignment: CENTER
}
}
info

The 0️⃣ characters below are NULL values i.e Hex 00. This is the format of the PSP messages, but there is no specific symbol this.

Change Element Value

To change the value, call the element with comp. prefix and value .value suffix in the properties with the new value as a String.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.value0️⃣Hello this is a new message0️⃣

converted to Hex and added to a valid UI Command:

CC593C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E76616C75650048656C6C6F20746869732069732061206E6577206D65737361676500DE

Change Element Position

To change the text call the element with comp. prefix and value .x and/or .y` suffix in the properties with the new coordinates.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.x0️⃣500️⃣

converted to Hex and added to a valid UI Command:

CC3C3C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E7800353000C9

Change Element Opacity

To change the opacity, call the element with comp. prefix and value .opacity suffix in the properties with the new opacity.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.opacity0️⃣500️⃣

converted to Hex and added to a valid UI Command:

CC423C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E6F7061636974790035300050

Hide Element

To hide an element, call the element with comp. prefix and value .hide suffix in the properties with the value set to true.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.hide0️⃣true0️⃣

converted to Hex and added to a valid UI Command:

CC423C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E646973686964650074727565008C

Disable Element

To set an element to disable state, call the element with comp. prefix and value .disable suffix in the properties with the value set to true.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.disable0️⃣true0️⃣

converted to Hex and added to a valid UI Command:

CC443C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E64697361626C6500747275650088

Change Element Color

To change an element's color, use the comp. prefix followed by the element name and the .color suffix. Set the property value to the desired color. On label type elements this will change the text color. On all the other elements it will apply the color on the background.

type0️⃣template0️⃣template0️⃣my-first-screen0️⃣comp.my-label.color0️⃣00ff000️⃣

converted to Hex and added to a valid UI Command:

CC443C28747970650074656D706C6174650074656D706C617465006D792D66697273742D73637265656E00636F6D702E6D792D6C6162656C2E636F6C6F7200303066663030009F