How to use mkr 485 shield on Portenta H7's M4core

I want to read out a device through Modbus communication with a mkr 485 shield and the M4 of the Portenta H7.

When i insert the line #include <ArduinoRS485.h> i have
...Documents\Arduino\progs\libraries\ArduinoRS485\src\RS485.cpp:189:18: error: 'SERIAL_PORT_HARDWARE' was not declared in this scope
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS485_DEFAULT_DE_PIN, RS485_DEFAULT_RE_PIN);

How can i fix this?

It seems a known issue and don't fix yet. You can find a possible workaround in this thread: