Implement condition register in Questionable register set
| | |
| | | scpi_result_t SCPI_SystemErrorNextQ(scpi_t * context); |
| | | scpi_result_t SCPI_SystemErrorCountQ(scpi_t * context); |
| | | scpi_result_t SCPI_StatusQuestionableEventQ(scpi_t * context); |
| | | scpi_result_t SCPI_StatusQuestionableConditionQ(scpi_t * context); |
| | | scpi_result_t SCPI_StatusQuestionableEnableQ(scpi_t * context); |
| | | scpi_result_t SCPI_StatusQuestionableEnable(scpi_t * context); |
| | | scpi_result_t SCPI_StatusOperationConditionQ(scpi_t * context); |
| | |
| | | SCPI_REG_OPERC, /* OPERation Status Condition Register */ |
| | | SCPI_REG_QUES, /* QUEStionable status register */ |
| | | SCPI_REG_QUESE, /* QUEStionable status Enable Register */ |
| | | SCPI_REG_QUESC, /* QUEStionable status Condition Register |
| | | |
| | | /* last definition - number of registers */ |
| | | SCPI_REG_COUNT |
| | |
| | | case SCPI_REG_QUESE: |
| | | regUpdate(context, SCPI_REG_QUES); |
| | | break; |
| | | case SCPI_REG_QUESC: |
| | | regUpdateEvent(context, old_val, val, SCPI_REG_QUES); |
| | | break; |
| | | case SCPI_REG_OPER: |
| | | regUpdateSTB(context, val, SCPI_REG_OPERE, STB_OPS); |
| | | break; |
| | |
| | | } |
| | | |
| | | /** |
| | | * STATus:QUEStionable:CONDition? |
| | | * @param context |
| | | * @return |
| | | */ |
| | | scpi_result_t SCPI_StatusQuestionableConditionQ(scpi_t * context) { |
| | | /* return value */ |
| | | SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_QUESC)); |
| | | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * STATus:QUEStionable[:EVENt]? |
| | | * @param context |
| | | * @return |
| | |
| | | { .pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,}, |
| | | |
| | | { .pattern = "STATus:QUEStionable[:EVENt]?", .callback = SCPI_StatusQuestionableEventQ,}, |
| | | { .pattern = "STATus:QUEStionable:CONDition?", .callback = SCPI_Status_QuestionableConditionQ,}, |
| | | { .pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,}, |
| | | { .pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,}, |
| | | |
| | |
| | | TEST_IEEE4882("STATus:QUEStionable:ENABle 2\r\n", ""); |
| | | TEST_IEEE4882_REG(SCPI_REG_QUESE, 2); |
| | | |
| | | EST_IEEE4882("STATus:QUEStionable:CONDition?\r\n", "0\r\n"); |
| | | TEST_IEEE4882_REG_SET(SCPI_REG_QUESC, 1); |
| | | TEST_IEEE4882("STATus:QUEStionable:CONDition?\r\n", "1\r\n"); |
| | | TEST_IEEE4882("STATus:QUEStionable:EVENt?\r\n", "1\r\n"); |
| | | TEST_IEEE4882_REG_SET(SCPI_REG_QUESC, 0); |
| | | TEST_IEEE4882("STATus:QUEStionable:CONDition?\r\n", "0\r\n"); |
| | | TEST_IEEE4882("STATus:QUEStionable:EVENt?\r\n", "0\r\n"); |
| | | TEST_IEEE4882_REG_SET(SCPI_REG_QUES, 1); |
| | | TEST_IEEE4882("STATus:QUEStionable:EVENt?\r\n", "1\r\n"); |
| | |
| | | TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "0\r\n"); |
| | | TEST_IEEE4882_REG_SET(SCPI_REG_OPERC, 1); |
| | | TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "1\r\n"); |
| | | TEST_IEEE4882_REG(SCPI_REG_OPERC, 1); |
| | | TEST_IEEE4882("STATus:OPERation:EVENt?\r\n", "1\r\n"); |
| | | TEST_IEEE4882_REG_SET(SCPI_REG_OPERC, 0); |
| | | TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "0\r\n"); |