Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: deep6ixed 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?
-
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.
-
Thanks for the clarification, I was assuming that they set and stayed that way unless something changed.
-
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.