Skip to content

1.7 Programming

Programs for Safety Simplifier are called configurations. A project file represents one configuration, which can be downloaded to one Safety Simplifier system.

1.7.1 Creating a Project

When starting Simplifier Manager, the welcome screen is displayed. From this screen the user can choose to create a new project, or to open an already existing project file. When the user has opened or saved a project, that project will also show up in a list of recent projects on this screen.

Selecting Create new project brings up the Project Settings window, where several different settings can be changed.

  • Project Name — the name of the project.
  • Firmware — which firmware the project should target.
  • Responsible person — the main responsible person for this project.
  • Company — the company of the responsible person.
  • Description — text to describe the project, and other information.

Under Communication the following settings:

  • Disable radio — disables normal-mode radio, while still allowing programming via Simplifier Monitor.
  • Radio Channel — which radio channel the network should operate on. Note that this option is disabled if the Disable radio setting is enabled. Radio channels are discussed in chapter 1.14.
  • CAN Baud rate — specifies the CAN baud rate that the system should use for CAN communication. Can be set to 125 kBaud, 250 kBaud, or 500 kBaud. 125 kBaud is the default.
  • Timeout 1 — specifies the short timeout. This timeout can be used in case a device or function requires faster maximum reaction time. Timeouts are discussed in chapter 1.14.5.2.
  • Timeout 2 — specifies the long timeout. This is the default timeout. Timeouts are discussed in chapter 1.14.5.2.

The settings for a project can be changed at any time by going to Project → Project settings in the main menu.

Figure 1.4 — The Project Settings dialog, where the project settings can be changed.

Figure 1.4: The Project Settings dialog, where the project settings can be changed.

1.7.2 Saving and loading projects

To save the project, go to File → Save, or press Ctrl+S. The Save file dialog is displayed. The project name is already entered as the file name. Be aware that changing the saved file name will also change the name of the project. The saved file is saved in the Simplifier Manager project file format (with the .simple file extension).

To open a file, go to File → Open, or press Ctrl+O. The load file dialog is displayed. Here a Simplifier Manager project file can be selected to load. If the project file is password protected, a dialog shows prompting the user to enter the password for the project. If the wrong password is entered, the project cannot be loaded. Passwords are discussed in chapter 1.13.

1.7.2.1 Loading projects from earlier versions

All projects from Simplifier Manager 1.x can be opened with Simplifier Manager version 2 and later. However, some connections may be removed in the process. This is because, since version 2, the application does not allow logical loops without using a Loop Gateway block (see 1.7.19 Logical loops).

Note

Projects saved in Simplifier Manager version 2 and later cannot be opened in earlier versions. Opening an old project and saving it will overwrite it, and it can then no longer be opened in earlier versions. It is recommended to save older projects as a copy to allow them to still be openable in earlier versions.

1.7.3 Adding nodes

When a project is created the Add node dialog is shown. Here the user can choose to create a node from a standard template, import a node from a file, or create a blank node. To add more nodes to a project, click the Add node button in the toolbar, go to Project → Add Node, or go to the project overview and click the Add node button.

Figure 1.5 — The add node dialog.

Figure 1.5: The add node dialog.

1.7.3.1 Standard nodes

Selecting Standard brings up the list of predefined standard nodes. Here the user can select a standard node that fits their use case. The text box in the upper-left corner can be used to filter the list with specific article numbers, sensors, or other keywords.

Figure 1.6 — The standard nodes.

Figure 1.6: The standard nodes.

1.7.3.2 Import

This option can be used to import a node template from a file. See 1.7.5 Node templates for more information about node templates.

1.7.3.3 Blank

Selecting Blank creates a completely empty node.

1.7.3.4 New node settings

Clicking Next shows the node settings for the new node. Here the name and type of the node can be changed, as well as the front panel configuration.

  • Node Name — specifies the name of the node.
  • Hardware type — this selects if the node is of type S16 or S14, i.e. with or without safety relays. Selecting S16 allows the user to use relay outputs in the logic. Note: this must match the type of node to be used to be able to download.
  • Front panel — here the user can specify which front panel elements the node should have.

