This is a Clilstore unit. You can link all words to dictionaries.

3. IHC Simulation

What do we mean by simulation?

When you perform a simulation, you test the programme (or parts thereof) before you begin using the programme in the installation. This enables you to discover errors at a very early stage.

It is possible to simulate the effect of function blocks without transferring the IHC programme to a controller. If the programme does not function as intended, you can search for the error by inserting break points and then following the programme execution step by step. You can also simulate changes in the system variables ‘System time’, ‘System date’ and ‘System day’, and thereby simulate the occurrence of a particular time.

Offline simulation in IHC Visual

In IHC Visual, the physical installation does not form part of the simulation. The process therefore only involves you and your PC and is called ‘offline simulation’:

 


Offline simulation in IHC ServiceView

In online simulation, the physical installation and linked components are included. The process takes place in the programme IHC ServiceView.

General considerations for offline simulation in IHC Visual

You can simulate in both screens in IHC Visual:

  • In the configuration screen

  • In the programming screen.

 

Procedure for simulations

You will normally perform a simulation to confirm that one programme component functions as intended before starting work on another. The work in IHC Visual will therefore often involve switching between configuration, programming and simulation:


 

You cannot programme or configure in simulation mode

  • If you want to programme or configure, you must close simulation mode: Press [F7].

Simulation in the configuration screen

When switching from configuration mode to simulation, you remain in the same screen, but in simulation mode, IHC Visual indicates the states of inputs and outputs using the colours red/green:


In the configuration screen, you can simulate

  • A configuration

  • A function block

Simulate a configuration

You then simulate via inputs and outputs in the installation window. In other words: You test whether a sensor (an input) has the desired effect on an actuator (output), e.g.:


Procedure:

  1. In order to enter simulation mode: In the menu bar, select ‘Simulation’ – ‘Start simulation’

    [Shortcut: F8].

    2. In the installation window: Highlight the input (e.g. the left key on a low current press switch) and press :

    [Ctrl + Space] in order to keep the input ON (toggle)

    or

    [Space] for follow, i.e. the input remains ON for as long as you hold down the space bar.

Simulate a function block in the configuration screen

You then test whether a signal to the function block’s input has the desired effect on the output. This is relevant in configurations where you have linked several function blocks. You can then determine which function block contains an error:

 


Procedure:

  1. Start simulation mode: Press .

2. Highlight the Input to the function block and press

in order to keep the input ON (toggle)

or

for follow, i.e. the input remains ON for as long as you hold down the space bar.

Simulation in the programming screen

When you switch to simulation mode in the programming screen, you remain in the same screen, but IHC Visual indicates the states of the inputs and outputs using colour – as in configuration mode:

  • Red arrow = OFF

  • Green arrow = ON.

 

Here, you can simulate the individual commands in a function block. You do this by inserting break points between the commands. This enables you to localise an error in a programme to a function block:

 


 

Simulate a command in a function block:

  1. Switch to the programming screen: Press .

  2. For simulation mode: Press .

  3. In order to show the function block: Click on the + sign.

  4. Insert a break point as follows: Right-click on the line and select ‘Break point’ in the popup list.

  5. Press in order to keep the input ON (toggle)

or

press for follow, i.e. the input will then remain ON for as long as you hold down the space bar.

 

  • Back to programming mode: Press .

During the simulation, you can directly activate subprogrammes in function blocks in one of four ways:

A. You can alter the state of an input on a function block:

Highlight the Input on the function block and press

in order to keep the input ON (toggle)

or

for follow, i.e. the input remains ON for as long as you hold down the space bar.

 

B. You can alter the state of an output on a function block:

Highlight the output and press

in order to keep the output ON (toggle)

or

for follow, i.e. the input remains ON for as long as the space bar is being held down.

 

C. During the simulation, you can select ‘Power failure’.

IHC Visual will then simulate a PowerUp event (the power returns after a power failure). The programme activates subprogrammes that have this event inserted in the event group. 

When the event occurs, IHC will reset the variables which you have not selected in the ‘Save value in event of power failure’ field under the ‘Properties’ menu.

When you switch to simulation mode, IHC Visual will automatically check all function blocks with ‘PowerUp’.

‘PowerUp’ takes place based on your PC’s clock.

  • If the programme does not function as intended: Search for the error by inserting break points. This enables you to follow the programme execution step by step.

 

  1. You can let the system variables, ‘System time’, ‘System day’ or ‘System date’ reach the value that you

    specified in the subprogramme’s event group:

The simulation time and date will be shown in the bottom right of the status line. It is always the computer’s settings

that are shown here when simulations commence.

  • In order to alter the simulation time during the simulation: Press . The following

dialog box will then appear:

 


 

Time:Enter the simulation time in the format tt:mm:ss.

 

Date: Enter the simulation date in the format dd-mm-yyyy. Click on the arrow to bring up a

calendar. You then do not need to remember days.

 

OK: Select this to save new entries, or press ‘Cancel’.

NB: If you cancel the simulation and later start a new simulation, the programme will not remember the simulation time and date. The computer will then always use its own settings.

Example 1: Clock control: ‘7-day clock with 1 on-time’

We want to find out whether the function block functions as intended. The function block is shown below:


 

 

IHC Visual activates the function block through the system time adopting the same state as the ‘On’ time (08:00), but only on the days Tuesday to Saturday. We investigate whether the function block functions correctly:

 

  1. Put IHC Visual in simulation mode: Press .

2. In order to set the date and time: Press . Enter values in the dialog box as shown below.

NB: The system is event-controlled, so you must set the simulation time as shown below to just before

08:00:00:


  1. Click on the ‘OK’ icon.

    The simulation time in the bottom right in the status bar shows the time 07.59:55 and the date

Wednesday 25 May 2005.

When the clock reaches 08:00, the output will switch from ‘OFF’ to ‘ON’.

Break points and step by step simulation

If you want to find errors in your IHC programme, it is a good idea to insert a break point where you suspect the error may be. You can then perform the simulation line by line.

 

You insert a break point as follows:

  1. Right-click on the line where you want to insert the break point.

  1. Select ‘Break point’ in the popup list.

    IHC Visual inserts a break point icon, a full stop sign, at the start of the line (illustrated below).

 

  1. You can now perform the simulation line-by-line: Press .

    When the simulation reaches the break point, the simulation will stop.

If you want to remove the break point again:

  1. Right-click on the line with the break point.

  1. Select ‘Break point’.

    IHC Visual has now removed the break point.

Example 2: Step by step simulation

The function block ‘7-day clock with 1 on-time’, where we have inserted a stop time upon occurrence of the event ‘System time’- ‘Time’, is shown below.

 


 

 

When this event occurs, IHC Visual will stop the simulation at this line and also highlight the line. You can then execute the individual lines step by step: Press .

Simulation log

  • You can activate a simulation log: Press . A dialog box will then appear:


 

Log settings: Insert a tick in the tickboxes you want to include in the log:

  • Events

  • Conditions

  • Commands

  • Value change (each time a variable changes state)

  • Links (links between function blocks and components)

  • Log highlighted.

The selected items will be shown in the window as the programme executes them:

 

Log highlighted: If you select this field, you must not select the field ‘Value change’.

 

On inputs and outputs, you can:

  • right-click (also applies in simulation)

  • select ‘Log Highlighted’

or

  • press .

so that you only log the inputs and outputs with ‘Log Highlighted’ - i.e. not

all inputs and outputs.

There are also three ‘buttons’:

 

Empty log: Here, you can empty the log.

 

Stop: Here, you can stop the recording in the log. When you click on this button, it changes name to ‘Start’. The programme will not write anything in the log until you have clicked on it again. Note that the actual simulation continues and the ‘Stop’ button is only of significance to the registrations in the log.

 

Save: Here, you can save the log in an Excel file. This enables you to export the entire log.

 

It can be useful to show the log while you carry out the staged review of a programme. This will enable you to view the desired events in the log while you press .

The log can also be used when you want a simulation over a longer period of time, e.g. in connection with troubleshooting.

Short url:   https://multidict.net/cs/1665