Using GPI/O devices in Helm

Helm supports various GPI/O devices, allowing panels to control external legacy equipment, and to receive status and tallies from external equipment.

Output Controls

Control of GPI/O Outputs is straightfoward. Each GPI device provides commands to turn outputs on and off, and to pulse outputs.

From Lua:

H.Device:SwitchOn(1) -- Switch output 1 on
H.Device:SwitchOff() - Switch output 2 off
H.Device:PulseOn(3, 100) - Pulse output 3 on  for 100ms, then off
H.Device:PulseOff(3, 100) - Pulse output 3 off  for 100ms, then back off

You can read the current state of the outputs using the OutputState property. This is a string of 1’s and 0’s – Note this is least-significant bit first, to allow for large GPI devices and easy indexing.

An OnOutputStateChange event occurs whenever the state changes. This will also occur when the panel starts up.

Input Events

Each input line has an associated OnInputXOn and OnInputXOff event, allowing scripts for a particular line to be easily isolated.

As above, there is also an InputState property, and an OnInputStateChange event .

To access individual ‘bits’ from the InputState or OutputState, the following Lua function may be used.

function bit(s,v)
  return s:sub(v,v) == '1'
end

-- Example use, to check input 4.

if bit(H.BFE.InputState, 4) then H.LABEL.Text = "Pressed!" 

 

 

 

 

 

 

 

Privacy Preference Center

Essential

These cookies are required for technical reasons in order for this website to work, for example in order to login as a registered user and to speed up load times.

gdpr,__cfduid,wf_loginalerted_,wfwaf-authcookie-,wordpress_logged_in_,wordpress_sec_

Performance

These cookies enable us to track and monitor the interests of visitors to our website. We use this information to better understand how our website is being used and improve the user experience.

_gat1,_ga,_gid

External content

When you visit some pages that contain videos hosted on external sites these sites will set temporary cookies to provide this content.

ASP.NET_SessionId