发布于 2005-04-08 10:39:35
0楼
Wincc中有两个内部函数可用来处理原始数据变量:GetTagRaw和SetTagRaw
BOOL GetTagRaw(Tag Tag_Name, BYTE* pValue, DWORD size);
Function:Determines the value of a tag of data type "Raw Data Type".
Parameter:
Tag_Name :Name of the tag
pValue:The pointer to a byte field which contains the value of the raw data tag.
size:Size of the byte field in bytes.
Return value:
TRUE:The function has been completed without any errors.
FALSE:An error occurred.
Example of reading out a raw data type tag
{
#define DATA_SIZE 3
BYTE byData[DATA_SIZE];
//Get the current values of the tag
GetTagRaw("gs_tag_raw",byData,DATA_SIZE);
//Use the values received in the array byData
...
}
GetTagRaw function parameters:
"gs_tag_raw" is the name of the tag.
"byData" is the byte array in which the values in the raw data tag are stored.
"DATA_SIZE" is the number of values read.
1. Read out the tag values and buffer in byData.
2. Execution of user-defined codes for processing the return values.