daba said:
Some food for thought there, but missing the point that this may be a completely new program, freshly downloaded, and going into RUN mode.
daba,
What exactly have I missed with regard to a completely new program going into Run Mode? What's the difference between a programs initial Run Mode and any of its subsequent Run Modes?
An ONS storage bit can be set(1) or reset(0) before going to Run Mode. Either of these states are possible, whether going to an initial Run Mode, or a return to Run Mode. Usually for an initial program, an ONS storage bit will be at the default reset state when downloading to the controller for the first time, unless the programmer manually changed it, for some reason, to the set state in the offline program before downloading.
If it is initially downloaded as reset, then this state becomes its first retentive state when going to Run Mode. If it is initially downloaded as set, then this becomes its first retentive state when going to Run Mode. This is the same as a storage bit being set, or reset when leaving and then returning to Run Mode.
In relation to the state of an ONS storage bit, I don't see how a "completely new program, freshly downloaded, and going into RUN mode" is any different from an existing program going to Run Mode.
I'm going to clear the 1400 after lunch and download a blank, completely new program, with just Ron's rung of logic. I'll leave the input turned ON before going to Run Mode. What are the bets that the initial state of reset for the ONS storage bit allows the rung to execute on the first scan?
daba said:
...I think your notion of "retention" may be a bit misguided. All data is retentive by nature, the memory image will power-up in the same state that it was in when the power went off. The purpose of the pre-scan, therefore, is to reset/preset any data that shouldn't be retentive, by design...
I think your notion, of my notion, of "retention" may be a bit misguided?
I am fully aware of the fact that the controllers NVRAM is inherently retentive and the pre-scan is designed to alter the necessary data to a pre-determined state before going to Run Mode. My references to retentive data are program related and not from the classical sense of NVRAM being inherently retentive after warm or cold restarts.
When the controller goes to Program Mode, or power cycles, and then back to run mode, the pre-scan will leave retentive data, determined by the program, in the state it is in. All non-retentive data, determined by the program, is reset by the pre-scan. Special cases, again determined by the program, are pre-set to initialize them, such as the Counters CU bit that Ron mentioned.
Of course, if a pre-scan was not performed, and the controller goes straight to Run Mode, then all data will be retained as it was before.
When I mentioned the pre-scan carrying out retentive writes, I was hypothetically stretching the imagination, to consider what the Help files are saying. I was saying, at a "stretch" it might be possible that the pre-scan does write to retentive data, determined by the program, to double ensure that the data is indeed retained as intended, but, this would require the program having stored retentive data states elsewhere in memory to access during pre-scan so as to write to the retentive data addresses in memory. A far stretch of the imagination indeed. i.e. it does not happen, i.e. the pre-scan does not write to retentive data.
Again, to make the distinction, so I'm not misguided, I am referring to retentive data determined by the program, not inherently retentive data. The data for which the pre-scan does write to, such as our CU bit, is inherently retentive, but the program has determined, by design, that it needs to be written to for programmatic reasons.
daba said:
...If the conditions on a rung preceding an ONS are true, then there can have been no prior knowledge of that state.
Again, as the Instruction Set Reference Manual for the 1400 states, and unless that section is incorrect as well, the ONS is a "retentive input instruction". This means it retains its state while transitioning in and out of Run Mode. The state it retains is the state of its storage bit when leaving Run Mode, which is determined by the "conditions on a rung preceding an ONS" being either true or false. The storage bit retains the "prior knowledge of that state".
daba said:
...The pre-scan (when we have determined on which machines it does, and which it doesn't) sets the storage bit, so that the first real scan doesn't trigger the ONS to "perform"...
The Help files from RSLogix 500 state that it does this, but our test has proved it does not for the MicroLogix family.
I'm not one for stubbornly going against what Help files state, but RSLogix 500 covers a good few controllers. The fact that the name Micro
Logix contains the same appendage as Compact
Logix and Control
Logix, etc., makes it quite possible that someone writing that section made a mistake. Someone not too familiar with the differences, made a mistake, making a general reference for all "
Logix" controllers, which actually only refers to RSLogix 5000 based controllers, which do set the storage bit during pre-scan. It could easily be missed during a proof reading as well, as often grammar mistakes are more looked for than the accuracy of the information. That's just a theory of course.
In this case, the retentive theory, backed by the individual controllers Instruction Set, fits what I have observed, and what I have always understood for the MicroLogix while using ONS instructions. The Instruction Set, while stating it is retentive, you will notice, makes no note of the fact that it is set during pre-scan. To state it is both retentive, and set during the pre-scan, would be contradictory. If it is always set during pre-scan, then a retentive reset state would never be possible...
daba said:
...What we really need now is a definitive test that people can perform on the various platforms, to determine if a ONS is triggered falsely, or not. That will tell us which of the "Help" entries are incorrect...
...So which is correct and which is incorrect?
Here's one way of asking...
Is the MicroLogix controller's tested operation of being apparently retentive for the ONS instruction correct, as per the MicroLogix Instruction Set?
Or...
Is the RSLogix 500 Help file reference correct, and all MicroLogix controllers are not functioning as intended, also meaning the Instruction Set is incorrect?
The decision is yours...
Regards,
George