You could try using vexRT[AccelXXmtr2], vexRT[AccelYXmtr2], or vexRT[AccelZXmtr2] to detect movement (or any value at all) from the secondary joystick to see if it’s connected.
It also appears that in the RobotCIntrinsics.c file, located in the Includes Directory, there is an Enumeration, with these Intrincs, nVexRCReceiveState, opcdSourceSystem, kSystemVEXRCReceiveState.
If you Mask OFF the top 5 Bits, the result will be:
Zero for no Controllers
One for One Controller, or
Two for Two Controllers
I don’t know without compiling some Code, if One or All Three have the same Values…
This test requires no Inputs at all, from any of the Joysticks…
I saw Jesse’s answer, however, I did test the variable with a partner joystick and it works as I described (under ROBOTC 3.04). You can also observe this under the system parameters debug window where the variable is also displayed.