 Using the Flow Chart editor

The ISaGRAF Flow Chart graphic editor allows the user to enter complete FC (Flow Chart) programs, with actions and tests (decisions) programmed in either ST, IL or Quick LD language. Flow Chart is a decision diagram which can also be used to describe sequential operations as it enables some advanced features such as non blocking backward jumps.

Basics of the FC language

Entering a Flow Chart

Working on an existing chart

Entering level 2 programs

Programming level 2 with Quick LD

Display options

Commands of the "Tools" menu

Calling other ISaGRAF tools

Other commands of the "File" menu

Updating the program diary

Selecting a variable from dictionary


Basics of the FC language

Flow Chart (FC) is a graphic language used to describe sequential operations. A Flow Chart diagram is composed of Actions and Tests. Between Actions and tests are oriented links representing data flow. Below are graphic components of the Flow Chart language:

Beginning of FC chart: A "begin" symbol must appear at the beginning of a Flow Chart program. It is unique and cannot be omitted. It represents the initial state of the chart when it is activated.

Ending of FC chart: An "end" symbol must appear at the end of a Flow Chart program. It is unique and cannot be omitted. It is possible that no connection is drawn to the "End" symbol (always looping chart), but "End" symbol is still drawn anyway at the bottom of the chart. It represents the final state of the chart, when its execution has been completed.

FC flow links: A flow link is a line that represents a flow between two points of the diagram. A link is always terminated by an arrow. Two links cannot be connected to the same source connection point.

FC actions: An action symbol represents actions to be performed. An action is identified by a number and a name. Two different objects of the same chart cannot have the same name or logical number. Programming language for an action can be ST, LD or IL. An action is always connected with links, one arriving to it, one starting from it.

FC tests: A test represents a boolean condition. A test is identified by a number and a name. According to the evaluation of attached ST, LD or IL expression, the flow is directed to "YES" or "NO" path. When programmed in ST text, the expression may optionally be followed by a semi-colon. When programmed in LD, the unique coil represents the condition value.

FC sub-program: The system enables the description of a hierarchized structure of FC programs. FC programs are organized in a hierarchy tree. Each FC program can call other FC programs. Such a program is called a child program of the FC program which calls it. FC programs which call FC sub-programs are called father program. FC programs are linked together into a main hierarchy tree, using a "father - child" relation. A sub-program symbol in a Flow Chart represents a call to a Flow Chart sub-program. Execution of the calling FC program is suspended till the sub-program execution is complete.

FC I/O specific action: An I/O specific action symbol represents actions to be performed. As other actions, an I/O specific action is identified by a number and a name. The same semantic is used on standard actions and I/O specific actions. The aim of I/O specific actions is only to make the chart more readable and to give focus on non-portable parts of the chart. Using I/O specific actions is an optional feature. I/O specific blocks have exactly the same behavior as standard actions.

FC connectors: Connectors are used to represent a link between two points of the diagram without drawing it. A connector is represented as a circle and is connected to the source of the flow. The drawing of the connector is completed, on the appropriate side (depending on the direction of the data flow), by the identification of the target point (generally the name of the target symbol). A connector always targets a defined Flow Chart symbol. The destination symbol is identified by its logical number.

FC comments: A comment block contains text that has no sense for the semantic of the chart. It can be inserted anywhere on a free space of the Flow Chart document window, and is used to document the program.


Entering a Flow Chart

To enter a chart, you have to place elements (actions, decision tests, connectors...) in the graphic area, and draw flow links between them.

Inserting objects

Selecting objects

Inserting comments

Drawing flow links

Using connectors

Moving objects

Resizing objects

Swapping the outputs of a test


Inserting objects

To insert an object in the diagram, select the corresponding button in the toolbar and click in the graphic area, where you want to insert it. You can either put the element on an empty area, or insert it in a flow by clicking on a flow link. Insertion on a link is allowed for top to bottom vertical links only.

You can insert the following basic elements:

action programmed in ST, IL or Quick LD

