Converting source files to XMI files

logi.CAD 3 provides a tool for converting logi.CAD 3 source files to XMI files. Those XMI files can be used e.g. to test your implemented rules.
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg If you want to implement some model rules, contact logi.cals and ask for the appropriate information from the English documentation "logi.CAD 3 administrator's manual".

Good to know

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/lightbulb.svg The tool is intended for usage by an experienced user of logi.CAD 3.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/lightbulb.svg A condition for the successful usage of the tool is the knowledge of the action to be executed as it would be executed in the graphical user interface of logi.CAD 3.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/lightbulb.svg The output of the tool is in English only.

Preparation

  1. Make sure that logi.CAD 3 is installed. Have the following information prepared:

    • The path to the logi.CAD 3 installation directory

    • The path to the desired workspace
      The workspace must not contain any projects. In case the workspace does not exist, the tool creates it.

    • The path to the logi.CAD 3 source files that should be converted

    • The path to the log configuration file (see below for more information)
      A sample configuration file is included in the installation of logi.CAD 3.

  2. Open a command line: e.g. cmd.exe under Windows and navigate to the logi.CAD 3 installation directory.

Invocation

logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.testing.iecsourcetoxmi.application -noSplash -iecSource <SOURCE_FILE> -referenceFiles <REFERENCE_FILES> -data <WORKSPACE> -vmargs -Dlog4j.configuration=file:<LOG-CONFIGURATION>

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg Invoking the tool under Linux is not officially supported. However, if you want to try invoking the tool under Linux nevertheless, replace the part logiCAD3c --launcher.ini logiCAD3.ini -application of the above-mentioned invocation by logiCAD3 -application. The remaining part of the invocation is identical to the above-mentioned invocation.

Description of parameters:

Parameter

Description

Examples

<SOURCE_FILE>

absolute path and name for the logi.CAD 3 source file
The resulting XMI file will be created with the same name as the logi.CAD 3 source file but with extension .xml.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg Important: logi.cals recommends to check the resulting XMI file for absolute paths. If specifications with absolute paths are listed in the XMI file, replace the absolute path with the required relative path.
Example: Replace C:\toConvert\src\TestFunction.iectst#//@userPouDeclarations.0 with: TestFunction.iectst#//@userPouDeclarations.0

C:\toConvert\src\lrealVarsAreUsed.iecst

C:\toConvert\src\UsageOfTestFunction.iecfbd

<REFERENCE_FILES>

absolute path and name for the logi.CAD 3 reference files
The resulting XMI files will be created with the same name as the logi.CAD 3 reference files but with extension .xml.

The parameter -referenceFiles is optional. However, specify this parameter, if the logi.CAD 3 source file uses other elements, such as block calls or data types that are specified in other files. If you do not specify this parameter, only the XMI file for the logi.CAD 3 source file is created but it contains wrong references.
Example: Specify this parameter (see example 2 below), if the logi.CAD 3 source file UsageOfTestFunction.iecfbd contains a call of the block MyTest that is specified in the file TestFunction.iecst.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg Important:

  • logi.cals recommends having as few references as possible. For instance, make sure that the reference files do not use block calls and/or data types that are specified in different reference files again.

  • If calls of the logi.CAD 3 system blocks are used (e.g. AND block, RS block), a similar interface of this block has to be specified in a reference file. Of course, this reference file has to be specified by the parameter -referenceFiles as well.

C:\toConvert\src\TestFunction.iecst

<WORKSPACE>

absolute path to the workspace

C:\temp\LC3WorkspaceWithoutAnyProjects

<LOG-CONFIGURATION>

path to the log configuration file
All messages of the tool will be output to the device as specified in the log configuration file.

C:\LC3LogConfig\log4j.xml

  • The parameter -noSplash is optional. If it is not specified, the splashscreen of logi.CAD 3 is displayed after the invocation.

  • The parameter -Dlog4j.configuration is also optional . However, logi.cals recommends to specify this parameter so that log events are output .

Example 1 for invocation
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.testing.iecsourcetoxmi.application -noSplash -iecSource C:\toConvert\src\lrealVarsAreUsed.iecst -data C:\temp\LC3WorkspaceWithoutAnyProjects -vmargs -Dlog4j.configuration=file:C:\LC3LogConfig\log4j.xml
Example 2 for invocation
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.testing.iecsourcetoxmi.application -noSplash -iecSource C:\toConvert\src\UsageOfTestFunction.iecfbd -referenceFiles C:\toConvert\src\TestFunction.iecst -data C:\temp\LC3WorkspaceWithoutAnyProjects -vmargs -Dlog4j.configuration=file:C:\LC3LogConfig\log4j.xml

Log configuration file

This file is needed to configure the log4j logging mechanism. The file specifies how log events are output.

Sample log configuration file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="false" xmlns:log4j='http://jakarta.apache.org/log4j/'>
<!-- This configuration logs to console. -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="target" value="System.out"/>
<param name="immediateFlush" value="true"/>
<param name="encoding" value="UTF-8"/>
<param name="threshold" value="info"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p: %m%n" />
</layout>
</appender>
 
<!-- This configuration logs to a file, with more information than for the console. -->
<appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="C:\\temp\\logfile.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{HH:mm:ss} %-5p [THREAD ID=%t] [Method:%M] %c{1}:%L - %m%n" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</log4j:configuration>

Troubleshooting

The file that is specified in the log configuration file contains information about the conversion.

The return code 0 indicates that the conversion has been successful.
If the conversion has not been successful, fix the problem according to the following table.

Return code

Message in addition to 'Conversion failed'

Cause

Solution

13

<no message>

wrong value specified for -application

Invoke the tool as specified above.

-1

Missing required option: Name

An argument or parameter is missing.

Invoke the tool as specified above.

-127

(Details: exception message)

An unexpected error has occurred.
Example: The logi.CAD 3 source file is invalid

Make sure that the conversion is invoked correctly.
Regarding the example: Make sure that the parameter -iecSource specifies the correct source file.