Reading current motor speed, opOutput_Read I'm trying to read current motor speed using direct command:

Instruction        opOutput_Read (LAYER, NO, *SPEED, *TACHO)
Opcode             0xA8
Arguments          (Data8) LAYER – Specify chain layer number [0 - 3]
                   (Data8) NO – Port number [0 - 3]
                   (Data8) *SPEED – Output speed level detected, [-100 - 100]
                   (Data32) *TACHO – Current output tacho count


When I'm sending something like this:

unsigned char opOutput_Read[]
{
    0x0A, 0x00,              // bytes in message
    0x00, 0x00,              // message counter
    DIRECT_COMMAND_REPLY,    // tt   = Direct command with reply
    0x02, 0x00,              // 2 values will be returned
    0xA8,                    // opOutput_Read,
    GV0(0),                  // speed in return
    GV2(1)                   // tacho in return
};


I'm getting DIRECT_REPLY_ERROR. What am I doing wrong?
The TACHO parameter is 4 bytes (32 bits).

(Data32) *TACHO – Current output tacho count


However, you have only allocated it 2 bytes (16 bits)

GV2(1)                   // tacho in return


Try using GV4 instead of GV2.