Office 0049-(0)40 - 866 298 75
Mobil 0049-(0)171-28 52 405

PMS Structogram Editor SG2

Develop Embedded Real-Time Code with the Structogram Editor SG2

What is a structogram ?

A structogram is a graphical way to plan processes on a structural and modular basis. Allthough structograms can be applied for all kinds of purposes it is mainly known amongst proffessional software developers. When you are programming in structograms there is no way around a structural and modular software. So your software has a high quality from the very beginning. Due to SG2 structograms are allway easy to modify and extend. Your collegues will have no problem to understand your intuitivly understandable structograms. So the working in teams is as eased as much as possible.

How can SG2 improve and speed up my programming tasks ?

The structogram editor SG2 is a new release from PRAHM, the leading company for graphical programming tools. In contrast to other structogram editors, SG2 is very easy to handle. SG2 enables you to create your structograms as easy as creating a text in a text editor. All the features which you are used to from for example MS-Exel are just as easy accessible in SG2: insert and delete rows and columns, change the width of rows and columns and insert and modify all structogram objects by a single mouse click.

But SG2 can do much more. SG2 is an intelligent editor. When you for example insert or delete structogram elements, SG2 allways automatically keeps a clean structural and modular structure for you. SG2 knows your wishes and intentions and can speed up your work, so you reach your spare time faster and more relaxed. Say good bye to complicated and inefficient structogram editors of other suppliers and enjoy the power and flexibility of SG2 from PRAHM.

An Exploration Tour through SG2

Invoking SG2

You´ve got different possibilities to call SG2. Most people will call SG2 from the user interface of CONTROL2000, by either selecting the editors menu of CONTROL2000 or by clicking on a structogram file in the project explorer of CONTROL2000. Other possibilities to call SG2 is via the MS-Explorer or via a reference.

By default SG2 opens an empty page with the dimensions of DIN A4 and portrait orientation. If you need another page setup make the needed changes in the menu "File - Page Setup".

Working with SG2

You can now directly start to write your structgram. Click on the "While" icon or activate the menu "Objects - New While". In the upcoming dialogbox you can enter the while statement and the number of statements inside the while loop. Click the OK or escape button. You don't have to be anxious, that you are making incorrect inputs, because all kinds of changes can later on easily be undone. When you really have made a bigger mistake, you can easily undo you inputs by activating the menu "Edit - Undo. SG2 offers you unlimited undo and redo operations.

Now we want to enter an if block. Mark one of the lines in the while block by clicking there with the mouse, then click on the "If" icon. In the upcomming dialog box you complete the if statement and determine the number of statements of the if block. After clicking on the OK button the if block will appear inside the while block.

Now move the vertical line between the then and else block to the right by simply clicking on the line and moving it to the right while keeping the mouse button pressed. In the menu "Settings - Snap Distance" you can easily change the snap distance, when you feel uneasy with the actual setting.

Mark one of the lines inside the then block . Click on the "Switch" icon. In the upcoming dialog box you can complete the switch statement and determine the number of cases and number of statements in the switch block.

Play around with the user interface of  SG2 to get a feeling for this programming tool. You will see, that SG2 is easy to operate and yet a very powerfull programming tool. All the elemets of your structogram can be modified by clicking on the position where you want the modification to happen, and then simply edit whatever you want.

You can click everywhere with the right mouse button to open a proper context menu. All kinds of manipulations are at your fingertips. Try to insert and delete rows and columns to find out how easy this can be done.

The input and outputs of your program

You can supply your program with input parameters and return values. The "Target Code"properties dialog box offers you an easy way to enter the needed inputs and outputs. Just select the menu "settings - target code", then select the target code (propably "High Level Language C"). 

By clicking the radio buttons under "Input and Outputs" you can control the way the IO parameters look like in the generated code. The selection "Global Variabes" generates a C code, where all IOs are done via global variables. The selection "Parameters and return" causes a code generation where all inputs are implemented via parameters and all outputs via a proper return statement. The selection "Global structure" creates a structure in a header file, in which all IOs are placed. A respective ".fub" file is created automatically to enable you to connect different structograms by the function block editor "FB2000".

Select "Automatic parameter generation" when you want SG2 to generate the structure and ".fub" files automatically when you generate C code by saving your structogram. Click on the button "Set input and outputs" when you want to display or edit the inputs and outputs of your structogram.. The "Function Block Properties" dialog box will open then. To add a new parameter, click on "Add", then select either "Create new input" or "Create new output". Mark the name, type ect of the element which you want to modify and then click on "Modify" to do the modifications. The "Add" and "Delete" buttons enables you respective operations. The "Up" and "Down" keys enables you to change the sequence of input and outputs as disired.

The resulting C Code

When you have finished your structogram, click on the save icon or activate the menu "File - Save" or "File - Save As". Attention ! The Undo functionallity is now reset, so only new inputs can be undone from now on. When you have made errors in your statements (you still have to stick to the C standard) they will be displayed directly in your structogram, enabling you to speed up corrections work.

When you see the statement "No errors in your structogram" SG2 has created a C source code which corresponds to your structogram. The input and outputs of your program as you have entered them in the "Function Block Properties" dialog box are cast into a proper C code.

For the creation of C code you need a proffesional or enterprize version of SG2, so you might eventually need an update to one of these versions. A demo or standard version will not be anough. Look at the About Dialog (menu "Help - Info about SG2" ) to see which version you are working with.

Have a look at our home page www.prahm-ms.de to get informed about our products and to be able to directly order a respective version in our web shop.

Adopt SG2 for your needs

The settings menu offers you several possibilities to adapt SG2 for your needs. The snap distance setting is allready mentioned above. You will find other menus for setting colors, text fonts, target code and different drawing settings. You can use the reference menu for creating and maintaining symbol tables.

How you can integrate the other PMS editors

All graphical CONTROL2000 editors are in the end C editors, so it is not hard to understand that you can integrate the other PRAHM editors for the software development of your projects. To acomplish this, enter not only the C modules of a project in the CONTROL2000 project explorer but also the original structogram, flow chart, state diagram, dicision chart and function block module files.When you activate one of the build menues or icons a new target code is generated automatically.