When specifying a device in GP-Pro EX, selecting a symbol name also selects the connected device/PLC. In the device access API, you need to also define the connected device/PLC name.
For example,
ReadDevice 16("#WinGP","PLC.1Valve", Data,10);
Device access API cannot use indirect devices.