Use the Ping library in Lua to check whether a device is reachable on the network.
Note: The Lua Ping library requires that you run Q-SYS Designer as administrator ("Run as administrator" option in Windows) when emulating your design. If you see a non-terminating "Socket failed to open" error message in the debug window, re-launch Designer as administrator.
Create a new ping object.
Ping.New("target_host")
target_host : The hostname to ping.
ping_object = Ping.New("www.qsc.com")
Begin the ping session.
start(single_shot)
single_shot : Bool. Set to true if you want only a single ping attempt.
ping_object:start(false)
Stop the ping session.
stop()
ping_object:stop()
Set the timeout for waiting for a ping response.
setTimeoutInterval(interval)
interval : Double. The timeout duration, in seconds.
ping_object:setTimeoutInterval(10.0)
Set the interval for retrying after a ping request.
setPingInterval(interval)
interval : Double. The interval duration, in seconds.
ping_object:setPingInterval(10.0)
Assign a Lua callback for successful ping events.
ElapsedTime : Long. The amount of time for the ping to occur, in microseconds.
HostName : String. The hostname that was pinged.
ping_object.EventHandler = function(response) print(response.HostName) print(response.ElapsedTime) end
Assign a Lua callback for unsuccessful ping events.
Error : String. The description of the error.
HostName : String. The hostname that was pinged.
ping_object.ErrorHandler = function(response) print(response.HostName) print(response.Error) end
Software and Firmware | Resources | QSC Self Help Portal | Q-SYS Help Feedback
Copyright © 2019 QSC, LLC. Click here for trademark and other legal notices. | Q-SYS 8.1.1