Designing an FSM Structure¶
Instructions for designing an FSM are stated step by step and the figures presented within the content are based on an FSM built according to the structure below.
Prerequisites to Design an FSM¶
-
Project must have the JCOP Framework installed.
The FwCore component is expected.
No need to have the fwDim component installed to run the FSM.
-
The FSM makes use of DIM communications and needs access to a "DIM Name Server" (dns.exe) somewhere in the universe.
Running the server using the .exe file suffice for the creation.
-
Exists fwinstallation directory of the project C: / Projects / fwComponentsProject / bin / dns.exe.
-
Select and run the application as an admin by right clicking on it and selecting "Run as an Administrator".
-
Run the dns.exe file as an administrator in the working universe and keep it running until the end of designing process.
-
-
The fwFsmSrvr task must definitely be running.
Check the WinCC OA console to ensure that the fwFsmSrvr task is running.
Setting the DIM Name Server (DNS) Node¶
To setup a WinCC OA project to run the FSM users have to run a DIM Name Server (DNS) locally, refer the "Prerequisites to Design an FSM" section.
The host name of the currently running DNS is required in order to define the host of the DNS in the project.
-
Set the "Device Editor and Navigator" to the "Operation Mode" (A) and move to the "FSM" tab (B).
-
To define the DNS host, click on the "DIM_DNS_NODE Undefined" button (C).
-
Enter the name of the DNS identity in the popup panel and press the "OK" button.
-
After a brief period of processing the description on the button would indicate the DIM_DNS_NODE associated with the project.
Control Unit Configuration¶
Creating a Control Unit¶
-
Set the "Device Editor and Navigator" to the "Configuration Mode" (D) and move to the "FSM" tab (B).
-
Click on the "Create/Configure FSM Object Types" button (E).
-
Select "Create Object Type" button from the "Object Type Configuration" popup panel.
-
Provide a meaningful name for the CU type, confirm and wait for the CU type to appear in the 'Logical Objects Types' section.
-
Double click on the created CU type.
-
Click on the "Simple Config" button of the "States and Actions" popup panel which is also referred to as the "SMI_Object_States" panel.
-
Observe the default states offered and if appropriate for the created CU, select required states (I), define actions (II) as preferred and click the "Add" button (III) next to each of the selected options.
The image illustrates the declaration of READY, NOT_READY and ERROR states. All 3 created CU types have same declarations which will be refined later accordingly
It automatically declares the actions possible in the field "Declared Actions" once the "Add" button is clicked for selected states with defined actions.
-
Click the radio button (IV) to define the initial state at startup of the FSM.
The image indicates the selection of "NOT_READY" as the initial state.
-
Click the "OK" button (V) for the CU configuration and confirm in the "SMI_Object_States" panel and close the "Object Types Configuration" panel.
Click here for further information on the sections "Panel", "List of States", "List of Actions" and "When List" after successfully defining states and actions.
Successfully defined states and actions are visible in the "SMI_Object_States" panel. Refer the image with updated States, Actions and When lists.
The defining process for a Control Unit object type with states and associated actions end at this point.
Creating a Control Unit (Root Node) Instance¶
-
Set the "Device Editor and Navigator" to the "Configuration Mode" and move to the "FSM" tab.
-
Move to the hierarchy, right click and select "Add" option from the list of options.
-
Select "Add New Object" option from the "Add Node" popup panel.
-
Select the CU type created earlier, provide a meaningful name for the instance and press "OK".
In the case of the example, the root node is "DcsCu" of the "DcsCuType".
-
Click "OK" in the "Add Node" panel.
Wait until the node is set up. Once done it would appear in the heirarchy.
Refer the image and observe the created root node "DcsCu" in the list of structures.
If the system is large, check to see that the log file has gone quiet. This may not happen for some time after the progress popup window disappears.
Adding a Child Node to the Control Unit¶
Users might require to insert subdetectors for some or all CU created of the DCS which could be done by adding a child node to each such CU.
The subdetector systems are likely to have been implemented by different groups hence definitions of children’s states and actions might differ from one to another.
In the case where they are different, user will have to employ distinct CU types to make the mapping into the states or vocabulary.
In the case of the example, states and actions of Muon subsystem children might be different from the definitions of states and actions of Tracker subsystem children when mapping vocabulary to DcsCu.
-
Set the "Device Editor and Navigator" to the "Configuration Mode" and move to the "FSM" tab.
-
Move to the created CU root node or node, right click, select "Add.." and the "Objects" option from the extended list.
-
Select "Add New Object" from the "Add Node" panel.
-
In the "Add Object" popup panel add a new node (CU object) of type created earlier, providing a meaningful name and press "OK".
Refer the image presenting the creation of a child node "MuonCu" of the "MuonCuType" for the DcsCu root.
-
Tick the "as Control Unit" box in the "Add Node" panel.
The image illustrates the created CU object "MuonCu" of the CU type "MuonCuType" and the type is confirmed by the tick in the "as Control Unit" box for this particular object.
-
Click "OK" to create the CU child node.
Wait while the CU is created and once done the child CU will appear in the hierarchy structure as a child node.
Refer the image and observe the created child nodes for the "DcsCu" root node. There are 2 such child nodes,
- "MuonCu" of the CU type "MuonCuType"
- "TrackerCu" of the CU type "TrackerCuType"
- Both definitions are similar regarding states and actions which will be refined later.
If it appears as a sibling of the CU, then delete it using the right click and try again.
-
Set the "Device Editor and Navigator" to the "Operation Mode".
-
Check if the DNS node is processing and click "Start/Restart All" button and wait whilst all of the FSM domain starts up.
If the DIM Name Server is running, the name appears next to "DIM_DNS_NODE :" on the button description.
If the DIM Name Server is not running in the universe of the current project, user will recieve an error notification.
View the Running FSM¶
-
Select the CU, right click and select the "View" option.
The padlocks remain unlocked implying availability for someone to take control. Not even the creator has control yet.
-
Click on the CU system padlock and take control by appointing a privileged user account.
The colours representing the states of the subsystems sould be visible at this stage and would be in the appointed initial state.
Click on a blue state to get a list of possible actions. If the user selected a defined action, it would be propagated to child subsystem(s) and shift states accordingly.
Partitioning the FSM¶
Partitioning faciliates the excluding of a child node from the user jurisdiction or control.
-
Press the padlock icon next to the node that needs to be excluded.
-
Click the "Exclude" option from the popup panel.
The panel would close automatically and the partitioned state box would turn grey.
State changes will no longer be taken into account when computing the state of the system over which the user do have control.
The padlock would be ringed in orange to warn the user that some child subsystem below the CU is currently excluded.
Device Unit Configuration¶
Creating a Device Unit¶
-
Set the "Device Editor and Navigator" to the "Configuration Mode" and move to the "FSM" tab.
-
Select "Add Device Type" button from the "Object Types Configuration" panel.
-
Select the required DU type from the "Framework Device Types" section in the "Add Device Type" panel and press "OK".
-
Provide a meaningful name for the new device type.
After a brief pause, the unit would appear in the list of "Framework Device Types" section with the prefix of the selected DU type.
In the case of the example, 2 such device types are created.
- "SwitchDuType" that appears prefixed with "FwDio"
- "TemperatureDuType" that appears prefixed with "FwAi"
-
Double click on the created DU type.
-
Click on the "Simple Config" button of the "SMI_Object_States" popup panel.
-
Observe the states offered and select the appropriate states (I) for the created DU according to requirements, define actions (II) as preferred and click the "Add" button (III) next to each of the selected options.
It automatically declares the actions possible in the field "Declared Actions" once the "Add" button is clicked for selected states with defined actions.
The image illustrates the editing of ON and OFF states and actions. The system will automatically select possible actions.
-
Select "State depends on DP item" (IV) and choose "inValue" from the list of options.
-
Similarly select "Actions act on DP Item" (V) and choose "outValue" from the list of options.
These "inValue" and "outValue" are obtained from the datapoint element names within a specific type.
-
Click the "OK" button (VI) to confirm the DU configuration.
Click here for further information on the sections "Panel", "List of States", "List of Actions" and "Configure Device" after successfully defining states and actions.
Successfully defined states and actions would be visible in the "SMI_Object_States" panel. Refer the image with updated lists of states and actions.
The defining process of an object type with states and associated actions end at this point but hardware should be linked for the completion of the DU.
Linking to Hardware¶
Linking in this instruction series is according to the units, states and actions defined in previous sections. Depending on requirements users might need to select different options
-
Click on the "Configure Device" button and select "Configure Device States" (VII) option from the list in the "SMI_Object_States" panel.
-
Fill in the fields to according to the requirements of the FSM (IX).
In this specific case as the figure illustrates, definition (invalue ==1) means ON.
-
Press "Generate Script (from screen)" button (X).
-
Click on the "Edit Script" button (XI), read the code and ensure that the code makes sense.
This apparently unnecessary step is actually a good habit to get into especially if the user is a developer.
-
Press "Close" button (XI) and exit.
The process of defining how the future instances of this type should determine their specific states is done.
Configuring Actions¶
All actions in a DCS FSM are carried out by responding to commands hence defining instructions for instances to respond with regard to commands is important.
-
Go to the "SMI_Object_States" panel.
-
Select "Configure Device" and select "Configure Device Actions" (VIII) from the dropdown menu.
-
Arrange FSM actions according to the requirements of the DCS (XIII).
In this specific case, action SWITCH_OFF is set to the DPE 'outValue' to 0. Correspondingly, the FSM action SWITCH_ON is set to the DPE value 1.
-
Click "Generate Script (from screen)" button (XIV) and close the panel.
-
Press the "Close" button (XV) on the "SMI_Object_States" panel and close the "Object Types Configuration" panel.
Creating a Device Unit Instance¶
-
Set the "Device Editor and Navigator" to the "Configuration Mode" and move to the "FSM" tab.
-
Right click on the DU type, select "Add" and choose "Devices" from the extended menu.
-
Select "Add Devices from Hardware View" option from the popup panel.
-
Select DU type created earlier from the "Add Devices" panel.
-
Select required items and move them into the right hand side using ">" or if all items are required using ">>".
-
Click "OK" in the "Add Node" panel.
Wait while the nodes in the FSM tree are set up once done it would appear in the heirarchy.
-
Do not tick the "as Control Unit" box in the "Add Node" panel.
In the "Add Node" panel, do NOT tick "as Control Unit" box because this is a device unit!
The image illustrates the created DU object "MuonSubSystemPower" of the DU type "FwSwitchDuType".
-
Click "OK" to create the hardware node.
Wait while the DU is created and once done the child DU will appear in the hierarchy structure as a hardware child node.
Refer the image and observe the created hardware nodes for the child nodes of the "DcsCu" root node. There are 2 such child nodes and within them 1 hardware node each,
- "MuonCu" with the hardware node "MuonSubSystemPower"
- "TrackerCu" with the hardware node "TrackerTemperature"
If it appears as a sibling of the CU, then delete it using the right click and try again.
-
Shift to the "Operation Mode".
-
Check if the DIM Name Server is processing and press "Stop All" and do not skip this step. Then click "Start/Restart All" button.
If the DIM Name Server is running, the name appears next to "DIM_DNS_NODE :" on the button description.
As DU definitions are edited, omitting this step before going on to the next step "Restart All" will cause an internal mismatch.