I've encountered a peculiar issue which I don't understand, and am hoping somebody might be able to help me with.
The system I'm developing has a requirement that certain log files be viewable from within our WinCC OA application.
To achieve this, each host places a copy of the relevant log files in PROJECT_DIR/log/shared/<HOSTNAME>/ (where <HOSTNAME> is the hostname of the device on the network) so that the files can be transfered using WinCC OA.
My problem is this: the function I want to use to transfer the files, requestFileTransfer(), only seems works within a Ctrl Script.
I've written the following example code which I've placed:
- In the "Initialise" event of a blank panel: requestFileTransfer_Example.xml
- In a *.ctl script executed by a Ctrl manager in pmon: requestFileTransfer_Example.ctl
Code: Select all
main()
{
int manId = convManIdToInt(EVENT_MAN, 0);
anytype requestResult = requestFileTransfer(manId, makeDynString("log/shared/loggy.txt"));
DebugTN("request", requestResult);
int pending = 1;
while(pending > 0)
{
pending = getPendingFileTransferCount();
DebugTN("getPendingFileTransferCount", pending);
delay(1);
}
}
However when starting the requestFileTransfer_Example.xml panel within gedi, the following error is raised:
Code: Select all
WCCOAui (3), 2020.12.16 10:14:16.654, CTRL, SEVERE, 176, Uncaught exception in thread started at main:
WCCOAui (3), 2020.12.16 10:14:16.654, CTRL, SEVERE, 72, Function not defined,
Module: _QuickTest_
Panel: C:\WinCC_OA_Proj\HCI_Client\panels\requestFileTransfer_Example.xml [requestFileTransfer_Example.xml]
Script: Initialize
Line: 5, requestFileTransfer
Stacktrace:
1: main() at [Module: _QuickTest_ Panel: requestFileTransfer_Example.xml Script: Initialize]:5
I note additionally, that the documentation states that the return type of function requestFileTransfer() is dyn_mapping but it actually returns an int. I guess this is an oversight on the part of whoever wrote the docs?
Note, I've attampted to attach the files to this post but the forum page isn't having any of it—sorry about that.
Running WinCC OA 3.17 P006 on Windows 10 20H2
With thanks,
Graham R. Armstrong
Software Engineer
Applied Integration UK Ltd