- /* PROTOCOL_V5 has RECORD:FRAMES?, but this seems to return the
- * maximum that should be captured, not the current amount. If
- * we can figure out how to get the current number of frames,
- * or when we've hit the last one, adding support for this will
- * be possible as well.
- */
- sr_scpi_get_int(sdi->conn, "FUNC:WREP:FEND?", &frames);
+ if (sr_scpi_get_int(sdi->conn,
+ protocol == PROTOCOL_V4 ? "FUNC:WREP:FEND?" :
+ "FUNC:WREP:FMAX?", &frames) != SR_OK)
+ return SR_ERR;