Program Organization Units (POUs)
The program SR_EmailHandling implements the program code to control the email client (for sending and receiving emails) and the processing of received emails.
The program code has been split into single logical functions. The single program parts are processed in subroutines (actions).
The actions called from the program are listed in the following table:
Name of the subroutine (action) |
Description |
---|---|
ACT_InputMapping |
In this logic, the input variables, mainly coming from the visualization, are verified and assigned to local variables for further processing. |
ACT_CheckForSendRequest |
In this logic, the commands to send an email are stored in a queue for sequential processing. |
ACT_UpdateCredentials |
In this logic, the credentials and the communication settings for the email client are updated with the variables displayed on the visualization. Further functions such as, the hidden credentials are processed in this subroutine too. |
ACT_StateMachine |
This logic implements the state machine for the email handling. The general states are: oInitialization of the function blocks oMonitoring the control commands oTriggering the commanded function on the function blocks oMonitoring the execution of the function blocks |
ACT_AutoProcessing |
The auto processing is executed in a chronological interval and controls the email client as follows: oCheck whether new emails are in inbox oDownloading new emails oProcess the received emails, whereby emails are deleted or a response is created and sent |
ACT_RearrangeQueueEmailToSend |
This logic is called after each successful sending. It rearranges the queue for the buffered send requests. |
ACT_OutputMapping |
In this logic, the local variables are converted into the required format and then assigned to the associated output variables. The output variables are linked to the visualization. |
The program SR_MachineData implements a routine to create the content for emails which are sent on dedicated events. The example application implements the events MachineErrorState and DailyStatus which can be triggered from the visualization.