MBP-388: Safety Implementation - #54
aslanliafichev wants to merge 11 commits into
Conversation
| <DUT Name="ST_LEDState" Id="{f261f142-fde3-0208-2395-07dc6293304d}"> | ||
| <Declaration><![CDATA[TYPE ST_LEDState : | ||
| STRUCT | ||
| usiLEDState : USINT; |
There was a problem hiding this comment.
This should be just nLEDState
Remove space between colon and variable name
| stStatus : ST_SafetyStatus; // Placeholder, WIP | ||
| stLEDState : ST_LEDState; | ||
| aSafetyFunctionIn : ARRAY[1..GVL_SafetyIO.UPPER_BOUND_SF_INPUT] OF ST_SafetyFunctionIn; | ||
| aSubSystemIn : ARRAY[1..GVL_SafetyIO.UPPER_BOUND_SS] OF ST_SubSystemIn; // Placeholder, WIP |
There was a problem hiding this comment.
Remove space between colon and variable name
Remove space from the beginning of the comment message
| STRUCT | ||
| stFeedback : ST_SafetyFeedback; | ||
| aSafetyFunctionOut : ARRAY[1..GVL_SafetyIO.UPPER_BOUND_SF_OUTPUT] OF ST_SafetyFunctionOut; | ||
| aSubSystemOut : ARRAY[1..GVL_SafetyIO.UPPER_BOUND_SS] OF ST_SubSystemOut; |
There was a problem hiding this comment.
Remove whitespace between colon and variable name
| bitWcState AT %I* : BIT; | ||
|
|
||
| {attribute 'TcLinkTo' := 'TIID^PNOZ (EtherCAT)^Box (PNOZ m ES EtherCAT)^WcState^InputToggle'} | ||
| bitInputToggle AT %I* : BIT; |
There was a problem hiding this comment.
BIT should be starting with just b
| nState AT %I* : UINT; | ||
|
|
||
| {attribute 'TcLinkTo' := 'TIID^PNOZ (EtherCAT)^Box (PNOZ m ES EtherCAT)^InfoData^AdsAddr^netId'} | ||
| amsNetId AT %I* : AMSNETID; |
There was a problem hiding this comment.
AMSNETID is just a type alias for array of 6 bytes, so I think here aAmsNetID would be the right name.
| amsNetId AT %I* : AMSNETID; | ||
|
|
||
| {attribute 'TcLinkTo' := 'TIID^PNOZ (EtherCAT)^Box (PNOZ m ES EtherCAT)^InfoData^AdsAddr^port'} | ||
| wPort AT %I* : WORD; |
There was a problem hiding this comment.
WORD is just a number so this should be nPort
| <DUT Name="ST_SafetyFunctionOut" Id="{d225f0e9-f4be-0268-2036-d232ca0275b9}"> | ||
| <Declaration><![CDATA[TYPE ST_SafetyFunctionOut : | ||
| STRUCT | ||
| byRaw : BYTE; |
There was a problem hiding this comment.
BYTE is just a number so it should start with n
| stSafetyStatus.bValidReference := bRefsLinked; | ||
|
|
||
| IF NOT stSafetyStatus.bValidReference THEN | ||
| RETURN; |
There was a problem hiding this comment.
There is an extra identation here.
| bRefsLinked := mLinkRefs(); // Link references, once | ||
| END_IF | ||
|
|
||
| stSafetyStatus.bValidReference := bRefsLinked; |
There was a problem hiding this comment.
Whats the reason for bRefsLinked? Cant we write directly to stSafetyStatus.bValidReference instead?
|
Related to the discussion yesterday about integrating the output of the safety block with cabinet monitoring. I think the best solution will be to let the safety class implement an interface: Property Getters in fbSafety: Then in fbCabMonitoring: // Call the safety block and then the cabinet and inject the safety block directly therein And of course then the implementation inside fbCabMonitoring is needed to be updated. Advantage with this solution is if you add 10 new properties to the I_SafetyProvider interface in the future, fbCabMonitoring wont need to be changed in how it is called. Instead, only the inner logic of the class will be updated, since it already has access to the entire safety block via the interface. |
The goal is to develop a PLC Safety interface for ESTIA, this includes:
For now the code only focuses on task 1, implementation of task 2 and 3 needs to be fully defined:
For changes made to tc_generic: https://github.com/EuropeanSpallationSource/tc_generic_structure/pull/23