Hi. Is it possible to return encoder status via command line prompt for SAMCast and / or SAMBC???
Perhaps there is a better way?
Not sure if this qualifies as a better way, but at least it is one way:
- Create a PAL Script and make it autostart
- In said script, use PAL.Loop := True; to make the script repeat itself
- Also use PAL.WaitForEvent('encoderstatus'); in order to trigger the script from outside of SAM
- You can't change the response to the event trigger, but you can tell SAM to write the Encoder status to a file every time the event is triggered.
var I : Integer;
PAL.Loop := True;
for I := 0 to Encoders.Count-1 do
if Encoders[I].Started then
- Trigger the Event from outside of SAM using an HTTP client (The CMD.exe shell in Windows does not have a built-in command for that, but you can use the PowerShell Module Invoke-WebRequest that comes preinstalled on Windows 8 onwards - `iwr http://localhost:1221/events/encoderstatus` in the above example)
Note: I've got no idea what is included in StatusLong nor is it documented in the PAL Scripting Reference.