WinCC Scripting

Rheinhardt

Member
Join Date
Oct 2003
Location
Pretoria
Posts
39
Hi Gents ,

Is it possible to manipulate a bit in a word tag in WinCC,using either direct connection/C Script or VB script?

The links are dynamic and form bits of a Word '.C_Word' extension.

I want to manipulate word Tag_0.C_Word bit 2 for example.

I want to save on tags and use a control word that i can "bit-strip" in the sense of the word. If i create my tags as bits it would make a tag difference of 7 vs 1 for each type of device on our plant?

I have played around with using the settagbit but cannot afford to create this many tags?

Any help will be apreciated.
 
I am not familiar with WinCC, but I have done some work with WinCC Flex. I would think they would have some of the same functions.

Anyways, look for the (SetBitInTag) function. This will allow you to set a specific bit of a word.
 
Thank you Leibold i came right with following code....


#include "apdefap.h"

void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)

{

#define TAG_1 "toggle_integer"

DWORD dwHelp1,dwHelp2;

dwHelp1=GetTagWordWait(TAG_1);



if ((GetTagDWord (TAG_1)) & 0x100)

{

dwHelp2=dwHelp1&(0xFFFFFFFF^256);

SetTagWordWait(TAG_1,(WORD)dwHelp2);

}

else

{

dwHelp2=dwHelp1|256;

SetTagWordWait(TAG_1,(WORD)dwHelp2);

}



}
 

Similar Topics

Hello everyone. I'm trying to export data to excel from Wincc. My code is global action that executed every second that create excel filer per...
Replies
1
Views
5,732
I have 5 temperatures that i want to record during 4 modes which i'll label A,B,C,D. The temperature sensors are the same across all modes. I...
Replies
0
Views
1,175
Hello, I would like to make a script in WinCC 7.2 to read and write data from internal binary tags to specified bit in external(TCP,MPI etc.)...
Replies
0
Views
1,547
Hi Guys I have attached a screen shot hoping someone can help me i dont do VB very well and i get an error saying the script does not return a...
Replies
5
Views
2,616
Hi! I'm having a problem. I draw a valve in my Graphic Designer and also a Rectangle. I'm trying to do the following: When the user click on...
Replies
0
Views
1,550
Back
Top Bottom