EPLAN.EPLAN21.TERMINALSTRIP.CREATE

Contents

Description

Command for generating a terminal strip.

The EPLAN.EPLAN21.TERMINALSTRIP.CREATE command is called up via the API functions as specified in the EPLAN 21 API.

Parameters

All parameters have the prefix "EPL_PARAM_PROJECTDATA_CREATE_"!

ParameterID Type Description
PROJECT [IN]
EplHandle
Handle to the project/macro in which the terminal strip is to be generated.
PROPERTIES [IN, OPTIONAL]
Iterator
Handle to an iterator for properties. The identifying properties are copied to the new terminal strip device.
PAGE [IN, OPTIONAL]
EplHandle
Handle to the page from which further identifying properties for the new terminal strip device can be taken, e. g. plant/location.
XPOS [IN, OPTIONAL]
Integer
X-coordinate on the page from which further identifying properties can be read out, e.g. path or location of a location box at this position.
YPOS [IN, OPTIONAL]
Integer
Y-coordinate on the page, see parameter XPOS.
RESULT [OUT]
EplHandle
If the command is executed successfully, this parameter can be used to query the handle to the generated terminal strip.
RENAMED [OUT]
String
If the device tag of the terminal strip had to be renamed because a device with the same name was already existing, this parameter is set to "1".

Error Messages

The eplExecuteCommand function returns EPL_OK if the component could be successfully inserted into the page.

If the command fails, eplExecuteCommand returns the value EPL_ERROR. In this case, the error log can contain the following errors:

ErrorID Description
EPL_ERR_NO_RIGHT The current user group is not allowed to modify the project.
EPL_ERR_FAILED The object could not be created.
EPL_ERR_INVALID_ARGUMENT The PROJECT parameter or another parameter was invalid.

Example

The following example shows a function which creates a terminal strip.

EplHandle
createTerminalStrip(EplSession session, EplHandle hProject)
{
        EplHandle hRet(EPL_ERROR);

        //Create command
        EplHandle hCmd = eplCreateCommand(session, L"EPLAN.EPLAN21.TERMINALSTRIP.CREATE");

        if(hCmd != EPL_ERROR)
        {
                eplSetHandleParam(session,
                                  hCmd,
                                  EPL_PARAM_PROJECTDATA_CREATE_PROJECT,
                                  hProject,
                                  0);
                //Execute command
                if(eplExecuteCommand(session, hCmd) == EPL_OK)
                {
                        // Query result:
                        hRet = eplGetHandleParam(session,
                                            hCmd,
                                            EPL_PARAM_PROJECTDATA_CREATE_RESULT,
                                            0);
                        if(hRet != EPL_ERROR)
                                hRet = eplCloneHandle(session, hCmd);
                }
                eplCloseObject(session, hCmd);
        }
        return hRet;
}

Reference