DirectAssigner (FB) ¶ FUNCTION_BLOCK DirectAssigner EXTENDS AssignerBase An assigner implementation for 1:1 relations of local and remote variable Properties: IsValueForBitAssignment , inherited from AssignerBase Methods: GetRawValue SetRawValue AssignReadValue , inherited from AssignerBase AtomicAssignIfPossible , inherited from AssignerBase FB_Exit , inherited from AssignerBase GetBitValuePtr , inherited from AssignerBase Structure: GetRawValue (Method) SetRawValue (Method)
DintSetBitBased (FB) ¶ FUNCTION_BLOCK DintSetBitBased IMPLEMENTS IDintSet Methods: AddDint Clear Contains Structure: AddDint (Method) Clear (Method) Contains (Method)
DintSetFull (FB) ¶ FUNCTION_BLOCK DintSetFull EXTENDS Collections.DintToDintMap IMPLEMENTS IDintSet Methods: AddDint Contains Structure: AddDint (Method) Contains (Method)
IDintSet (ITF) ¶ INTERFACE IDintSet Methods: AddDint Clear Contains Structure: AddDint (Method) Clear (Method) Contains (Method)
FSOESTATE (ENUM) ¶ TYPE FSOESTATE : Attributes: qualified_only InOut: Name Initial Comment INIT 0 INTERNAL FSoE state before execution of method Init RESET 100 FSoE state Reset (outputs are in safe mode) SESSION 101 FSoE state Session, the session ID is being transferred (outputs are in safe mode) CONN 102 FSoE state Connection, the connection ID and FSoE-Address is being transferred (outputs are in safe mode) PARA 103 FSoE state Parameter, the communication and the optional application parameter are being transferred (ooutputs are in safe mode) DATA 104 FSoE state Data, process or failsafe data are being transferred (outputs are only active if the pocess data command is received) ERROR 200 INTERNAL unexpected error, no futher execution of code
Function Blocks ¶ Master (FunctionBlock) Init (Method) Input (Method) Output (Method) ResetConnection (Method) Slave (FunctionBlock) Init (Method) Input (Method) Output (Method) ResetConnection (Method)
Master (FB) ¶ FUNCTION_BLOCK Master The FSoEBase Master function block implements the master side of the FSoE protocol and is responsible for establishing communication with an FSoE slave, parameterizing it and setting the FSoE watchdog time. With the call of the FB no execution is done, the flow control of the FSoE communication is executed by calling the functions of the FB. InOut: Scope Name Type Initial Comment Output S_eState FSOESTATE FSoE communication state S_xProcessData BOOL FALSE true, if the FSoE communication is established and valid FSoE frame with command PPROCESSDATA is received. S_byLocalError BYTE FSOEDIAG.LOCALRESET the local error of initialization or received FSoE frame event S_byDeviceError BYTE FSOEDIAG.LOCALRESET the received error from the FSoE device S_udiResponseTimeMS UDINT the FSoE response time in milliseconds for one cycle between FSoE master to slave and back Methods: Init Input Output ResetConnection Structure: Init (Method) Input (Method) Output (Method) ResetConnection (Method)
Master.Init (METH) ¶ METHOD Init : SAFEBOOL Function to initialize the FSoE communication. The communication parameters such as the ConnectionID, the FSoE address and the watchdog time, as well as the length of the send and receive FSoE PDUs are passed as parameters and checked for plausibility. The buffer with the optional application parameters for the FSoE slave is passed as parameter. If no application parameters are defined for the FSoE slave, then this buffer shall be passed as an empty buffer. Otherwise in the case of application parameters of the FSoE slave, the buffer with the bytes (set by the configuration) for the FSoE slave shall be passed. On the part of the FSoE master no further check shall be made regarding the consistency of the configuration. If a plausibilty check fails, the error code is stored in the instance variable S_byLocalError, the FSoE state changes to FSOESTATE.ERROR and the function returns with FALSE. If all plausibility checks are successful, the function returns with TRUE and all input values are stored in the corresponding instance variables. The minimum of the user data is calculated from the lengths of the FSoE PDUS and assigned to the instance variable _uiMinFrameDataSize. This function must be called once at the start of the application. InOut: Scope Name Type Initial Comment Return Init BOOL Input S_uiFSoEAddr UINT FSoE slave device address, error code FSOEDIAG_INVALID_COMMPARA S_uiConnId UINT Unique FSoE connection id, errorcode FSOEDIAG_INVALID_CONNID S_uiFWDT UINT FSoE watchdog time for given FSoE connection in millseconds S_uiSendFrameLen UINT Send FSoE frame telegram length S_uiRecvFrameLen UINT Receive FSoE frame telegram length S_pbyAppParam POINTER TO SAFEBYTE 0 Pointer to the optional application parameter buffer, default no application parameter buffer S_uiAppParamSize UINT 0 Size of the optional application parameter buffer
Master.Input (METH) ¶ METHOD Input : SAFEBOOL Function for temporal monitoring and to handle a received FSoE PDU. The return value of the function indicates if the FB state has changed. The input parameter S_pbyRecvFrame is the reference to a received FSoE PDU with the initialized length S_uiRecvFrameLen. If no new FSoE PDU has been received since the last call, only the check for a timeout regarding the FSoE communication is performed. S_pbyRecvFrame can either be NULL or point to the last FSoE PDU received. If an timeout error has occurred the transition FSOETRANSITION.TO_RESET is set according to the standard with the local error message FSOEDIAG.WDEXPIRED and the function returns with TRUE according to the FB state change. If no timeout error has occurred, the transferred FSoE PDU is checked FOR a change compared to the last call. In case of an unchanged FSoE PDU (no new FSoE PDU received) the state of the FB is unchanged and the function returns with FALSE. In the case of a changed FSoE PDU this is evaluated and a corresponding transition is set according to the protocol specification and the function returns with TRUE. If the function returns with TRUE, the output parameters S_byDeviceError and S_udiResponseTimeMS are updated. This function shall be called cyclically so that a temporal monitoring of the FSoE communication is ensured. InOut: Scope Name Type Comment Return Input BOOL Input S_pbyRecvFrame POINTER TO SAFEBYTE Pointer to the the received FSoE frame
Master.Output (METH) ¶ METHOD Output : SAFEBOOL Function to send a FSoE PDU The output data of the application shall be mapped into the user data area of the FSoE PDU of the transmit buffer and the input parameter S_xUseFailSafeData shall be used to mark the validity of the mapped user data. If no valid transition is set the function returns immediately with FALSE. The transition is executed according to the FSoE specification, such as generating an FSoE PDU to send, executing a state change, etc. With the return value TRUE a generated FSoE PDU is ready for sending in the send buffer, in the case of FALSE however not. In all cases an active transition (_eTransition = FSOETRANSITION.NOTPEDING) is reset after the call and the state of the FB (S_eState) is updated. This function shall be called after a successfull call of the function Input. InOut: Scope Name Type Comment Return Output BOOL Input S_pbySendFrame POINTER TO SAFEBYTE Memory description of the send FSoE frame S_xUseFailSafeData BOOL Flag to use failsafe data instead of process data