clarke24
Member
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:
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.
Can anyone explain the problem?
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?