Coding Motor Connection Check

I’m only really knowledge able on how to use block code but am willing to use text if someone would be willing to help me out. I’m trying to code a full system connection check display screen, where the user can check and see what motors or sensors are connected and display their output and change a label color to red if their disconnected and green if connected. Does anyone know how you could accomplish this via block code, could help me with a place to start for switch blocks, or give me some pointers on how best to go about this. Thank you.

Default VEX V5 C++ API has, at the very least, motor.installed() function to check if motor is connected. I am not sure if there are any accessible undocumented functions which could give you more information regarding port status.

Then, this may a bit to steep of a climb from the block code, but an alternative to the default V5 development environment is Pros, which provides extended API and has more functionality to test for connected device status (see VEX Generic Device C API (For Advanced Users) module | PROS for V5)

Over the years people have developed a number of V5 Motor Testers based on that API with source code available on GitHub: example 1, example 2, example 3

For V5 Python you could do something like this.

brain.screen.set_font(FontType.MONO15)

for port in range(Ports.PORT1, Ports.PORT22):
    if Motor(port).installed():
        brain.screen.print("Motor %2d found"%(port+1))
        brain.screen.new_line();

I would avoid putting that in a loop or calling too often