News:

  • September 23, 2026, 10:14:03 AM

Login with username, password and session length

Author Topic: MSREGWR Run Every Scan  (Read 9810 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
MSREGWR Run Every Scan
« on: March 09, 2022, 02:40:51 PM »
What's the feasibility of adding the option to allow MSREGWR to run every scan instead of edge triggered only?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: MSREGWR Run Every Scan
« Reply #1 on: March 09, 2022, 02:52:33 PM »
What's the feasibility of adding the option to allow MSREGWR to run every scan instead of edge triggered only?
MRX/MWX already has all the flexibility you "need".  But the whole purpose of the Modbus I/O Scanner was to take care of doing all of that "polling" from a single configuration (vs. a bunch of MRX/MWX logic), then doing exceptions using MSREGRD/MSREGWR.

If you truly need it to be polled every scan, make it part of the Modbus I/O Scanner.  That's what it's for.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: MSREGWR Run Every Scan
« Reply #2 on: March 09, 2022, 03:44:17 PM »
Let me pose a use case and you guys tell me a better way to deal with the issue.

I can see the Modbus Scanner being extremely useful. One issue I'm seeing is in attempting to use the scanner with a slave device that sometimes you would like to be able to locally control in a non-slave mode. If the writes are set up in the scanner, any local edits made to the device are immediately overwritten by the scanner utility. I agree, using the MSREGWR or the MWX is not ideal (as the scanner is meant to "just handle") the comms. What I'm looking for is a way to start and/or stop and/or one-shot the write portion when desired. 

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: MSREGWR Run Every Scan
« Reply #3 on: March 09, 2022, 04:20:11 PM »
Look at the specific Modbus Scanner Structure Heap Item and look at the .EnableWrites bit.

I think that's what you want.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: MSREGWR Run Every Scan
« Reply #4 on: March 10, 2022, 08:07:01 AM »
.EnableWrites is what I was looking for. Obviously I forgot to check the scanner heap.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: MSREGWR Run Every Scan
« Reply #5 on: March 10, 2022, 09:10:25 AM »
Attached is a screen shot of all the fields in a Modbus Scanner Device.  They also show up in the Modbus Scanner Monitor tool (under the Debug menu).  The Help topic DMD0493 Modbus I/O Scanner Configuration talks about those fields.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: MSREGWR Run Every Scan
« Reply #6 on: March 10, 2022, 05:23:22 PM »
I like that the status display is editable -- enabling and disabling reads and writes, shortcut to edit the device, etc.   Useful for debugging the comms.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.