Pressing OK will add a Simplifier unit to the hardware configuration. To open the settings again for the new node, right-click the node in the Project Overview document and select Change Settings.

Open the node logic by double-clicking on the Simplifier, or right-click and select Logic.

Figure 1.7 — The node settings dialog. Here the settings of the node can be changed.

Figure 1.7: The node settings dialog. Here the settings of the node can be changed.

1.7.4 Changing node number

The order of the nodes in the project overview decides the node numbers of the nodes. To change the node number of a node, right-click on the node in the project overview and select Move left or Move right. Move left swaps places with the node to the left (i.e. decreases the node number by 1), and Move right swaps places with the node to the right (i.e. increases the node number by 1).

Figure 1.8 — The node right-click menu.

Figure 1.8: The node right-click menu.

1.7.5 Node templates

Node templates can be used to duplicate a node many times in a project, or to import it into other projects.

1.7.5.1 Exporting node templates

A node can be made into a template by right-clicking on the node in the project overview and selecting Export template. This shows a dialog like the node settings dialog; however, this dialog only controls what is saved in the node template and will not change the node itself.

Pressing Export opens a save file dialog and lets the user save the template as a file.

Figure 1.9 — Right-clicking on a node in the project overview.

Figure 1.9: Right-clicking on a node in the project overview.

Figure 1.10 — The export node template dialog.

Figure 1.10: The export node template dialog.

1.7.5.2 Importing node templates

A node template can be imported by adding a node to the project and selecting Import as shown in Figure 1.11. This opens a file dialog where a template can be selected.

Figure 1.11 — The add node dialog.

Figure 1.11: The add node dialog.

1.7.6 The Logic Editor

Opening the program for a node (by double-clicking on the node in the project overview) displays the logic graph document for that node. This is the document where all logic programming is done. Note that the Toolbox shows different categories of function blocks when a logic editor is opened. Function blocks are the building blocks used to create programs. See Chapter 2 — Function Block Reference for a complete list of all function blocks available in Simplifier Manager.

Figure 1.12 — The logic diagram for node 1 (right) and the toolbox with all categories collapsed (left).

Figure 1.12: The logic diagram for node 1 (right) and the toolbox with all categories collapsed (left).

1.7.7 Pages

Pages can be used to organize the logic in the project. Each node can have many pages of logic. To add pages to the logic, press the Add page button in the top-left corner of the logic diagram.

To switch between pages, click the buttons corresponding to each page in the top-left of the document. To rename a page, right-click on the button of the page and select Rename.

Figure 1.13 — The add page button.

Figure 1.13: The add page button.

To remove a page from the logic, right-click on the page button and select Remove.

When generating project reports, each page is printed as a landscape-oriented A4 in the project report PDF.

It is recommended to split the logic over different pages, so it is easier for a reader to navigate and understand. The page name can be used to describe what kind of functions the page contains. Right-clicking on the page button brings up the page context menu, with the rename button. Change the name of this page to Logic.

Figure 1.14 — The page right-click context menu.

Figure 1.14: The page right-click context menu.

1.7.7.1 Connecting blocks across pages

To be able to connect input and output connectors from blocks across pages, local memories are used. These are simply references to signals and do not cost any memory in the actual program. For more information about local memories, see 1.7.21 Local Memories.

1.7.7.2 Page info

In the bottom-right corner of each page is a box containing information about the page, such as the page name and the author and company. To change the name of the author and company, change the settings in the project settings.

Figure 1.15 — Page information box.

Figure 1.15: Page information box.

1.7.8 Page checksums

Each page has its own checksum, based on the logic in that page. The checksum is displayed in the page info box on every page. The checksum is a 32-bit hash of the logic in the page, displayed as a hexadecimal number (separated by a -, to make it easier to read).

The checksum 0000-0000 means the page has no outputs and does not affect any logic outside of that page. Adding a memory or an output block updates the checksum. Changing any logic function in the page will change the checksum.

Note

Changes that don't affect the logic do not change the checksum. For example, moving blocks around does not count as a logic change, and the checksum is not affected by it.

