M
I have been writing a soft logic system, and I recently added ladder logic to the existing IL system. In the course of creating some test cases, I came up with a sample rung which I can draw as ladder, but which I don't think is possible as IL (Instruction List).
I will start off with a sample of similar *valid* ladder logic. I have posted a screen shot of this valid rung at the following URL.
Valid Ladder Logic: http://tinypic.com/r/p37g6/3
The IL for this is
NETWORK 1
STR X1
AND X2
STR C1
AND T2
ORSTR
AND CT55
OUT Y99
For anyone not familiar with the above syntax, The equivalent for this in Siemens S7-200 syntax would be:
LD I0.0
A I0.1
LD M0.1
AND T2
OLD
A C55
= Q9.9
Now if I add a contact as shown in the next screen shot, I get something that I think has no direct equivalent in IL (the extra contact was added in manually). The URL for that screen shot is here:
Invalid Ladder Logic?: http://tinypic.com/r/sy6ott/3
Can anyone think of how to write this in IL, or is it fundamentally impossible? I'm not looking for rewritten logic which has the same effect, I am looking for a direct translation. What I am looking for is whether I can safely drop this test case as "logically impossible", or whether I am overlooking something obvious.
What I think I have here is a fundamental rule that a contact may not straddle an ORSTR or ANDSTR (OLD or ALD in Siemens S7-200 terminology). In that case, there would be another case which I haven't shown here (with the ORSTR replaced with an ANDSTR, and the X1, X2 contacts in series with C1, T2).
Opinions?
The project itself is at: http://sourceforge.net/projects/mblogic/
I will start off with a sample of similar *valid* ladder logic. I have posted a screen shot of this valid rung at the following URL.
Valid Ladder Logic: http://tinypic.com/r/p37g6/3
The IL for this is
NETWORK 1
STR X1
AND X2
STR C1
AND T2
ORSTR
AND CT55
OUT Y99
For anyone not familiar with the above syntax, The equivalent for this in Siemens S7-200 syntax would be:
LD I0.0
A I0.1
LD M0.1
AND T2
OLD
A C55
= Q9.9
Now if I add a contact as shown in the next screen shot, I get something that I think has no direct equivalent in IL (the extra contact was added in manually). The URL for that screen shot is here:
Invalid Ladder Logic?: http://tinypic.com/r/sy6ott/3
Can anyone think of how to write this in IL, or is it fundamentally impossible? I'm not looking for rewritten logic which has the same effect, I am looking for a direct translation. What I am looking for is whether I can safely drop this test case as "logically impossible", or whether I am overlooking something obvious.
What I think I have here is a fundamental rule that a contact may not straddle an ORSTR or ANDSTR (OLD or ALD in Siemens S7-200 terminology). In that case, there would be another case which I haven't shown here (with the ORSTR replaced with an ANDSTR, and the X1, X2 contacts in series with C1, T2).
Opinions?
The project itself is at: http://sourceforge.net/projects/mblogic/