daba said:
This is so obvious - ANY attempt to read the keyswitch position using running code will fail if the code is not running...You will never be able to detect "PROG"...with code.
I'm assuming, like many others might be, that you are basing that off of your understanding of how the controller acts when transitioning to Program Mode and that you have not actually attempted this yourself? On the face of it, it's very easy for many of us to question the Rockwell technote's assertion that we can read out Program Mode while transitioning to Program Mode. Let's keep an open mind on this, though?...
I had to wait a few days as I was busy but I am just starting into a small project so I was pulling out some hardware yesterday. This gave me the opportunity to throw this together as a quick demonstration. I'm just getting time now to post it up before heading home.
I'm using a CompactLogix 5370 1769-L16ER-BB1B controller (r32) connected to a PanelView 5510 2715P-T10CD HMI terminal (r6).
I've got the GSV and BTD instructions added to the default MainRoutine and configured as instructed by the Rockwell technote.
I created 2 DINT Controller tags "ControllerStatus" and "KeyswitchPos". The former stores the GSV destination and the latter contains the result of the BTD instruction.
On the HMI I've created a simple screen with objects referencing the "KeyswitchPos" Controller tag which is expected to read out the keyswitch position values...
1 = RUN MODE
2 = PROG MODE
3 = REM MODE
I've also created a text object referencing the Predefined System tag of data type string "::[Shortcut]Controller[x].Mode", traditionally referred to as "@Mode" in FactoryTalk View/RSLinx Enterprise. This is expected to read out each main controller mode including "Remote Run" and "Remote Program".
Note 1: The line object representing the REM keyswitch position is using an expression for visibility animation which looks at both the "keyswitchPos" numerical value (=3) and the System "Mode" tag for the Remote Modes specifically.
Note 2: The update rate for the Predefined System "Mode" tag is noticeably slower than the update rate for the "KeyswitchPos" Controller tag.
Note 3: Note 1 & 2 both contribute to the visible delay in some of the switching of the graphical object states.
Note 4: While in Program Mode, the PanelView 5510 will display a Controller Connection warning icon on the right side of the top banner whenever the controller is not in Run Mode.
Result: I was going to take a series of pictures but instead I've made a short video which I feel demonstrates the test much better and much quicker than me blathering on with lots of pictures...
To play the video file directly:
https://www.dropbox.com/s/fvvvvbazpdr85mv/20210311_181229.mp4?raw=1
To download the video file if preferred:
https://www.dropbox.com/s/fvvvvbazpdr85mv/20210311_181229.mp4?dl=1
My apologies for the background noise. The plant is noisy but I want you to be able to here the keyswitch transitions to know when to expect the next graphical update.
I have also repeated this test using a 1769-L33ER which is the closest I have to the OP's 1769-L30ER.
Now, this is what I have experienced. I cannot say what will happen for others who may try using other hardware and programs. But nonetheless, it does prove that it "is possible".
Regards,
George