IO specific action (highlights a particular non portable action)

test (decision) programmed in ST, IL or Quick LD

connector

call to an FC sub-program

comment (description text)

The ISaGRAF Flow Chart editor also proposes you a list of classical Flow Chart structures. Such structures can only be inserted on an existing flow link. They cannot be put in an empty area:

If / Then / Else (binary selection)

Repeat until (waits for a condition)

While (loops while a condition is true)


Selecting objects

Selecting graphic objects is needed for most of the editing commands. The ISaGRAF FC graphic editor enables the selection of one or more objects existing in the diagram area. To select objects, the "select" (button with an arrow) choice must be checked in the editor toolbar. To select one object, the user only has to click on its symbol.

To select a list of objects, drag the mouse in the diagram to draw a rectangle area. All graphic objects in the selection rectangle are marked as "selected".

A selected object is drawn in dark blue color, with little black squares around its graphic symbol. It is also possible to add or remove one object to a multiple selection, by clicking on its symbol with Shift or Ctrl key pressed.

By making a new selection, selection of all objects previously selected is removed. To remove the existing selection, simply click with the mouse in an empty area, outside of the rectangle which borders the selected objects.

For single selection, it is possible to use keyboard arrows to move selection from one object to the other in the chart. Flow links can also be selected.


Inserting comments

Comments may be inserted anywhere in an empty part of the diagram. Comments have no influence on the program execution. They allow a higher readability of the diagram. To insert a comment block, select the corresponding button in the toolbar, and click in the diagram where comment must be put. Doucble click on a comment to enter / change its text. No special leading or trailing characters such as "(*" and "*)" are needed when entering the text of a comment block. A comment block may be resized by dragging the corners of its border when it is selected.


Drawing flow links

Select this button in the toolbar to draw a flow link between existing elements. A link must always be drawn in the direction of the flow. First select a non connected output point of an FC element, and drag the mouse to the destination point to insert the link. The destination point can either be the top (input point) of a non connected FC element, or any location on an existing link. Convergence points between links are shown with small gray circles in the Flow Chart. Convergence points can also be selected and moved in order to arrange the diagram.


Using connectors

The ISaGRAF Flow Chart editor enables the use of graphic connectors, as a replacement of a visible flow link. Connectors can be very useful to avoid very long links and increase chart readibility. A connector cannot be used to establish a link with another FC program.

A connector is put in the chart as other FC objects. It is represented by a circle containing the numerical reference of targeted element (destination of the flow link). The short description text of the target element is displayed close to the connector circle.


Moving objects

To move objects in the chart, you have to select them, and drag the mouse to move them within the chart. You can either move a single element or a multiple selection. Elements cannot be overlapped when moving them. Moving elements cannot be used to connect them to an existing link.

When a single element (action, test...) is moved, the ISaGRAF Flow Chart editor automatically moves with the selected element all objects placed below and connected to it. This feature does not operate in the case of a multiple selection.


Resizing objects

Any graphic element of a flow apart from "Begin", "End" symbols and connectors can be resized freely. To Resize an element, you first have to select it. Then drag with the mouse the small squares drawn on its border to change its size.

When an element is connected to a flow link, resizing it horizontally acts on both left and right borders, so that the element is still correctly centered on the link when resized.


Swapping the outputs of a test

You can swap locations of YES / NO outputs on a test (decision). To do that, simply double click on either "Yes" or "No" marks displayed close to the test symbol.


Working on an existing chart

The commands of the "Edit" menu are used to change or complete an existing diagram. Most of these commands act on the elements currently selected in the diagram.

Correcting a chart

Find and replace

Direct access to an element

Renumbering elements


Correcting a chart

The DEL key can be used to remove the selected elements. Pending links are deleted with selected elements. Use "Edit / Undo" command to restore elements after a DEL command. The DEL command can also be applied to a group of elements selected in the diagram. The "Cut", "Copy", "Paste" commands of the "Edit" menu are used to move or copy selected elements.


