Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on May 14, 2024, 10:46:09 AM
-
Is there a way to programmatically determine how many discrete outputs exist?
If no expansion modules, Y0-Y3. If only an 8 pt expansion module add Y8-15. If 16 pt expansion module instead then Y8-23 also exist.
Not the same as DATAINFO for block size, but actual initialized quantity is what I'm after.
-
Is there a way to programmatically determine how many discrete outputs exist?
If no expansion modules, Y0-Y3. If only an 8 pt expansion module add Y8-15. If 16 pt expansion module instead then Y8-23 also exist.
Not the same as DATAINFO for block size, but actual initialized quantity is what I'm after.
Not at present. The closest you could get is using HWINFO to determine what hardware is present and do the math.
-
Not a bad solution at all, thanks!
-
If you are wanting to map it to the Y IDs, realize that if the count does not cause bits to be BYTE aligned, they are PADDED to the nearest WHOLE BYTE. So the Slot 0 Y count is 4, but that doesn't mean that the first module's ID starts at Y4 (where onboard's 4 Y's are Y0 thru Y3). That module actually starts at Y8 because the onboard eats up 8 (or 16 or 24 or 32) regardless of the physical count (HWINFO reports ACTUAL screw-head Y counts). Hence, you have to do some MATH. You have to adjust the counts as you go, (adjusted slot 0 + adjusted slot 1 + adjusted slot 2), not at the end (can't just adjust (slot 0 + slot 1 + slot 2).
Another caveat if you are looking for ID calculations is if you use Manual Mapping - you could have an expansion module start at Y400! That info is not available.