News:

  • September 25, 2026, 03:53:20 PM

Login with username, password and session length

Author Topic: Reading installed I/O from program  (Read 7472 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Reading installed I/O from program
« on: September 22, 2023, 02:34:05 PM »
I have a program that has Modbus remote I/O configured and can be used with either native (local) I/O or the Modbus distributed I/O with no program mod or configuration.    I solve the logic to Y32-Ynnn and use that as the source for the Modbus slave devices.    Whichever is hooked up gets the the data and the program doesn't care.   Now I want to do something if and only if I'm using Modbus slaves but I'd like not to have anything to have to configure in the program so I don't forget to do it while commissioning (Old timer's disease).   Is there a way for the program to read what I/O is installed locally, so if not I can do the thing?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Reading installed I/O from program
« Reply #1 on: September 22, 2023, 03:38:07 PM »
HWINFO can read a base/slot's module ID.  I/O counts too.  Coming soon, I/O addresses.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Reading installed I/O from program
« Reply #2 on: September 22, 2023, 04:04:20 PM »
Awesome, thx!    I was also thinking of looking for no change in .XferCount on the relevant MTCP I/O node, but only enabling the watchdog for that on having .XferCount be >50 or something.   At native sites, .XferCount should be 0, so it would disable the watchdog.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.