winnc c script help

clarke24

Member
Join Date
Nov 2004
Location
uk liverpool
Posts
14
I have a two title screens within my project and i swop between these title screens depending on which plant i want to control. There are some motors that are common to both plants so i want to control them with the same faceplate. the problem i am having is the script is written for one of the plants and i need to write it in a similar way for the new title page. here is the original script:
Code:
#include "apdefap.h"
int gscAction( void )
{
char * scrn = NULL;
char TagName[100];
char InterlocksText[255];
DWORD Interlocks;
 

if (strcmp(GetPictureName("",""),"DEGERMTITLE") == 0)
 {
 //Determine if pop up visible
 if (GetVisible("DegermTitle.pdl","ObjectControl"))
 {
  if  ((strcmp(GetPictureName("DegermTitle.pdl","ObjectControl"),"DEGERMMOTORCONTROL.PDL") == 0)
  ||  (strcmp(GetPictureName("DegermTitle.pdl","ObjectControl"),"DEGERMD132CONTROL.PDL") == 0))
  {
//printf ("%s\n",TagName);   
  //MOTORS
   strcpy(TagName,GetTagChar("DegermMotor_Name"));
   if (strlen(TagName) > 0)   
   {
    //Refresh the status
    strcat(TagName,".Status");
    SetTagWord("DegermMotor_Status",GetTagWord(TagName));
    
    //Refresh the description 
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    strcat(TagName,".Description");
    SetTagChar("DegermMotor_Description",GetTagChar(TagName));
    //Refresh the interlock texts
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    SetInterlocksText(TagName, InterlocksText);
    SetTagChar("DegermMotor_Interlock",InterlocksText);
    //Refresh the Manual speed ref
    //strcpy(TagName,GetTagChar("DegermMotor_Name"));
    //strcat(TagName,".Real6");
    //SetTagFloat("DegermMotor_ManSpeed",GetTagFloat(TagName));
    //Refresh the actual speed ref
    //strcpy(TagName,GetTagChar("Motor_Name"));
    //strcat(TagName,".Real1");
    //SetTagFloat("Motor_ActSpeed",GetTagFloat(TagName));
    //Refresh the OutputCurrent ref
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    strcat(TagName,".Current");
    SetTagFloat("DegermMotor_OutputCurrent",GetTagFloat(TagName));
   }
  }
 }
}
return 0; 
}

This works well but when i created the new title page and swapped all the relevant info the faceplate pops up but the description and interlock sections do not update.

Code:
#include "apdefap.h"
int gscAction( void )
{
char * scrn = NULL;
char TagName[100];
char InterlocksText[255];
DWORD Interlocks;
 
if (strcmp(GetPictureName("",""),"SPLITMILLTITLE") == 0)
 {
 //Determine if pop up visible
 if (GetVisible("SplitMillTitle.pdl","ObjectControl"))
 {
  if  (strcmp(GetPictureName("SplitMillTitle.pdl","ObjectControl"),"SplitMillMotorControl.pdl") == 0)
  
  {
//printf ("%s\n",TagName);   
  //MOTORS
   strcpy(TagName,GetTagChar("DegermMotor_Name"));
   if (strlen(TagName) > 0)   
   {
    //Refresh the status
    strcat(TagName,".Status");
    SetTagWord("DegermMotor_Status",GetTagWord(TagName));
    
    //Refresh the description 
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    strcat(TagName,".Description");
    SetTagChar("DegermMotor_Description",GetTagChar(TagName));
    //Refresh the interlock texts
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    SetInterlocksText(TagName, InterlocksText);
    SetTagChar("DegermMotor_Interlock",InterlocksText);
    //Refresh the Manual speed ref
    //strcpy(TagName,GetTagChar("DegermMotor_Name"));
    //strcat(TagName,".Real6");
    //SetTagFloat("DegermMotor_ManSpeed",GetTagFloat(TagName));
    //Refresh the actual speed ref
    //strcpy(TagName,GetTagChar("Motor_Name"));
    //strcat(TagName,".Real1");
    //SetTagFloat("Motor_ActSpeed",GetTagFloat(TagName));
    //Refresh the OutputCurrent ref
    strcpy(TagName,GetTagChar("DegermMotor_Name"));
    strcat(TagName,".Current");
    SetTagFloat("DegermMotor_OutputCurrent",GetTagFloat(TagName));
   }
  }
 }
}
return 0;
}

Can anyone explain the problem?
 

Similar Topics

I'm designing a MP270B in WinCC Flexible 2005 SP1 HF7. When I place items (buttons, etc.) on the template they always apear behind items on normal...
Replies
3
Views
2,714
Hello, I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I...
Replies
0
Views
104
Hello, I have a quick question. I have been using scripts to change the color of buttons. The reason, I am usually using multiple hmiruntime.tags...
Replies
1
Views
100
Hi All, I'm keep getting double quotes in between selections rather than the beginning and the end. Here's the script and please help to find...
Replies
7
Views
800
Dear guys, I am not a programmer but I can do simple things myself. I'm stuck with the following. if I want to extract a value from my rx3i...
Replies
46
Views
4,763
Back
Top Bottom