Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4COM)  1.26.2
ILogic Interface Reference

Inherits IDispatch.

Collaboration diagram for ILogic:
Collaboration graph

Classes

struct  ApplicationInfo
 
struct  ApplicationOpState
 
struct  ApplicationTaskInfo
 
struct  LogicArrayRange
 
struct  LogicSymbolInformation
 
struct  LogicUserTypeInformation
 

Public Types

Public Member Functions

HRESULT WriteVariableBySymbol ([in] BSTR symbol, [in] VARIANT data)
 
HRESULT ReadVariableBySymbol ([in] BSTR symbol, [out, retval] VARIANT *data)
 
HRESULT GetInformationOfSymbol ([in] BSTR symbol, [out, retval] struct LogicSymbolInformation *info)
 
HRESULT GetInformationOfUserType ([in] BSTR symbol, [out, retval] SAFEARRAY(struct LogicUserTypeInformation)*logicInfo)
 
HRESULT ReadVariableBySymbolAsString ([in] BSTR symbol, [out, retval] BSTR *data)
 
HRESULT WriteVariableBySymbolAsString ([in] BSTR symbol, [in] BSTR data)
 
HRESULT LoadBootApplication ([in] BSTR file, [in] BSTR path, [out, retval] BSTR *applicationName)
 
HRESULT GetNumberOfApplications ([out, retval] LONG *number)
 
HRESULT GetNameOfApplication ([in] LONG index, [out, retval] BSTR *application)
 
HRESULT StartApplication (void)
 
HRESULT StopApplication (void)
 
HRESULT ResetApplication ([in] ApplicationResetMode mode)
 
HRESULT SetCapabilityOfOperation ([in] LogicCapabilityOperation operation, [in] LogicCapabilityOperationValue value)
 
HRESULT GetCapabilityOfOperation ([in] LogicCapabilityOperation operation, [out, retval] LogicCapabilityOperationValue *value)
 

Public Attributes

const LONG LOGIC_MAX_DIMENSION_OF_ARRAY = 3
 

Properties

IApplications Applications [get]
 

Detailed Description

Definition of the ILogic interface which allows access to the PLC and logic component on the MLPI device.

The ILogic interface contains various methods of accessing different methods of the PLC and Logic subsystems. It makes it possible to read and write symbolic variables as well as input and output memory areas of your PLC application. It is even possible to change, load, start, stop or reset your PLC applications on the device.

Definition at line 73 of file ILogic.idl.

Member Enumeration Documentation

This enumeration defines the state of an application using IApplication::GetStateOfApplication.

Enumerator
STATE_NONE 

Invalid state of application.

STATE_RUN 

The application is in state RUN.

STATE_STOP 

The application is in state STOP.

STATE_BP 

The application is halted on breakpoint.

Definition at line 79 of file ILogic.idl.

This enumeration defines the different reset possibilities of an application using ResetApplication.

Enumerator
RESET_WARM 

Reset warm of application, all global data except retain data are reset to their default values.

RESET_COLD 

Reset cold of application, all global data and (!) retain data are reset to their default values.

RESET_ORIGIN 

Reset application back to origin, delete the application, delete all application files (bootproject, etc.), reset all global and retain data.

Definition at line 89 of file ILogic.idl.

This enumeration defines the access rights to a variable.

Enumerator
ACCESS_RIGHTS_NONE 

No access rights to the variable.

ACCESS_RIGHTS_READ 

Read access rights to the variable.

ACCESS_RIGHTS_WRITE 

Write access rights to the variable.

ACCESS_RIGHTS_READWRITE 

Read and write access rights to the variable.

Definition at line 98 of file ILogic.idl.

This enumeration defines the different symbol types of the logic using GetInformationOfSymbol.

Enumerator
LOGIC_TYPE_BOOL 

1 Byte (BOOL8)

LOGIC_TYPE_BIT 

1 Bit, symbolic access unsupported

LOGIC_TYPE_BYTE 

8 Bit (BYTE)

LOGIC_TYPE_WORD 

16 Bit (USHORT)

