RMA
Member
Whilst searching for something else on the Siemens Support website, I fell over an FAQ about the differences between the execution of JMP commands between the 300 and 400 CPUs.
Apparently, as a consequence of the program in the 300 CPU being compiled before being executed, when you execute a JMP command the VKE and /ER Bits in the Status word are not reset. As a result if you jump into a decision chain, under certain circumstances, you can come up with the wrong answer.
An example:
O m0.0
O m0.1
R m0.0
S m0.1
A m0.1
JC j_01
= m1.0
j_01: O m0.0
O m1.0
= m2.0
On a 400 CPU, you would get the result you expect, i.e. m2.0 would remain "0".
On a 300 CPU, the VKE = 1 which caused the jump in the first place, would be merged with the two OR commands and m2.0 would be set to a "1".
As far as I can see, this is primarily a problem with ORs, and looking through some of my programmes, for reasons best know to my subconscious, I seem to work overwhelmingly with ANDs.
However, for those situations where is does matter, or even just to include as a matter of course, so as to be on the safe side, can somebody tell me, what is the fastest (i.e. most efficient) way (command) to reset the VKE and /ER Bits?
Edit: Can somebody remind me what the command was to get code displayed correctly, without all the leading blanks getting stripped out - I've seen it before, but I've forgotten what it was!
Apparently, as a consequence of the program in the 300 CPU being compiled before being executed, when you execute a JMP command the VKE and /ER Bits in the Status word are not reset. As a result if you jump into a decision chain, under certain circumstances, you can come up with the wrong answer.
An example:
O m0.0
O m0.1
R m0.0
S m0.1
A m0.1
JC j_01
= m1.0
j_01: O m0.0
O m1.0
= m2.0
On a 400 CPU, you would get the result you expect, i.e. m2.0 would remain "0".
On a 300 CPU, the VKE = 1 which caused the jump in the first place, would be merged with the two OR commands and m2.0 would be set to a "1".
As far as I can see, this is primarily a problem with ORs, and looking through some of my programmes, for reasons best know to my subconscious, I seem to work overwhelmingly with ANDs.
However, for those situations where is does matter, or even just to include as a matter of course, so as to be on the safe side, can somebody tell me, what is the fastest (i.e. most efficient) way (command) to reset the VKE and /ER Bits?
Edit: Can somebody remind me what the command was to get code displayed correctly, without all the leading blanks getting stripped out - I've seen it before, but I've forgotten what it was!
Last edited: