News:

  • June 29, 2026, 03:36:29 AM

Login with username, password and session length

Author Topic: MRX Instruction Question.  (Read 8561 times)

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
MRX Instruction Question.
« on: December 09, 2014, 06:22:15 AM »
I'm trying to self teach myself modbus using the Do-More, and so far I can set up a modbus simulator and both read and write to it using the Do-More simulator, but the question I have now, is why wont the On success or On Error bits change state when the instruction is set to continuous power flow?  They both are staying low.  Am I doing something wrong?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: MRX Instruction Question.
« Reply #1 on: December 09, 2014, 08:21:22 AM »
Since you are running them continuously, that means that they re-arm immediately.  That means that the OnSuccess and OnError bits will be on for 1 PLC scan.  On the simulator, this is much faster than 1 ms, let alone the low probability that the Ladder View status communication request will be processed exactly on that 1 scan.

What I like to do in situations like this is use the INC box with a differential contact driving it.  Actually, two of them, one that counts successes and one that counts failures/errors.

STRPD OnSuccessBit
INC D0  // OnSuccess count

STRPD OnErrorBit
INC D1  // OnError Count

Then, your incrementing status of D0 and D1 will give you good feedback as to the level of success and failure.

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
Re: MRX Instruction Question.
« Reply #2 on: December 09, 2014, 12:56:59 PM »
Thanks for the clarification, I was assuming that they set and stayed that way unless something changed.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: MRX Instruction Question.
« Reply #3 on: December 09, 2014, 04:51:16 PM »
Thanks for the clarification, I was assuming that they set and stayed that way unless something changed.

Every asynchronous instruction immediately clears the status bits upon latching the request. This is so that you can craft logic that can be sure that the rising edge of a result is due to the completion of the current request and not the lingering result of a prior request. This is mostly for single event instructions, but in recurrent instructions you may want to trigger post processing of the data after every successful read, so we pulse the results on for one scan.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO