have a project on winCC.
It is necessary to perform an operation to put a pause that would be the chosen solution has had time to join before the next change of operator.
I think:
There is an icon entry with this code:
Code: Select all
# include "apdefap.h"
void OnKeyDown (char * lpszPictureName, char * lpszObjectName, char * lpszPropertyName, UINT nChar, UINT nRepCnt, UINT nFlags)
{
/ / WINCC: TAGNAME_SECTION_START
/ / Syntax: # define TagNameInAction "DMTagName"
/ / Next TagID: 1
/ / WINCC: TAGNAME_SECTION_END
/ / WINCC: PICNAME_SECTION_START
/ / Syntax: # define PicNameInAction "PictureName"
/ / Next PicID: 1
/ / WINCC: PICNAME_SECTION_END
char lpszTagName [128];
double dOldValue;
double dNewValue;
if (nChar == 13)
{
dOldValue = GetPropDouble (lpszPictureName, "FieldOldValue", "OutputValue");
dNewValue = GetPropDouble (lpszPictureName, lpszObjectName, "InputValue");
LogValue (lpszTagName, GetText (lpszPictureName, "EUName"), dOldValue, dNewValue);
/ / SubstituteValue (GetText (lpszPictureName, "ODBCName"), lpszTagName, dNewValue);
SetPropDouble (lpszPictureName, "FieldOldValue", "OutputValue", dNewValue);
}
}
Code: Select all
# include "apdefap.h"
void OnKeyDown (char * lpszPictureName, char * lpszObjectName, char * lpszPropertyName, UINT nChar, UINT nRepCnt, UINT nFlags)
{
/ / WINCC: TAGNAME_SECTION_START
/ / Syntax: # define TagNameInAction "DMTagName"
/ / Next TagID: 1
/ / WINCC: TAGNAME_SECTION_END
/ / WINCC: PICNAME_SECTION_START
/ / Syntax: # define PicNameInAction "PictureName"
/ / Next PicID: 1
/ / WINCC: PICNAME_SECTION_END
char lpszTagName [128];
double dOldValue;
double dNewValue;
if (nChar == 13)
{
dOldValue = GetPropDouble (lpszPictureName, "FieldOldValue", "OutputValue");
dNewValue = GetPropDouble (lpszPictureName, lpszObjectName, "InputValue");
LogValue (lpszTagName, GetText (lpszPictureName, "EUName"), dOldValue, dNewValue);
/ / SubstituteValue (GetText (lpszPictureName, "ODBCName"), lpszTagName, dNewValue);
SetPropDouble (lpszPictureName, "FieldOldValue", "OutputValue", dNewValue);
}
sleep (3000);
}
But there are a couple of problems:
1) how to connect the library to sleep ()
2) and for some reason the compiler winCC any changes in the swearing in
Code: Select all
LogValue (lpszTagName, GetText (lpszPictureName, "EUName"), dOldValue, dNewValue); [/ code]
wrote [quote] error (0069): type mismatch in argument 3
error (006a): not enough arguments for function 'LogValue' [/quote]
although the program for several years in working order.
Thanks in advance
russian version [url]https://plcforum.uz.ua/viewtopic.php?f=9&t=16253[/url]