[?]: pause in winCC before the next change of operator

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
Post Reply
Arthur9186
Posts: 8
Joined: Wed Aug 10, 2011 8:15 am

[?]: pause in winCC before the next change of operator

Post by Arthur9186 » Fri Aug 19, 2011 5:29 am

Members, submit an idea on how to solve the problem.

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);
}
} 
and I want to insert a sleep (3000), that would have happened, something on the similarity:

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]http://plcforum.uz.ua/viewtopic.php?f=9&t=16253[/url]

Post Reply