Arduino OPTA, read status of relay

I have an Arduino Opta with two digital expansion boards. I am able to use digitalWrite to set the relays closed or open. However, on a wifi connection made with the board, I want to be able to get the status' of all of the relays but I read the entirety of the docs and have found no way to read this. Does anyone know how?

Here is my setting the relays

    DigitalStSolidExpansion expansion_module1 = OptaController.getExpansion(0);
    expansion_module1.digitalWrite(relayId, onOff ? HIGH : LOW);
    expansion_module1.updateDigitalOutputs();

and here is my failed attempt to read, because I am reading the I1-I16 inputs instead of the digital relays

  DigitalStSolidExpansion expansion_module2 = OptaController.getExpansion(1);
  expansion_module2.updateDigitalInputs();

  for (int i = 0; i < 8; i++) {
    PinStatus v = expansion_module2.digitalRead(i, true);
    relayStates[i + 8] = (v == HIGH);
  }

I also tried to read the status LEDs but there doesnt seem to be a way to read those either, only set.

Welcome to the forum

I have no experience of the board but can't you just set the value of a variable to indicate the status of the relay, perhaps true if on and false if off, then read the value of that variable ?

omg, this is so obvious. On my previous system, I had an RTU and a PC where the PC might restart but the RTU relays could still stay open/closed. Now that I am using a single unit, i can just keep track..... thank you so much. one of those situations where I missed the forest for the trees

I am glad that I could help

Sometimes it is neccesary to directly read the digital outputs. E.g. if you use the OPTA in a PLC application, a parallel task could modify the outputs and you need access to the outputs states inside the sketch.
In addition to the .digitalRead(digital_input_pin) function the 'Arduino_Opta_Blueprint' library includes the .digitalOutRead(relay_output_pin) function and the constant OPTA_DIGITAL_OUT_NUM for the number of outputs available.

Example:

#include "OptaBlue.h"

...
DigitalMechExpansion mechExp = OptaController.getExpansion(0); 

if(mechExp) {
    for(int k = 0; k < OPTA_DIGITAL_OUT_NUM; k++) {
        /* this will return the pin status of the pin k */
        PinStatus v = mechExp.digitalOutRead(k);

        if(v == HIGH) {
            Serial.print("HH");
        }
        else {
            Serial.print("LL");
        }
        Serial.print(' ');
    }

    Serial.println();
}
...