-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some all-purpose sequence Blocks #1060
base: develop
Are you sure you want to change the base?
Add some all-purpose sequence Blocks #1060
Conversation
A new XML file was added with global constants for sequence control including initial values.
- Added a new FBType for a sequence with 4 outputs looped - Defined event inputs and outputs, input variables, output variables, and adapter declarations - Implemented ECStates and ECActions for each state transition
…e transitions and algorithms for the looped sequence.
…ansition by EVENT or TIME. Include event inputs/outputs, state transitions, confirmation steps, entry/exit steps for each state.
Test Results 113 files ±0 113 suites ±0 52s ⏱️ +4s Results for commit cd4927d. ± Comparison against base commit 1bb26ac. This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
<VarDeclaration Name="State_08" Type="SINT" Comment="" InitialValue="SINT#8"/> | ||
</GlobalConstants> | ||
<OriginalSource><![CDATA[VAR_GLOBAL CONSTANT | ||
NO_TIME : TIME := TIME#49d17h2m47s295ms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this no time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the largest thinkable Time.
with this Constant you can "switch off" a Transition on Time.
so for the ET Block you make that Transition then Event only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be similar seen as the 0xFFFF for 16-Bit INT for "no Value" which is commonly used in Bus Systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely not the largest possible value for TIME. The largest value how Eclipse 4diac implements it is larger then 290000 years. So it is just some arbitrarily made up value. Which is not good. Why not 0ns or -1ns?
Also the name does not really convey the meaning that you use it for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1ns i like most yes !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about:
INF_TIME : TIME := TIME#-1ns;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T#-1ns is a total valid value for time calling it INF_TIME seems wrong to me. Please note that the Time data type is a delta time so it can be positive and negative. As you need some magic number for your design you should choose one wisely and give it a name that fits to the magic that you are using it for. A generic name will not work here.
</GlobalConstants> | ||
<OriginalSource><![CDATA[VAR_GLOBAL CONSTANT | ||
NO_TIME : TIME := TIME#49d17h2m47s295ms; | ||
State_00 : SINT := SINT#0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give this states more meaningful names. Just numbers are not really helping to understand what they are for. Would an enum be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have ENUMS now ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the 4days of Eclipse 4diac edition we have basic support for enums in 4diac IDE. However I just noticed that we do not yet have 4diac FORTE support and with that also no exporters. Also as I read below you need the value that is not possible in IEC 611313- with enums. There is a dedicated data type for that, which we are not supporting.
</Event> | ||
</EventInputs> | ||
<EventOutputs> | ||
<Event Name="CNF" Type="Event" Comment="Execution Confirmation" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you have cnf and individual events for states?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also make CNF and RO like written below.
<ECAction Output="timeOut.STOP"/> | ||
</ECState> | ||
<ECState Name="sRESET" x="-666.67" y="2666.67"> | ||
<ECAction Algorithm="State_01_X" Output="EO_S1"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really want to issue all EO events in case of reset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, otherwise the Outputs stay on if we go with the Concept you see in the Comment above.
Question is if we want to reset the STATE_NR Output also to 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is different to other FBs with Reset inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as my resarch no:
E_TOF.fbt if we press 'R' all Outputs go to FALSE.
do you know any where the Outputs stay on ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not talking about the values I'm talking about the events that are sent on reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this was what I wanted to point out. But as I do not really understand what the block is doing and what you need it for it is hard for me to say what a good design is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azoitl as said,
a all-purpose Seqence control,
avoiding everybody must go the C++ way for simple Sequences.
Pneumatic, Hydraulic, Traffic Light, etc..
also add a State for reseting the Counter to 0 on Reset.
…tput. - Refactored event names in EventOutputs section - Changed timing values to INF_TIME in InputVars section - Added new event "RO" with associated variables in EventOutputs section
@azoitl is more 61499-ish. Thanks, |
6 Different Types of sequence FBs: