Integrated Encoders With Multiple Motors

I’m curious about how I would go about programming this scenario:

Our robot has two motors connected to a single port using a Y-Cable, but both motors have an integrated encoder module attached. How would I setup the Motors and Sensors Setup/pragma? How do I then reference these encoders? Can I reference them without making any reference to the motors that they are attached to?

Once I understand how to reference these encoders properly, I can program the rest from there. I just need the little beginning bits to figure this out.

Any help would be great. Thanks!

You can read the value of each encoder using the SensorValue function with the sensor name (which will be I2C_1, I2C_2 etc. or you can name them in the I2C sensors tab, part of motors&sensors setup dialog), nMotorEncoder will only work with the encoder assigned to the motor port. As the motors are connected using a Y cable, you cannot control them independently, so in practice the second encoder will have very limited use.