LOGIC_TYPE_DWORD 

32 Bit (ULONG)

LOGIC_TYPE_LWORD 

64 Bit (LLONG)

LOGIC_TYPE_SINT 

signed short integer - 1 Byte (BYTE)

LOGIC_TYPE_INT 

signed integer - 2 Byte (SHORT)

LOGIC_TYPE_DINT 

double integer - 4 Byte (LONG)

LOGIC_TYPE_LINT 

long integer - 8 Byte (LLONG)

LOGIC_TYPE_USINT 

unsigned signed short integer - 1 Byte (USHORT)

LOGIC_TYPE_UINT 

unsigned signed integer - 2 Byte (USHORT)

LOGIC_TYPE_UDINT 

unsigned double integer - 4 Byte (ULONG)

LOGIC_TYPE_ULINT 

unsigned long integer - 8 Byte (LLONG)

LOGIC_TYPE_REAL 

floating point IEC 559 - 4 Byte (FLOAT)

LOGIC_TYPE_LREAL 

floating point IEC 559 - 8 Byte (DOUBLE)

LOGIC_TYPE_STRING 

character strings (WCHAR16)

LOGIC_TYPE_WSTRING 

Symbolic access unsupported.

LOGIC_TYPE_TIME 

32 Bit, Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A.M.

LOGIC_TYPE_DATE 

32 Bit, Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A.M.

LOGIC_TYPE_DATEANDTIME 

32 Bit, Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A.M.

LOGIC_TYPE_TIMEOFDAY 

32 Bit, Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A.M.

LOGIC_TYPE_POINTER 

Symbolic access unsupported.

LOGIC_TYPE_REFERENCE 

Symbolic access unsupported.

LOGIC_TYPE_SUBRANGE 

Symbolic access unsupported.

LOGIC_TYPE_ENUM 

16 Bit user type

LOGIC_TYPE_ARRAY 

Array.

LOGIC_TYPE_PARAMS 

Symbolic access unsupported.

LOGIC_TYPE_USERDEF 

Symbolic access unsupported.

LOGIC_TYPE_NONE 

Symbolic access unsupported.

LOGIC_TYPE_ANY 

Symbolic access unsupported.

LOGIC_TYPE_ANYBIT 

Symbolic access unsupported.

LOGIC_TYPE_ANYDATE 

Symbolic access unsupported.

LOGIC_TYPE_ANYINT 

Symbolic access unsupported.

LOGIC_TYPE_ANYNUM 

Symbolic access unsupported.

LOGIC_TYPE_ANYREAL 

Symbolic access unsupported.

LOGIC_TYPE_LAZY 

Symbolic access unsupported.

LOGIC_TYPE_LTIME 

Symbolic access unsupported.

LOGIC_TYPE_BITCONST 

Symbolic access unsupported.

LOGIC_TYPE_MAX_TYPE 

Symbolic access unsupported.

LOGIC_TYPE_UNSUPPORTED 

Symbolic access unsupported.

Definition at line 108 of file ILogic.idl.

This enumeration defines the possible capability to execute an operation.

Enumerator
LOGIC_CAP_OPERATION_ENABLE 

Enable capability to execute an operation (default).

LOGIC_CAP_OPERATION_DISABLE 

Disable capability to execute an operation.

Definition at line 218 of file ILogic.idl.

This enumeration defines an operation which can be enabled/disabled by using SetCapabilityOfOperation. The current capability can be read by GetCapabilityOfOperation. The capability will be set global for all applications.

Enumerator
LOGIC_CAP_OPERATION_STOP 

Capability to execute the operation 'stop application'.

LOGIC_CAP_OPERATION_RESET 

Capability to execute the operation 'reset application'.

LOGIC_CAP_OPERATION_DOWNLOAD 

Capability to execute the operation 'download application'.

LOGIC_CAP_OPERATION_ONLINE_CHANGE 

Capability to execute the operation 'online change application'.

LOGIC_CAP_OPERATION_SET_BREAKPOINT 

Capability to execute the operation 'set breakpoint into an application'.