Note

Identical logic in two different pages will get the exact same checksum, except when they are using references to different memories.

Checksums are another reason to split logic over different pages. If the logic is split over multiple pages and one block is changed, only the page containing that block will get a new checksum.

If there is an error in the page, the Checksum field is empty.

Figure 1.16 — An input connected to an output generates a checksum value 1075-83D1.

Figure 1.16: An input connected to an output generates a checksum value 1075-83D1.

Figure 1.17 — Changing a pin number of the input block in Figure 1.16 from 2 to 5 changes the checksum to 2D87-FCE6.

Figure 1.17: Changing a pin number of the input block in Figure 1.16 from 2 to 5 changes the checksum to 2D87-FCE6.

1.7.8.1 Verifying pages

Verifying a page means inspecting the logic of a page and ensuring that the intended function is the implemented function.

Each page in the project may be marked verified by right-clicking in the logic diagram and selecting Mark page verified. An unverified page generates a warning in the project report. All pages should be verified when the project is completed. Changing the logic of a verified page will mark the page unverified, and it must then be verified again.

Figure 1.18 — A verified page.

Figure 1.18: A verified page.

1.7.9 Navigation in the logic diagram

Holding down the right mouse button and dragging with the mouse will pan the logic diagram. To zoom in and out, use the scroll wheel on your mouse. To center the graph in the view, click the button in the top-right corner. The scroll bars on the bottom and the right side can also be used for scrolling horizontally or vertically.

1.7.10 Function Blocks

Function blocks are what programs in Simplifier Manager are made from. Inputs, outputs, and logic are all created by dragging different logic blocks to the logic diagram.

1.7.10.1 Connectors

Function blocks can have zero or more input connectors, and zero or more output connectors. Input connectors are on the left side of the block, and output connectors are on the right side of the block. Note the distinction between connectors and connections: a connection connects an output connector to an input connector.

Some blocks have a variable number of connectors, such as the AND block.

Figure 1.19 — An AND block with 3 input connectors and 1 output connector.

Figure 1.19: An AND block with 3 input connectors and 1 output connector.

1.7.10.2 Creating function blocks

Expand the desired category in the toolbox by clicking on it, and with the left mouse button, click and drag the desired block from the Toolbox to the logic graph.

Note

If the toolbox is empty, make sure a node logic diagram is open in the documents pane.

When the block is created it will be selected, indicated by a yellow outline. Clicking on a block will also select it. Clicking on the graph background will deselect all selected blocks. When selecting a block, the inspector panel on the right side shows the block settings.

Figure 1.20 — Dragging an E Stop from the toolbox to the graph.

Figure 1.20: Dragging an E Stop from the toolbox to the graph.

1.7.10.3 Block settings

Most blocks have some settings that can be changed. For instance, an E-stop input has filtering, simultaneity, and different settings for the expected input signals. These settings are shown in the inspector panel when the block is selected.

1.7.10.4 Creating inputs

To create an input function, expand the Inputs category in the toolbox and drag and drop an input function to the logic diagram. Selecting the block shows its settings in the Inspector panel. To finish creating the input, the pins must be selected in the inspector panel, as shown in Figure 1.21.

All terminals are equivalent on the Safety Simplifier (i.e. all pins support the same functions), so any pin between 1–14 can be selected. Pins 15 and 16 are relay outputs and can only be used in an S16 node.

Note

As a convention, most standard nodes come pre-wired with E-stops on pins 2 and 4, and other front panel elements connected to the even terminals 6, 8, …, 14. Using this convention is recommended.

For more information about block settings, see the relevant blocks in Chapter 2 — Function Block Reference.

Figure 1.21 — The properties of an E-stop block. The pin number editors are marked in yellow, with pin 2 and 4 selected.

Figure 1.21: The properties of an E-stop block. The pin number editors are marked in yellow, with pin 2 and 4 selected.

1.7.11 Selecting blocks

Blocks can be selected individually by clicking on them with the mouse. Holding Shift while clicking adds more blocks to the selection. Holding Ctrl while clicking inverts the selection (i.e. a selected block will become unselected, an unselected block will become selected).