Find and replace

The "Edit / Find Replace" commands can be used to find or replace text strings in the complete program (all actions and tests programmed in ST, IL or Quick LD). The Find/Replace dialog box is used to enter a text to be searched and to directly open the programming section where the text is found.


Direct access to an element

The "Edit Go to" command allows the user to access an graphic element existing in the chart. The scrolling position is automatically adapted so that the element is visible. The element, when reached, is selected.


Renumbering elements

The "Edit / Renumber" command is used to renumber elements of the Flow Chart. Any FC element put in the chart is identified with a unique reference number. Reference numbers are allocated by the editor each time new elements are inserted. The "Renumber" allows you to re-adjust element numbering according to their location in the chart. Growing numbering is performed from top to bottom and from left to right


Display options

The "Options / Layout" command opens a dialog box where are grouped all the parameters and options concerning the editor workspace and the drawing of the diagram. Use the check boxes in the "Workspace" groupbox to display or hide editor toolbars and status bar. Option of the "Document" groupbox allow you to show or hide points of the editing grid and to display chart either in black and white or with colors.

Use the "Zoom" button of the toolbar to change current zoom ratio. This command is also available when working on a Quick LD program attached to an action or a test.

Use the "Grid" button of the toolbar to show or hide points of the editing grid. This command is also available when working on a Quick LD program attached to an action or a test.

Use the "Options / Font" command to select the name of the character font to be used in all ISaGRAF documents. When called from an ST or IL block, you can specified size of the font. When selecting font for a graphic view (FC or Quick LD), font style and size are not relevant and do not need to be specified. ISaGRAF graphic editors always calculate the font size according to the current zoom ratio.


Calling other ISaGRAF tools

Verify (compile) the program

 	Simulate or debug the application

Editing the dictionary of variables


Verify (compile) the program

The "File / Verify" command runs the ISaGRAF code generator to verify the programming syntax of the progam currently edited. In case of an FC program, both chart and level 2 instructions are checked. When syntax verification is complete, the code generator window must be closed to continue to work on the program. If there is only one program in the application (the edited one) the application code is generated if no syntax error is detected. The "Options / Compiling options" command is used to set compiling and optimizing parameters. Refer to chapter "Using the code generator" in this document for other information about compiling and code generation.


 	Simulate or debug the application

The "File / Simulate" and "File / Debug" commands run the ISaGRAF graphic debugger either in simulation or real connected mode, and re-opens the edited FC program in debug mode. Used in debug mode, no modification can be done in the program.


Editing the dictionary of variables

The "File / Dictionary" command is used to edit the dictionary of variables for the current application and the current program. It also contains the entry points to edit the user defined words. Local declarations or defined words relate to the program currently edited.


Other commands of the "File" menu

The following commands are available in the "File" menu of all program editors:

Open another program

Printing the program


Open another program

The "File / Open" command allows the user to close the program currently edited and to start editing another program of the current project written with the same language. This function cannot be used to edit a program written in another language. The new selected program replaces the current one in the editing window.


Printing the program

The "File / Print" command outputs the edited program on printer. This command runs the project document generator to print the contents of the edited chart.


Updating the program diary

The diary file attached to the edited program may be manually entered using the "File / Diary" command. The diary file is automatically updated with syntax checking output messages each time the program is compiled. Compiling outputs are completed with the compiling date / time stamp.

If the "Update diary" mode is selected in the "Options" menu of program editors, the "Diary" dialog box is opened each time the program is saved on disk.

If OK button is pressed, the entered text note is stored at the end of the diary file with current date / time stamp. This feature is very useful for maintenance of complete programs, as it provides useful help about the program life cycle.


Selecting a variable from dictionary

 When editing a text program (ST or IL) the "Edit / Insert variable" allows the selection of a declared variable name to be inserted at the current position of the caret. When editing LD or FBD programs, variable selection is required for the description of contacts, coils, block I/O parameters or FBD variable boxes. In both cases, the "Select" dialog box is open to select a declared variable.