LOGIC_CAP_OPERATION_WRITE_VARIABLE 

Capability to execute the operation 'write variable of application'.

LOGIC_CAP_OPERATION_FORCE_VARIABLE 

Capability to execute the operation 'force variable of application'.

Definition at line 228 of file ILogic.idl.

This enumeration defines the memory areas 'Ix' (Input), 'Qx' (Output) and 'Mx' (Marker) of an application.

Enumerator
MEMORY_AREA_INPUT 

'Ix' input memory area (Input) of an application.

MEMORY_AREA_OUTPUT 

'Qx' output memory area (Output) of an application.

MEMORY_AREA_MARKER 

'Mx' marker memory area (Marker) of an application.

Definition at line 241 of file ILogic.idl.

Member Function Documentation

HRESULT ILogic::WriteVariableBySymbol ( [in] BSTR  symbol,
[in] VARIANT  data 
)

The following function writes I/O data. The function is only able to write a single value at a time. Use this function for sporadic writing of different PLC data.

Note
To be able to write a symbolic variable in the PLC, you need to add it to the 'Symbol Configuration' within the logic project in IndraWorks. If you don't know how to do this, please look at the IndraLogic help system and search for 'Symbol Configuration'.

After you set up the 'Symbol Configuration', you should be able to write a symbolic variable by its name. Please keep in mind that you have to use all name spaces for this variable. For example, if you have a variable "x1" in your task called "Prog", then you have to ask for the variable "Application.Prog.x1" It is not possible to write a floating point value into an integer variable and vice-versa. You can also only write smaller data types into data types of the same size or greater. Writing a USHORT(2 Byte) into a WORD (2 Byte) or a DWORD (4 Byte) is okay. Trying to write a USHORT into a BYTE will fail and produce an error code.

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[in]dataThe value to which the IO is to be written.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// get interface to first application
IApplication app = connection.Logic.Applications[connection.Logic.GetNameOfApplication(0)];
// write a variable to the PLC. This variable has to exist on the control and has to be part of the symbol table.
string variableName = "Application.UserVarGlobal.varReal";
object variableValue = 3.1415926535897932384626433832795;
connection.Logic.WriteVariableBySymbol(variableName, variableValue);
// print value of variable to console
Console.WriteLine("Value of PLC variable '" + variableName + "': " + variableValue.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicWriteVariableBySymbol, where you can find further documentation.
HRESULT ILogic::ReadVariableBySymbol ( [in] BSTR  symbol,
[out, retval] VARIANT *  data 
)

The following function reads I/O data. The function is only able to read a single value at a time. Use this function for sporadic reading of different PLC data.

Note
To be able to read a symbolic variable in the PLC, you need to add it to the 'Symbol Configuration' within the logic project in IndraWorks. If you don't know how to do this, please look at the IndraLogic help system and search for 'Symbol Configuration'.

After you set up the 'Symbol Configuration' you should be able to read a symbolic variable by its name. Please keep in mind that you have to use all name spaces for this variable. For example, if you have a variable "x1" in your task called "Prog", then you have to ask for the variable "Application.Prog.x1" It is not possible to write a floating point value into an integer variable and vice-versa. You can also only write smaller data types into data types of the same size or greater. Writing a USHORT(2 Byte) into a WORD (2 Byte) or a DWORD (4 Byte) is okay. Trying to write a USHORT into a BYTE will fail and produce an error code.

As has been said already, this method returns the variable as a typed return value. This means that a DINT variable will be returned as a Integer variant, a REAL variable as a FLOAT variant and so on. If you don't need or care about a typed object, then you may also want to try the method ReadVariableBySymbolAsString which attempts to return a string representation of the variable. This might come in handy if you only want to read the variable for display reasons.

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[out]dataThe value to which the IO is to be read.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// get interface to first application
IApplication app = connection.Logic.Applications[connection.Logic.GetNameOfApplication(0)];
// read a variable from the PLC. This variable has to exist on the control and has to be part of the symbol table.
string variableName = "Application.UserVarGlobal.varReal";
object variableValue = connection.Logic.ReadVariableBySymbol(variableName);
// print value of variable to console
Console.WriteLine("Value of PLC variable '" + variableName + "': " + variableValue.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicReadVariableBySymbol, where you can find further documentation.
HRESULT ILogic::GetInformationOfSymbol ( [in] BSTR  symbol,
[out, retval] struct LogicSymbolInformation info 
)

This function reads the type, size and access rights to a symbol of application.

Parameters
[in]symbolZero terminating string containing the symbolic name which should be accessed.
[out]infoReturns a struct with information about the size, type and access rights of the symbol.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// get interface to first application
IApplication app = connection.Logic.Applications[connection.Logic.GetNameOfApplication(0)];
// read informations about a variable from the PLC. This variable has to exist on the control and has to be part of the symbol table.
string variableName = "Application.UserVarGlobal.varReal";
LogicSymbolInformation variableInfo = connection.Logic.GetInformationOfSymbol(variableName);
// print info of variable to console
Console.WriteLine("Type: " + variableInfo.type.ToString());
Console.WriteLine("SubType: " + variableInfo.subType.ToString());
Console.WriteLine("AccessRights: " + variableInfo.accessRights.ToString());
Console.WriteLine("DataSize: " + variableInfo.dataSize.ToString());
Console.WriteLine("Dimension: " + variableInfo.dimension.ToString());
Console.WriteLine("NumElements: " + variableInfo.numElements.ToString());
Console.WriteLine("Range[0].minimum: " + variableInfo.range[0].minimum.ToString());
Console.WriteLine("Range[0].maximum: " + variableInfo.range[0].maximum.ToString());
Console.WriteLine("Range[1].minimum: " + variableInfo.range[1].minimum.ToString());
Console.WriteLine("Range[1].maximum: " + variableInfo.range[1].maximum.ToString());
Console.WriteLine("Range[2].minimum: " + variableInfo.range[2].minimum.ToString());
Console.WriteLine("Range[2].maximum: " + variableInfo.range[2].maximum.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicInformationOfSymbol, where you can find further documentation.
HRESULT ILogic::GetInformationOfUserType ( [in] BSTR  symbol,
[out, retval] SAFEARRAY(struct LogicUserTypeInformation)*  logicInfo 
)

This function reads names and information LogicUserTypeInformation of variables of a symbol if type of symbol equal MLPI_LOGIC_TYPE_USERDEF.

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[out]logicInfoReturns a struct array with the names and information about the variables of the symbol.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiLogicGetInformationOfUserType, where you can find further documentation.
HRESULT ILogic::ReadVariableBySymbolAsString ( [in] BSTR  symbol,
[out, retval] BSTR *  data 
)

This method does the same as ReadVariableBySymbol, but ALWAYS returns the data to be read in string representation. You can use this function not only for string variables, but also for other types. In this case, the function returns a string representation of the given value. This can be useful if you only want to display the variable as string and you don't need to know the variable type. If you want to read the variable with its original type, then you can use the method ReadVariableBySymbol.

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[out]dataReturns a string with the data to be read.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiLogicReadVariableBySymbol, where you can find further documentation.
HRESULT ILogic::WriteVariableBySymbolAsString ( [in] BSTR  symbol,
[in] BSTR  data 
)

This method does the same as WriteVariableBySymbol but ALWAYS takes the data to be written in string representation, regardless of the symbol type. The method tries to convert the string to the format of the symbol variable. If you want to write the variable with type checks, then you can use the method WriteVariableBySymbol.

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[in]dataString representation of the data to be written and the symbol variable.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiLogicWriteVariableBySymbol, where you can find further documentation.
HRESULT ILogic::LoadBootApplication ( [in] BSTR  file,
[in] BSTR  path,
[out, retval] BSTR *  applicationName 
)

This function loads an application from the file system of the control. The application files can be created from within IndraWorks by creating a boot project when not logged into the control. This file *.app together with a corresponding *.crc checksum file can be copied to the flash card of the control (i.e. using FTP transfer). Use this function to load it.

Note
This method will not unload a previously loaded application. Subsequently, this method may fail if there are already too many applications loaded on the target and there is no additional application supported. To make room for a new application, you can unload a single application by calling ResetApplication with RESET_ORIGIN of IApplication, or ResetApplication of IApplications to unload all applications.

After loading the application, it is in the state STOP. You have to start the application by using the function StartApplication.

Parameters
[in]fileFilename of the new application file without file extension, i.e. "Application".
[in]pathPath to the file of the new application. The default root paths can be determined by using the function ISystem::GetSpecialPath in ISystem interface.
[out]applicationNameReturns the name of the new application. The name of the application is stored inside the application project file (.app) and is returned here. Use the application name as a handle for other function calls which require the application name in order to identify which application you want to access on the control.
Returns
Return value indicating success (>=0) or error (<0). Returns 0xF0360011 (E_LIMIT_MAX) if there are already too many applications loaded on the target. Remove an application by calling ResetApplication with RESET_ORIGIN and try again.
Example C#:
// This example deletes all available applications on the target.
// It then tries to load the application 'ApplTestLogicLib' from directory 'projects' on the OEM partition.
// For this example to work, you need to transfer an application named ApplTestLogicLib (ApplTestLogicLib.app + ApplTestLogicLib.crc)
// to the storage card of the target. E.g. using ftp transfer.
//
// init file path information
//
// name of the application file without file extension
string file = "ApplTestLogicLib";
// name of the subdirectory where the application is stored
string pathSub = "projects";
// retrieve root path of the OEM storage on the device
string pathOEM = connection.System.GetSpecialPath(SpecialPath.PATH_OEM);
// combine root path and subdirectory to get absolute path to application project
string pathAbsolute = System.IO.Path.Combine(pathOEM, pathSub);
//
// unloading existing applications
//
int numApplications = connection.Logic.GetNumberOfApplications();
Console.WriteLine("Found " + numApplications + " existing application(s).");
if (numApplications > 0)
{
Console.WriteLine("Do you want to delete the existing applications? ('y' / 'n')");
if (Console.ReadKey(true).KeyChar == 'y')
{
try
{
// delete all applications and make room for new app
connection.Logic.ResetApplication(ApplicationResetMode.RESET_ORIGIN);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
//
// loading application project
//
Console.WriteLine("Loading " + file + " from " + pathAbsolute);
string applicationName = "";
try
{
applicationName = connection.Logic.LoadBootApplication(file, pathAbsolute);
Console.WriteLine("Successfully loaded application: " + applicationName);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
//
// starting application
//
connection.Logic.Applications[applicationName].StartApplication();
Note:
This method maps to the mlpiCore function mlpiLogicInformationOfSymbol, where you can find further documentation.
HRESULT ILogic::GetNumberOfApplications ( [out, retval] LONG *  number)

This function returns the number of loaded applications on the device. This also includes stopped applications.

Parameters
[out]numberReturns the number of loaded applications.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
// get the number of loaded applications
int numApplications = connection.Logic.GetNumberOfApplications();
Console.WriteLine("Found " + numApplications + " application(s).");
Note:
This method maps to the mlpiCore function mlpiLogicGetNumberOfApplications, where you can find further documentation.
HRESULT ILogic::GetNameOfApplication ( [in] LONG  index,
[out, retval] BSTR *  application 
)

This function returns the name of an application selected by index 0 until (number-1).

Parameters
[in]indexIndex of application.
[out]applicationReturns the name of the application with the given index.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
// get the number of loaded applications
int numApplications = connection.Logic.GetNumberOfApplications();
Console.WriteLine("Found " + numApplications + " application(s).");
// list names of all found applications
for (int i = 0; i < numApplications; i++)
{
string appName = connection.Logic.GetNameOfApplication(i);
Console.WriteLine(i.ToString() + " - " + appName);
}
Note:
This method maps to the mlpiCore function mlpiLogicGetNameOfApplication, where you can find further documentation.
HRESULT ILogic::StartApplication ( void  )

This function starts all applications on the target.

Note
You can only start a single application using the method StartApplication in the interface IApplication.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// try starting application.
// Note: An already loaded application has to be present!
connection.Logic.StartApplication();
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicStartApplication, where you can find further documentation.
HRESULT ILogic::StopApplication ( void  )

This function stops all applications on the target.

Note
You can only stop a single application using the method StartApplication in the interface IApplication.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// try stopping application.
// Note: An already running application has to be present!
connection.Logic.StopApplication();
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicStopApplication, where you can find further documentation.
HRESULT ILogic::ResetApplication ( [in] ApplicationResetMode  mode)

This function resets all applications on the target.

Note
You can only reset a single application using the method StartApplication in the interface IApplication.
Parameters
[in]modeReset mode (0==RESET_WARM, 1==RESET_COLD, 2==RESET_ORIGIN)
Returns
Return value indicating success (>=0) or error (<0).
Note
RESET_WARM: All global data except retain data are reset to their default values.
RESET_COLD: All global data and (!) retain data are reset to their default values.
RESET_ORIGIN: Delete the application, delete all application files (boot project, etc.), reset all global and retain data.
Example C#:
try
{
// try reset warm of application.
// Note: An application has to be present!
connection.Logic.ResetApplication(ApplicationResetMode.RESET_WARM);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiLogicResetApplication, where you can find further documentation.
HRESULT ILogic::SetCapabilityOfOperation ( [in] LogicCapabilityOperation  operation,
[in] LogicCapabilityOperationValue  value 
)

This function enables or disables the capability of execution of operations LogicCapabilityOperation . The capability will set global for all applications. After reboot, the capability will set to default.

Parameters
[in]operationOperation which can be enabled or disabled.
[in]valueTarget capability of execution of operation.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
// Disable capability to execute online changes.
connection.Logic.SetCapabilityOfOperation(LogicCapabilityOperation.LOGIC_CAP_OPERATION_ONLINE_CHANGE, LogicCapabilityOperationValue.LOGIC_CAP_OPERATION_DISABLE);
Note:
This method maps to the mlpiCore function mlpiLogicSetCapabilityOfOperation, where you can find further documentation.
HRESULT ILogic::GetCapabilityOfOperation ( [in] LogicCapabilityOperation  operation,
[out, retval] LogicCapabilityOperationValue value 
)

This function reads the current capability of execution of operations LogicCapabilityOperation.

Parameters
[in]operationOperation which can be enabled or disabled.
[out]valuePointer to variable which the current capability of execution of operation should be read to.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
// Read the current capability to execute online changes.
LogicCapabilityOperationValue isOnlineChangeAllowed = connection.Logic.GetCapabilityOfOperation(LogicCapabilityOperation.LOGIC_CAP_OPERATION_ONLINE_CHANGE);
if (isOnlineChangeAllowed==LogicCapabilityOperationValue.LOGIC_CAP_OPERATION_ENABLE)
Console.WriteLine("Online change currently allowed");
else
Console.WriteLine("Online change currently NOT allowed");
Note:
This method maps to the mlpiCore function mlpiLogicGetCapabilityOfOperation, where you can find further documentation.

Member Data Documentation

const LONG ILogic::LOGIC_MAX_DIMENSION_OF_ARRAY = 3

Maximum dimension of an array.

Definition at line 75 of file ILogic.idl.

Property Documentation

IApplications ILogic::Applications
get

This property returns a IApplications object which allows access to different IApplication objects, as well as access to methods controlling all PLC applications on the device. The IApplications interface is a collection interface.

Parameters
[out]applicationsReturns an object of the type IApplications.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// check if an application is loaded
if (connection.Logic.GetNumberOfApplications() < 1)
{
Console.WriteLine("No application loaded in device");
return;
}
// get the name of the first application in the device
string appName = connection.Logic.GetNameOfApplication(0);
Console.WriteLine("Name of first application: " + appName);
// get interface to first application
IApplication app = connection.Logic.Applications[appName];
// print state of application to console
Console.WriteLine("State of first application: " + app.GetStateOfApplication().ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}

The documentation for this interface was generated from the following file: