Active Switch Test ?

26 views
Skip to first unread message

Jason McNally

unread,
Jan 3, 2026, 8:24:49 PM (8 days ago) Jan 3
to MPF Users
Have been using MPF for a while now with the basic diagnostics via the door menu displayed on my games alpha/numeric displays. Currently I only have the single switch test, but would also like to have an "all active" switch test to list out the currently closed switches, say for example to show all the balls are being detected in the ball trough. Is there such a thing for MPF or has someone written some code for it? All the best to all in the group for 2026! Thanks!!

Philip Dixon

unread,
Jan 4, 2026, 8:58:43 AM (7 days ago) Jan 4
to MPF Users
heres my active switch which is part of my service menu. Not sure if this will be of any help but feel free to copy or change if you need it.
service_tests_active_switches.zip

Jason Brands

unread,
Jan 4, 2026, 9:26:16 AM (7 days ago) Jan 4
to MPF Users
This probably isn't what you're looking for, because it's not part of the media controller display, but I've done my basic switch tests just using MPF without the -t option.  Active switches are highlighted.switches.png

Anthony van Winkle

unread,
Jan 4, 2026, 7:18:33 PM (7 days ago) Jan 4
to MPF Users
Active switch tests do exist, but doing it via alpha/numeric display will be a whole separate challenge.

A BCP client (e.g. GMC or MPF-MC) can send the command "list_switches" to get a full list of all switches on the machine and their states, which would typically be parsed by the client to render something on the display. 

If not using an existing BCP client, you'll need to write some custom code to get the list of switches. You can get the raw list from self.machine.switches.values(), or through the service mode for a mapped (and optionally sorted) list of switches with self.machine.service.get_switch_map(sorted). You can loop through the switches and find all the ones with an active state, and determine the best way to display/cycle them on your alphanumerics.

Hope that helps!
Reply all
Reply to author
Forward
0 new messages