With the S7 writer task you can extract or calculate data from an iba .data file (DAT file) and write this data to data blocks (DBs) within an S7 PLC. In this task, you can define ibaAnalyzer expressions with S7 operands. When executing the task, these expressions are evaluated and sent to the S7.To use the S7 Writer task, you need the ibaDatCoordinator S7 Writer license; see

To use the S7 writer task, you need the ibaDatCoordinator S7 Writer license; see Licenses.

The following requirements must be met in order to use the task:

  • S7 PLC for writing the data

  • Connection to the S7 PLC via TCP/IP

The task-specific settings are explained below. For all other settings, see General task settings.

Configuration

S7 connection parameters

Here you can configure the connection to the S7. The Connection type can be PG, OP or "other". You can select a connection type that is available on your S7. Enter the IP address of the S7 CPU into the field Address and enter the corresponding Rack and Slot number.

Optional analysis

Optionally, you can specify an ibaAnalyzer analysis file (PDO file). When processing a DAT file, this analysis is first loaded before the expressions written to the S7 are evaluated.

This allows you to define more complex expressions in the analysis and refer to these expressions in the expressions for the S7 signals. This enables simpler expressions for the S7 signals which reference expressions in the analysis directly.

Enter the path and file name in the field or select the file using the browser button. Click on the ibaAnalyzer button to check whether ibaAnalyzer can open the PDO file.

Define S7 signals

In the table you can define the S7 signals. You can add any number of signals by entering new data records in the last row. You can also select signals or modules from the signal tree and add them to the value table using drag and drop. The signal tree is displayed as soon as you load an analysis file in the Optional analysis field or a DAT file in the Example DAT File field. The table contains the following columns:

  • ibaAnalyzer expression: Enter a valid ibaAnalyzer expression here. This expression is evaluated when executing the task and the result is written to the S7. Ideally, you should enter an expression that evaluates to a constant value. However, if the result of the expression is a fluctuating signal, the signal is averaged before it is processed.

  • DB: The number of the data block to which the data will be written.

  • Address: The address within the data block to which the data will be written.

  • Bit: When it is a digital signal, this is the bit number to which the data will be written.

  • S7 data type: Type of data to be written. Use BOOL for digital signals.

  • Test value: This displays the values of the expressions when they are evaluated using a test DAT file.

You can copy and paste text into the table, e.g. from ibaAnalyzer. You can delete rows by highlighting a row and then pressing the <Delete> key.

Ignore expressions that cannot be evaluated.

If disabled, the task will not be executed if any of the expressions cannot be evaluated. If you enable this option, signals whose expressions cannot be evaluated will not be written. The other signals with valid expressions are written. If there are no expressions that can be evaluated, the task is canceled.

Test ibaAnalyzer expressions

You can test the ibaAnalyzer expressions in the S7 signal table using a test DAT file. Enter the path for the test file into the text field or select a file using the browse button. If the specified DAT file exists and can be accessed, you can click <?>. Otherwise, the button will be grayed out.

After performing the test, the Test value column will be populated with the valid expressions. If the expressions are invalid, the column remains empty. A window will appear with one of the following messages:

Error message

Possible cause/remedy

Analysis file not found

The specified analysis file (PDO file) does not exist or is not accessible. The task will fail when it is executed. Remember that you do not have to specify an analysis. You can therefore leave the text field empty, so this error will not occur.

Class not registered

ibaAnalyzer is not installed or a very old version is installed (older than 5.0.0). The task will fail when it is executed.

Your current ibaAnalyzer version is x.y.z. Please update to at least version 6.5.0. We recommend version 6.7.0 or higher. (x.y.z stands for your current ibaAnalyzer version)

This message is displayed if the ibaAnalyzer version is older than 6.7.0. If the version is older than 6.5.0, the execution of the task will fail. If the version is greater than or equal to 6.5.0 but less than 6.7.0, the task will be executed successfully, but with a possible loss of accuracy. (Only floating point numbers with simple precision are used.)

Expression for operand X could not be evaluated (X is an S7 operand)

The ibaAnalyzer expression is invalid or the signals used by the expression do not contain any data or are empty. The task may fail depending on whether the option "Ignore expressions which cannot be evaluated" is enabled. This message is repeated for every operand for which the corresponding ibaAnalyzer expression could not be evaluated.

No valid fields are specified to write to the S7.

None of the operands has an evaluable ibaAnalyzer expression (or operands are not defined at all). The task will fail when it is executed.

In addition, the following error messages can appear:

Error message

Possible cause/remedy

Error 0xFFF50004 (AGL40_TIMEOUT) when calling function AGLPLCConnect

No connection can be established to the S7. Check the specified IP address. You can also check if the S7 is reachable by pinging it.

Error 0xFFF5001C (AGL40_PLC_NOT_FOUND) when calling function AGLPLCConnect

A connection can be established with the IP address, but this does not belong to an S7 CPU. Check the specified IP address. Also check that the rack and slot numbers are correct.

Writing operand X returned error Error 0xFFF5000A (AGL40_NO_DATA_ERROR) when calling function AGL_WriteMixEx

The operand is not available in the S7. Check that both the DB number and the address are correct.