#2 Find or create a Codesys solution for: PlcAppSystemInfo

v1.0
closed
aliazzz
None
2020-05-01
2019-05-04
aliazzz
No

Find a low weight solution in CODESYS to exchange the following struct with something more "vanilla";

Each Beckhoff PLC contains an instance of type 'PlcAppSystemInfo' with the name '_AppInfo'.

The corresponding namespace is 'TwinCAT_SystemInfoVarList'. This must be specified for use in a library, for example.

TYPE PlcAppSystemInfo
STRUCT
     ObjId              : OTCID;
     TaskCnt            : UDINT;
     OnlineChangeCnt    : UDINT;
     Flags              : DWORD;
     AdsPort            : UINT;
     BootDataLoaded     : BOOL;
     OldBootData        : BOOL;
     AppTimestamp       : DT;
     KeepOutputsOnBP    : BOOL;
     ShutdownInProgress : BOOL;
     LicensesPending    : BOOL;
     BSODOccured        : BOOL;
     TComSrvPtr         : ITComObjectServer;
     AppName            : STRING(63);
     ProjectName        : STRING(63);
END_STRUCT
END_TYPE 

ObjId = Object ID of the PLC project instance
TaskCnt = Number of tasks in the runtime system
OnlineChangeCnt = Number of online changes since the last complete download
Flags = Reserved
AdsPort = ADS port of the PLC application
BootDataLoaded = PERSISTENT variables: LOADED (without error)
OldBootData = PERSISTENT variables: INVALID (the back-up copy was loaded, since no valid file was present)
AppTimestamp = Time at which the PLC application was compiled
KeepOutputsOnBP = The flag can be set and prevents that the outputs are zeroed when a breakpoint is reached. In this case the task continues to run. Only the execution of the PLC code is interrupted.
ShutdownInProgress = This variable has the value TRUE if a shutdown of the TwinCAT system is in progress. Some parts of the TwinCAT system may already have been shut down.
LicensesPending = This variable has the value TRUE if not all licenses that are provided by license dongles have been validated yet.
BSODOccured = This variable has the value TRUE if Windows is in a BSOD.
TComSrvPtr = Pointer to the TcCOM object server
AppName = Name generated by TwinCAT, which contains the port.
ProjectName = Name of the project

Discussion

  • aliazzz

    aliazzz - 2019-05-04
    • summary: Find a Codesys solution for: PlcAppSystemInfo --> Find or create a Codesys solution for: PlcAppSystemInfo
     
  • aliazzz

    aliazzz - 2019-05-09

    Application Manager

    Maybe the “CmpApp” library can be used to retrieve information about projects and applications as well as area addresses and sizes of data types in order to phase this datastructure out?

    Task Manager
    Or maybe with "CmpIecTask", task information can be retrieved within a POU.

     
  • aliazzz

    aliazzz - 2019-05-13
    • assigned_to: aliazzz
     
  • aliazzz

    aliazzz - 2019-05-13

    implementing functionblock GetCurProjInfo

     
  • aliazzz

    aliazzz - 2019-05-13
    • status: pending --> closed
     

Log in to post a comment.