Formula Editor

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Formula Editor

 

The formula editor is used to add new or edit existing formulas.

Editfenster_Eingabe

 

Expressions can be entered into the large text field in the center of the window. An expression consists of a series of assignments. Comments can be included. Comments beginning with // are valid until the end of the line, whereas comments beginning with /* must be closed with a */ but can include several lines or only part of the line.

 

The formula entered can be activated/deactivated by checking the Active check box. It always has the same status as the check box in the main window.

 

In the input field “Name”, a unique name can be assigned for the formula, which is also displayed in the formula list in the main window. If no name is assigned, the formula is assigned the name “unnamed” after closing.

 

The evaluation point is set using a dropdown list. This determines when a formula is evaluated. Many evaluation points require additional information, which can be entered or selected in another input field. This additional field is displayed after every set evaluation event. It is possible to drag elements to this field from the CanEasy tree using drag & drop editing.

 

The following evaluation events are available:

Evaluation event

Dependency

Description

No evaluation

None

No automatic evaluation of the formula. An evaluation can be performed using the context menu of the formula list in the main window.

Pre transmit

Message

Evaluation is performed before the selected message is sent.

Changes in message data at the time of evaluation are considered when the next message is sent.

After transmit

Message

Evaluation is performed after the specified message is sent.

On receive

Message

Evaluation is performed when the specified message is received (only available for real ECUs).

On simulation start

None

One-time evaluation at the start of the simulation.

On simulation stop

None

One-time evaluation at the end of the simulation.

As Action

None

Defines the formula as an action within CanEasy to make the formula available in the alarm and shortcut plug-ins as a response to events.

Interval

Cycle time in milliseconds

Cyclic evaluation according to the cycle time.

After evaluation unit

Evaluation unit

Evaluation of the formula according to the selected evaluation unit (Formula).

 

After editing a formula, changes can be applied with the OK button. The expression is checked and the dialog window is closed if the check was successful. Checking the formula without applying changes and closing the dialog is possible by clicking on the button “Test”. The dialog can be closed without applying changes by clicking the “Cancel” button.

 

If errors are found when checking the formula, a corresponding message dialog window is displayed. Besides possible errors concerning the evaluation time point, errors in the expression of the formula are detected. To obtain exact information on these errors, the LogBrowser is opened additionally.

If a formula check is started using the respective button, only the LogBrowser is displayed.

 

Logbrowser

 

Specific message groups can be hidden or unhidden using the four buttons in the LogBrowser’s toolbar. From left to right, all messages, errors, warnings and instructions can be found. The numbers in brackets preceding the messages provide the row and column where an error has been found.