The "Scope" selection box is used to select between global and local variables. The selection box on the right allows the selection of the data type. Small icons beside the type selection box are buttons that can be used as shortcuts to select most frequently used data types:

Boolean

Integer / Real

Timer

Message

To select a variable, click on its name in the list. Its name and comment are then displayed on the top of the list. Then press the "OK" button to confirm its selection. It is also possible to directly enter a variable name in the edit control without using the list.

The edit control can also be used to enter a constant expression.


Commands of the "Tools" menu

The following commands are available in the Tools menu. They are used to display information in a small text list at the bottom of the FC editing window:

Show compiler output	display in output window error messages from the last compiling

Find in diagram	find occurrences of a text in the whole diagram

and list them in the output window

Hide output window	close the output window

When error messages or occurrences are displayed in the output window, double click on a line shows you the location of the occurrence in the diagram.


Entering level 2 programs

To enter the level 2 program, the user must double click on the action or test symbol. The level 2 programming is displayed on the right of the FC window. The separation line between FC chart and level 2 programming can be freely moved. You can open one or two level 2 areas at the same time. The following commands are available from keyboard, mouse or the "Edit" menu:

Keyboard	Mouse	"Edit" menu

Open in last default window	Enter	Double Click	Edit level 2

Open in separate window	Ctrl+Enter	Ctrl + DoubleClick	Edit Level 2 in separate window

When two level 2 windows are visible, the separation between them can be freely moved. The button on the right of the level 2 title bar is used to close a level 2 window.

The default language for Level 2 programming is ST (Structured Text). The programming language can also be IL or Quick LD. The name of the selected language is displayed in a small box in the level 2 title bar. Run the "Options / Set Level 2 language" command from menus or click on that box to change the active language. This command is valid only if the level 2 programming window is empty.

A single line edit box appears at the top of the level 2 window. It is used to enter a short description text. This text will be displayed as an IEC comment in the drawing of FC symbols. It is very useful as it it used by other commands such as "Go To..." and also in the FC printout to document FC actions and tests.

The "Options / Refresh" command can be used at any time when level 2 windows are open to refresh the main FC chart with modified level 2 programs.


Programming with Quick LD

Quick LD editor is available for level 2 programming. In the case of a decision test, the LD diagram is made of just one rung, with only one coil which represents the decision. The name of the test is not repeated with the coil symbol. Below is an example of a test programmed in Quick LD.

When programming in Quick LD, use the keyboard arrows to move the selection in the programming logical grid, and then use the following shortcuts to insert symbols:

F2:	insert a contact after the selected symbol / initiate the rung

F3:	insert a contact before the selected symbol

F4:	insert a contact in parallel with the selected symbol

F5:	add a coil in parallel with the selected one (not for tests)

F6:	insert a block after the selected symbol

F7:	insert a block before the selected symbol

F8:	insert a block in parallel with the selected symbol

F9:	add a jump symbol in parallel with the selected coil (not for tests)

A jump leads to a rung name. The name of a rung can be entered by hitting ENTER when selection is on the rung head. The ISaGRAF editor keeps the memory of the rung labels you already entered, whether it has been specified for a rung name or a jump operation. The "Jump/Label"' dialog box gives you the possibility either to enter a new label, or to select an existing one. If you enter a new name, it will automatically be added to the list. The "Remove" button is used to remove the selected name from the list. It does not remove the label on the rung you selected in the diagram. To do this, just press OK when the edit box is empty.

You can also press buttons in the LD toolbar instead of hitting function keys.

Hit ENTER when the selection is on a contact or a block I/O parameter to select a variable or enter a constant value. Hit ENTER when the selection is on a function block to select the type of the function block. You can also double click on a symbol for the same effect.

Hit Control + SPACE bar when a contact is selected to change the type of contact or coil (direct, negated). Refer to the chapter "Using the Quick LD editor" in this document for more details about Quick LD capabilities.