Hello Opto 22 community,
I’m working with the groov EPIC REST API and have a question about how the qualityMask parameter in /api/v1/io/{device}/modules/quality behaves with empty module slots.
According to the API documentation (swagger.yaml), the qualityMask description states:
- “A bit will be set if any channel on the corresponding module has an error condition”
- “A bit will also be set if a module is not present in the corresponding slot on the rack”
My question is: What is the exact behavior when slots are empty?
Specifically:
-
Do ALL empty slots set their corresponding bits to 1 in the qualityMask?
- For example, if I only have a module in slot 0, are bits 1-15 all set to 1 (representing empty slots)?
- Or is there a different logic for which empty slots set their bits?
-
What’s the recommended approach to distinguish between:
- A bit set due to an actual module error
- A bit set due to an empty slot
-
Should I cross-reference with /api/v1/io/{device}/modules/type to check if a slot index exists in that array before considering a set bit as an error?
I’m implementing health monitoring logic and need to accurately detect when installed modules have quality issues versus when slots are simply empty. Any clarification or examples from your experience would be greatly appreciated!
Thanks in advance for your help.
the api call for module quality is just a bit mask, so yes, it will either be a 0 or a 1 if the module a module is present or not. I agree this could be a bit misleading, as empty and quality error register the same. A better call would be to to use the /api/v1/io/{device}/modules/{moduleIndex}/channels/{channelIndex}/analog/status
This will return the exact status of a requested channel.
Normally Operating channel:{"modelType":"AnalogChannelRead","moduleIndex":1,"channelIndex":0,"qualityDetail":0,"value":0,"minValue":0,"maxValue":0}
Channel with Quality error:
{"modelType":"AnalogChannelRead","moduleIndex":1,"channelIndex":0,"qualityDetail":6,"value":null,"minValue":20,"maxValue":4}
Table from the user’s guide on channel quality:
Coordinating that with the module quality bit mask will let you know which slots have a module.
Hi @greichert,
Thanks a lot for your reply and for the additional details about using the channel-level analog status. That part is clear.
I still need to understand one very specific point about the module qualityMask behavior with empty slots, because I want to implement the correct logic in my health-monitoring code.
Let me restate the exact question with a concrete example:
On a 16-slot chassis, with only 1 module installed in slot 0, what is the value of the qualityMask?
More precisely:
Do all empty slots automatically set their bit to 1, meaning the mask would look like:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Which corresponds to the integer value 65534 ?
I’ll be cross-checking module presence using:
GET /manage/api/v1/io/local/modules/info
This way I can determine whether a bit=1 means:
But before implementing that logic, I really need confirmation of the expected raw qualityMask value in the simple case “1 module in slot 0, all other slots empty”.
Could you confirm whether the mask should indeed be 0111111111111111 (binary) for that scenario, or whether the API behaves differently?
Thanks again for your help 
I have 4 modules in the first 4 positions on a groov Epic, that API returns 65520 or 1111111111110000 binary when executed
Alright ! Thanks again for your help folks !