How to read a port by a label in Mplab Harmony?
If you give the port a name and a function and generate code... example...



You'll noticed that in system_config.h harmony only creates the following

/*** Functions for MY_TEST_PIN pin ***/
#define MY_TEST_PIN_PORT PORT_CHANNEL_E
#define MY_TEST_PIN_PIN PORTS_BIT_POS_6
#define MY_TEST_PIN_PIN_MASK (0x1 &lt;&lt; 6)


which can be used as your parameters for PLIB_PORTS_PinGet, i.e.

PLIB_PORTS_PinGet (PORTS_ID_0, MY_TEST_PIN_PORT, MY_TEST_PIN_PIN)

You should probably define that in your application app.h to make it simpler

#define GET_MY_TEST_PIN() PLIB_PORTS_PinGet (PORTS_ID_0, MY_TEST_PIN_PORT, MY_TEST_PIN_PIN)

then somewhere where you want to get the pin value...

unsigned char MY_TEST_PIN_VALUE = GET_MY_TEST_PIN();