pmon.ctl Gives variable not defined errors

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
10 posts • Page 1 of 1
mikek10
Posts:20
Joined: Wed Jun 26, 2019 4:05 pm

pmon.ctl Gives variable not defined errors

Post by mikek10 »

Hi,

I am trying to use some of the pmon.ctl functions, e.g. pmonStartManager, pmon_command

However I always seem to be getting variable not defined errors, e.g:

WCCOAui (1), 2021.03.25 14:56:42.729, CTRL, SEVERE, 73, Variable not defined,
Module: _QuickTest_
Panel: D:\WinCCOA\NewScheduler\panels\StartNew.pnl [MainScreen]
Script: Initialize
Library: C:\Siemens\Automation\WinCC_OA\3.15\scripts\libs\pmon.ctl
Line: 370, gTcpFileDescriptor2

Module: _QuickTest_
Panel: D:\WinCCOA\NewScheduler\panels\StartNew.pnl [MainScreen]
Script: Initialize
Library: C:\Siemens\Automation\WinCC_OA\3.15\scripts\libs\pmon.ctl
Line: 1426, gParams

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: pmon.ctl Gives variable not defined errors

Post by leoknipp »

Most of the functions defined in the CTRL library pmon.ctl are not designed for public use.
If you want to use them you have to ensure on your own that all prerequisites are fulfilled, e.g. all variables are defined.

Why is there a need to use the pmon functions?

Best Regards
Leopold Knipp
Senior Support Specialist

mikek10
Posts:20
Joined: Wed Jun 26, 2019 4:05 pm

Re: pmon.ctl Gives variable not defined errors

Post by mikek10 »

Hi,

I want to start and stop a manager from within WinCC OA front end. This is a C# API manager that I have written.

The variables that don't seem to be defined are within the pmon.ctl file that is provided with WinCC OA ?

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: pmon.ctl Gives variable not defined errors

Post by kilianvp »

You can use _Managers.Exit. First you have to get the right number with convManIdToInt() and then you can set the number with dpset and the manager exits.

mikek10
Posts:20
Joined: Wed Jun 26, 2019 4:05 pm

Re: pmon.ctl Gives variable not defined errors

Post by mikek10 »

Thanks, doesn't help with starting though?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: pmon.ctl Gives variable not defined errors

Post by leoknipp »

Normally the managers are set to start "Always".
Then you do not have to restart them manually.

Best Regards
Leopold Knipp
Senior Support Specialist

mikek10
Posts:20
Joined: Wed Jun 26, 2019 4:05 pm

Re: pmon.ctl Gives variable not defined errors

Post by mikek10 »

I was hoping for a finer level of control, pmon.ctl looked like it should provide it, the functions within pmon.ctl would certainly do the job if they worked as expected but every function I have tried results in errors due to missing variable definitions within the file itself. I could go through and try and fix the file myself but I don't particularly want to do this with a file that is packaged with WinCC OA!

I probably have enough to do the bare minimum of what I need but surely this should be fixed at some point?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: pmon.ctl Gives variable not defined errors

Post by leoknipp »

There is no need to fix it as the functions in pmon.ctl are not designed for common use.
The functions in this library are made to work with the Console / Project Administration.

You do not have to modify the pmon.ctl if you want to use the functions.
If the functions must be used, even if they are not for common use, you have to define the variables on your own in the script where you have loaded the pmon.ctl library and where you are calling functions defined in pmon.ctl.

Best Regards
Leopold Knipp
Senior Support Specialist

mikek10
Posts:20
Joined: Wed Jun 26, 2019 4:05 pm

Re: pmon.ctl Gives variable not defined errors

Post by mikek10 »

Its not a question of defining variables within calling functions. The problem is declarations missing from within the file, this can't be fixed externally and the file needs correcting so it does not throw errors. The missing declarations are not parameters so nothing in a calling function would have the correct scope.

e.g. in various functions within pmon.ctl there are assignments to and checks upon gTcpFileDescriptor2 which is not a parameter to any functions nor is it declared anywhere within pmon.ctl. so whenever this is encountered an error occurs such as that in the first post.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: pmon.ctl Gives variable not defined errors

Post by leoknipp »

If you define the global variables needed by the pmon.ctl functions on your own in the script where you are calling the pmon.ctl functions the functions will work.
I have done this several times and it works.

Best Regards
Leopold Knipp
Senior Support Specialist

10 posts • Page 1 of 1