Clicking and dragging selects all blocks inside a rectangle, as seen in Figure 1.22. Shift and Ctrl can be used while dragging to join or invert the selection.

Figure 1.22 — Drag-select.

Figure 1.22: Drag-select.

1.7.12 Moving Blocks

To move blocks around in the graph, hold down the left mouse button and drag the block. Selecting multiple blocks and dragging moves all selected blocks together.

1.7.13 Deleting Blocks

To delete a block from the logic graph, select it by left-clicking on it, and press Del on the keyboard, or right-click on it and select Delete. The delete button in the Toolbar can also be used, or go to Edit → Delete in the main menu at the top of the application.

1.7.14 Copy, Cut, and Paste

To copy the currently selected elements, go to Edit → Copy, or press Ctrl+C. To cut the selected elements, go to Edit → Cut, or press Ctrl+X. To paste the elements currently in the clipboard, go to Edit → Paste, or press Ctrl+V.

1.7.15 Undo and redo

Any edits that take place in the logic for one node can be undone and redone. To undo, press the Undo button in the toolbar, or press Ctrl+Z on the keyboard. To redo, press the Redo button in the toolbar, or press Ctrl+Y.

1.7.16 Logic connections

The program logic is built by creating blocks and connecting their outputs and inputs. A connection connects an output connector to an input connector. An output connector outputs a binary value that can be either 1 or 0 (true or false, ON or OFF). In Simplifier Manager these connections are called signals.

Note that the color of a signal is important. All signals that can be used for safety functions are colored yellow. There are also unsafe/status signals that are colored white. Unsafe and safe signals are discussed in more detail in 1.7.17 Safe and unsafe logic.

1.7.16.1 Creating connections

A connection is created by clicking with the mouse on an output connector and dragging to an input connector, as shown in Figure 1.23.

Figure 1.23 — Dragging a connection from an output to an input.

Figure 1.23: Dragging a connection from an output to an input.

1.7.16.2 Removing Connections

To remove a connection, drag from the input side of the connection, away from the connector, and release the mouse button, as shown in Figure 1.24.

Figure 1.24 — Removing a connection by dragging from the input side of the connection.

Figure 1.24: Removing a connection by dragging from the input side of the connection.

1.7.17 Safe and unsafe logic

A connection can be either safe (indicated by being coloured yellow) or unsafe (indicated by being coloured white). The output connector (i.e. the connector on the left side of the connection) decides the safeness of the signal, as can be seen in Figure 1.25.

Figure 1.25 — The two different signals available from the E-stop block. The "on" connection is yellow, and the "error" connection is white.

Figure 1.25: The two different signals available from the E-stop block. Note that the "on" connection is yellow, and the "error" connection is white.

Warning

Only safe (yellow) signals can be used for safety functions and safety outputs.

Safety outputs require the input to be a safe (yellow) signal, while unsafe outputs (such as the Status Output) can use either a safe or an unsafe signal.

Unsafe signals are intended to be used for indication and status signaling, such as lighting LEDs or as inputs to the Software Gateway block.

When connecting an unsafe signal to a logic block, it makes the block unsafe, and thus its outputs will also be unsafe, as shown in Figure 1.26 and Figure 1.27.

Figure 1.26 — Two (safe) E-stop signals connected to an AND-block. The output from the AND-block is safe (yellow).

Figure 1.26: Two (safe) E-stop signals connected to an AND-block. Note the output from the AND-block is safe (yellow).

Figure 1.27 — An unsafe signal connected to an AND-block, making the AND-block unsafe and the output unsafe (white).

Figure 1.27: An unsafe signal connected to an AND-block, making the AND-block unsafe and the output unsafe (white).

1.7.18 Logic cycle time

The logic is guaranteed to be executed every millisecond in a unit (±1%). This means the time resolution for all logic is 1 millisecond. This is the time step that the unit uses to keep track of timings in the logic.

1.7.19 Logical loops

A logic loop happens when a signal that is defined later in the logic chain is used earlier in the chain — i.e. an input to a block directly depends on an output from the same block (also known as feedback).

