IMU numbering when using external AHRS

Hi all,

I am currently developing a driver for an external IMU system (Anello Photonics X3).

I have gone the route of implementing this as an External AHRS by creating a new ExternalAHRS_backend instance. The Pixhawk 4, running my fork of v4.7.0dev, registers the data transmitted by the device in that rolling, pitching, and yawing with the X3 is reflected by the atti/heading display in QGC.

However, this only works sometimes, and I suspect it has to do with the way that the IMUs are numbered. I understand that the ordering in hwdef is what determines which is IMU 1, etc, but my question is: how is the numbering affected when using an external AHRS? Is there any way to reliably nail down the external IMU as a certain number to force the system to use it exclusively?

Thanks,
Gordon