Note

Loops can only be created using the Feedback loop block under the Advanced category.

A logical loop will delay the signal at least 1 ms. Since the output signal value is unknown before using the inputs, the value of that signal from the previous logic cycle will be used when calculating the inputs. This results in one logic cycle delay of the output signal (per loop).

Warning

Creating loops in the logic can cause unintended behavior of the logic and will cause higher maximum reaction times and different PFH-d values. Simplifier Manager tries to calculate the correct maximum reaction time for functions with loops, but it is up to the user to verify that the value is correct.

1.7.20 Memories

Memories are a very important part of programming in Simplifier Manager. Memories are used to reference signals in different places. A memory can be of two different types: local or global.

1.7.21 Local Memories

A local memory works just like a connection. It references a signal in the logic diagram and can be referenced in other places.

Note

The local memory is free to use, meaning it does not take any memory in the compiled program. It references the signal it is connected to directly.

Figure 1.28 — A local memory source, with the name "new_memory".

Figure 1.28: A local memory source, with the name "new_memory".

Note

Replacing a connection with a local memory will compile into the same program (this can be seen by compiling two projects and comparing their checksums).

In the case where a signal is used as input for many blocks, a local memory can reduce the number of overlapping connections, making the logic easier to understand. They are also necessary for connecting signals across pages.

To create a local memory, expand the Memory category in the Toolbox, and drag out a Memory to the graph.

The memory name is used to name the local memory. Any characters can be used in the memory name (including spaces and special characters like ñ, ß, Ö, etc.).

Changing the color allows the user to color-code the different memories in a project and does not affect the logic.

Figure 1.29 — A yellow local memory with the name "E-stop".

Figure 1.29: A yellow local memory with the name "E-stop".

1.7.22 Creating memory references

To reference a memory, drag a Reference to the logic graph, and select the source memory that you want to reference in the Find memory source dialog (see Figure 1.30). In the search field, the user can search for a memory name, a node number, or a memory number, to easily find a memory source.

Figure 1.30 — Selecting a source memory for an unlinked reference.

Figure 1.30: Selecting a source memory for an unlinked reference.

1.7.23 Global memories

To be able to send signals between nodes in a network, global memories are used. Any local memory can be made into a global memory by selecting the memory and checking the Global setting. This enables some more settings in the inspector.

  • Memory number — this selects which memory number is used. A node can send a maximum of 16 memories. This must be specified.
  • Do not repeat — only directly connected nodes can hear this memory.
  • Use short timeout — marks this memory to use the short timeout specified in the project settings, instead of using the long timeout.
  • Startup-test — enabling this requires the receiving node to receive a 0 before receiving a 1.

Figure 1.31 — A memory with the Global setting enabled.

Figure 1.31: A memory with the Global setting enabled.

Figure 1.32 — A global memory with memory number GM01.

Figure 1.32: A global memory with memory number GM01.

1.7.24 Referencing global memories

To reference a global memory in another node, expand the Memory category in the toolbox and drag a reference to the logic and select the global memory in the list of memories. Note the node column shows the node number and memory number of the memory.

Note

Referencing a global memory in the same node as it is created is the same as using a local memory.

Figure 1.33 — Referencing a global memory.

Figure 1.33: Referencing a global memory.

Figure 1.34 — A reference to a global memory.

Figure 1.34: A reference to a global memory.

1.7.25 Comments

Comments in the logic diagram can help readers to understand the functions implemented and are a very important part of designing logic. Comments should explain why the logic exists, what it does, and how it works. Commenting groups of blocks is more descriptive than commenting each block individually.

To create a Text Block, expand the Miscellaneous category in the toolbox and drag a Text Block to the logic diagram. Change the text and its size in the inspector.

The size of the text block can be changed by dragging the bottom-right corner with the mouse, as shown in Figure 1.35. Double-clicking in the text box sizes it to the text inside it.

Figure 1.35 — Resizing the text block can be done by dragging the bottom-right corner.

Figure 1.35: Resizing the text block can be done by dragging the bottom right corner.