www.pudn.com > crestroncontrol.rar > B8Analyse.usp, change:2006-10-22,size:16497b


/******************************************************************************************* 
  SIMPL+ Module Information 
  (Fill in comments below) 
*******************************************************************************************/ 
/* 
Dealer Name: 
System Name: 
System Number: 
Programmer: 
Comments: 
*/ 
 
/******************************************************************************************* 
  Compiler Directives 
  (Uncomment and declare compiler directives as needed) 
*******************************************************************************************/ 
// #SYMBOL_NAME "" 
// #HINT "" 
// #DEFINE_CONSTANT 
// #CATEGORY ""  
// #DEFAULT_VOLATILE 
#DEFAULT_NONVOLATILE 
#ENABLE_STACK_CHECKING 
/* 
#HELP_BEGIN 
   (add additional lines of help lines) 
#HELP_END 
*/ 
 
/******************************************************************************************* 
  Include Libraries 
  (Uncomment and include additional librarys as needed) 
*******************************************************************************************/ 
// #CRESTRON_LIBRARY "" 
// #USER_LIBRARY "" 
 
/******************************************************************************************* 
  DIGITAL, ANALOG and SERIAL INPUTS and OUTPUTS 
  (Uncomment and declare inputs and outputs as needed) 
*******************************************************************************************/ 
Buffer_input CmdData[50]; 
DIGITAL_INPUT CommanSingle1,CommanSingle2,CommanSingle3,CommanSingle4,CommanSingle5,CommanSingle6, 
	CommanSingle7,CommanSingle8,CommanSingle9,CommanSingle10,CommanSingle11,CommanSingle12, 
	CommanSingle13,CommanSingle14,CommanSingle15,CommanSingle16,CommanSingle17,CommanSingle18, 
	CommanSingle19,CommanSingle20,CommanSingle21; 
DIGITAL_INPUT LocalSingle1,LocalSingle2,LocalSingle3,LocalSingle4,LocalSingle5,LocalSingle6, 
	LocalSingle7,LocalSingle8,LocalSingle9,LocalSingle10,LocalSingle11,LocalSingle12, 
	LocalSingle13,LocalSingle14,LocalSingle15,LocalSingle16,LocalSingle17,LocalSingle18, 
	LocalSingle19,LocalSingle20,LocalSingle21;  
DIGITAL_INPUT SendAllAsk1,SendAllAsk2,SendAllAsk3,SendAllAsk4,SendAllAsk5,SendAllAsk6, 
	SendAllAsk7,SendAllAsk8,SendAllAsk9,SendAllAsk10,SendAllAsk11,SendAllAsk12, 
	SendAllAsk13,SendAllAsk14,SendAllAsk15,SendAllAsk16,SendAllAsk17,SendAllAsk18, 
	SendAllAsk19,SendAllAsk20,SendAllAsk21;   
// ANALOG_INPUT  
// STRING_INPUT  
// BUFFER_INPUT  
 
DIGITAL_OUTPUT LocalSingle1_FB,LocalSingle2_FB,LocalSingle3_FB,LocalSingle4_FB,LocalSingle5_FB,LocalSingle6_FB, 
	LocalSingle7_FB,LocalSingle8_FB,LocalSingle9_FB,LocalSingle10_FB,LocalSingle11_FB,LocalSingle12_FB, 
	LocalSingle13_FB,LocalSingle14_FB,LocalSingle15_FB,LocalSingle16_FB,LocalSingle17_FB,LocalSingle18_FB, 
	LocalSingle19_FB,LocalSingle20_FB,LocalSingle21_FB; 
DIGITAL_OUTPUT CommanSingle1_FB,CommanSingle2_FB,CommanSingle3_FB,CommanSingle4_FB,CommanSingle5_FB,CommanSingle6_FB, 
	CommanSingle7_FB,CommanSingle8_FB,CommanSingle9_FB,CommanSingle10_FB,CommanSingle11_FB,CommanSingle12_FB, 
	CommanSingle13_FB,CommanSingle14_FB,CommanSingle15_FB,CommanSingle16_FB,CommanSingle17_FB,CommanSingle18_FB, 
	CommanSingle19_FB,CommanSingle20_FB,CommanSingle21_FB;   
DIGITAL_OUTPUT SendAllAsk1_FB, SendAllAsk2_FB,SendAllAsk3_FB,SendAllAsk4_FB,SendAllAsk5_FB,SendAllAsk6_FB, 
	SendAllAsk7_FB,SendAllAsk8_FB,SendAllAsk9_FB,SendAllAsk10_FB,SendAllAsk11_FB,SendAllAsk12_FB,SendAllAsk13_FB, 
	SendAllAsk14_FB,SendAllAsk15_FB,SendAllAsk16_FB,SendAllAsk17_FB,SendAllAsk18_FB,SendAllAsk19_FB,SendAllAsk20_FB,SendAllAsk21_FB; 
DIGITAL_OUTPUT AsxStatus1_FB,AsxStatus2_FB,AsxStatus3_FB,AsxStatus4_FB,AsxStatus5_FB,AsxStatus6_FB,AsxStatus7_FB, 
	AsxStatus8_FB,AsxStatus9_FB,AsxStatus10_FB,AsxStatus11_FB,AsxStatus12_FB,AsxStatus13_FB,AsxStatus14_FB,AsxStatus15_FB, 
	AsxStatus16_FB,AsxStatus17_FB,AsxStatus18_FB,AsxStatus19_FB,AsxStatus20_FB,AsxStatus21_FB; 
// ANALOG_OUTPUT  
STRING_OUTPUT send;  
string_output CmdB,CmdC; 
 
/******************************************************************************************* 
  Structure Definitions 
  (Uncomment and define structure definitions as needed) 
  Note:  Be sure to initialize all declared STRING variables as needed 
         For example, in Function Main: struct.myString = ""; 
*******************************************************************************************/ 
// STRUCTURE MyStruct1 
// { 
// }; 
 
// MyStruct1 struct; 
 
/******************************************************************************************* 
  Global Variables 
  (Uncomment and declare global variables as needed) 
  Note:  Be sure to initialize all declared STRING variables as needed 
         For example, in Function Main: myString = ""; 
*******************************************************************************************/ 
// INTEGER 
// STRING 
 
/******************************************************************************************* 
  Functions 
  (Add any additional functions here) 
  Note:  Functions must be physically placed before the location in 
         the code that calls them. 
*******************************************************************************************/ 
/* 
Function MyFunction1() 
{ 
    // TODO:  Add local variable declarations here 
 
    // TODO:  Add code here 
} 
*/ 
 
/* 
Integer_Function MyIntFunction1() 
{ 
    // TODO:  Add local variable declarations here 
 
    // TODO:  Add code here 
 
    Return (0); 
} 
*/ 
 
/* 
String_Function MyStrFunction1() 
{ 
    // TODO:  Add local variable declarations here 
 
    // TODO:  Add code here 
 
    Return (""); 
} 
*/ 
 
/******************************************************************************************* 
  Event Handlers 
  (Uncomment and declare additional event handlers as needed) 
*******************************************************************************************/ 
/* 
PUSH input 
{ 
    // TODO:  Add code here 
} 
*/ 
 
/* 
RELEASE input 
{ 
    // TODO:  Add code here 
} 
*/ 
 
 
CHANGE CommanSingle1  
{ 
	send = "<C01>"; 
	CommanSingle1_FB = 1; 
	LocalSingle1_FB = 0; 
}  
CHANGE CommanSingle2  
{  
	send = "<C02>";  
	CommanSingle2_FB = 1; 
	LocalSingle2_FB = 0; 
} 
CHANGE CommanSingle3  
{ 
	send = "<C03>";  
	CommanSingle3_FB = 1;  
	LocalSingle3_FB = 0; 
} 
CHANGE CommanSingle4  
{ 
	send = "<C04>"; 
	CommanSingle4_FB = 1; 
	LocalSingle4_FB = 0; 
} 
CHANGE CommanSingle5  
{  
	send = "<C05>";  
	CommanSingle5_FB = 1; 
	LocalSingle5_FB = 0; 
} 
CHANGE CommanSingle6  
{ 
	send = "<C06>";  
	CommanSingle6_FB = 1;  
	LocalSingle6_FB = 0; 
} 
CHANGE CommanSingle7  
{ 
	send = "<C07>";  
	CommanSingle7_FB = 1; 
	LocalSingle7_FB = 0; 
} 
CHANGE CommanSingle8  
{  
	send = "<C08>";   
	CommanSingle8_FB = 1; 
	LocalSingle8_FB = 0; 
} 
CHANGE CommanSingle9  
{  
	send = "<C09>";  
	CommanSingle9_FB = 1;  
	LocalSingle9_FB = 0; 
} 
CHANGE CommanSingle10  
{ 
	send = "<C10>";  
	CommanSingle10_FB = 1; 
	LocalSingle10_FB = 0; 
} 
CHANGE CommanSingle11  
{  
	send = "<C11>";  
	CommanSingle11_FB = 1;  
	LocalSingle11_FB = 0; 
} 
CHANGE CommanSingle12  
{  
	send = "<C12>";  
	CommanSingle12_FB = 1;  
	LocalSingle12_FB = 0; 
} 
CHANGE CommanSingle13  
{ 
	send = "<C13>"; 
	CommanSingle13_FB = 1;  
	LocalSingle13_FB = 0; 
} 
CHANGE CommanSingle14  
{  
	send = "<C14>";  
	CommanSingle14_FB = 1;  
	LocalSingle14_FB = 0; 
} 
CHANGE CommanSingle15  
{ 
	send = "<C15>";  
	CommanSingle15_FB = 1;  
	LocalSingle15_FB = 0; 
} 
CHANGE CommanSingle16  
{  
	send = "<C16>";  
	CommanSingle16_FB = 1;  
	LocalSingle16_FB = 0; 
} 
CHANGE CommanSingle17  
{ 
	send = "<C17>";  
	CommanSingle17_FB = 1; 
	LocalSingle17_FB = 0; 
} 
CHANGE CommanSingle18  
{  
	send = "<C18>";  
	CommanSingle18_FB = 1; 
	LocalSingle18_FB = 0; 
} 
CHANGE CommanSingle19  
{  
	send = "<C19>"; 
	CommanSingle19_FB = 1;  
	LocalSingle19_FB = 0; 
} 
CHANGE CommanSingle20  
{  
	send = "<C20>";  
	CommanSingle20_FB = 1;  
	LocalSingle20_FB = 0; 
} 
CHANGE CommanSingle21  
{ 
	send = "<C21>";  
	CommanSingle21_FB = 1;  
	LocalSingle21_FB = 0; 
} 
CHANGE LocalSingle1  
{ 
	send = "<L01>";  
	LocalSingle1_FB = 1; 
	CommanSingle1_FB = 0; 
}  
CHANGE LocalSingle2  
{ 
	send = "<L02>";  
	LocalSingle2_FB = 1; 
	CommanSingle2_FB = 0; 
} 
CHANGE LocalSingle3  
{ 
	send = "<L03>"; 
	LocalSingle3_FB = 1; 
	CommanSingle3_FB = 0; 
} 
CHANGE LocalSingle4  
{ 
	send = "<L04>";  
	LocalSingle4_FB = 1; 
	CommanSingle4_FB = 0; 
} 
CHANGE LocalSingle5  
{ 
	send = "<L05>"; 
	LocalSingle5_FB = 1; 
	CommanSingle5_FB = 0; 
} 
CHANGE LocalSingle6  
{ 
	send = "<L06>";  
	LocalSingle6_FB = 1; 
	CommanSingle6_FB = 0; 
} 
CHANGE LocalSingle7  
{ 
	send = "<L07>";  
	LocalSingle7_FB = 1; 
	CommanSingle7_FB = 0; 
} 
CHANGE LocalSingle8  
{ 
	send = "<L08>"; 
	LocalSingle8_FB = 1; 
	CommanSingle8_FB = 0; 
} 
CHANGE LocalSingle9  
{ 
	send = "<L09>";  
	LocalSingle9_FB = 1; 
	CommanSingle9_FB = 0; 
} 
CHANGE LocalSingle10  
{ 
	send = "<L10>"; 
	LocalSingle10_FB = 1; 
	CommanSingle10_FB = 0; 
} 
CHANGE LocalSingle11  
{ 
	send = "<L11>";  
	LocalSingle11_FB = 1; 
	CommanSingle11_FB = 0; 
} 
CHANGE LocalSingle12  
{ 
	send = "<L12>";  
	LocalSingle12_FB = 1; 
	CommanSingle12_FB = 0; 
} 
CHANGE LocalSingle13  
{ 
	send = "<L13>"; 
	LocalSingle13_FB = 1; 
	CommanSingle13_FB = 0; 
} 
CHANGE LocalSingle14  
{ 
	send = "<L14>"; 
	LocalSingle14_FB = 1; 
	CommanSingle14_FB = 0; 
} 
CHANGE LocalSingle15  
{ 
	send = "<L15>";  
	LocalSingle15_FB = 1; 
	CommanSingle15_FB = 0; 
} 
CHANGE LocalSingle16  
{ 
	send = "<L16>";  
	LocalSingle16_FB = 1; 
	CommanSingle16_FB = 0; 
} 
CHANGE LocalSingle17  
{ 
	send = "<L17>";  
	LocalSingle17_FB = 1; 
	CommanSingle17_FB = 0; 
} 
CHANGE LocalSingle18  
{ 
	send = "<L18>";  
	LocalSingle18_FB = 1; 
	CommanSingle18_FB = 0; 
} 
CHANGE LocalSingle19  
{ 
	send = "<L19>";  
	LocalSingle19_FB = 1; 
	CommanSingle19_FB = 0; 
} 
CHANGE LocalSingle20  
{ 
	send = "<L20>";  
	LocalSingle20_FB = 1; 
	CommanSingle20_FB = 0; 
} 
CHANGE LocalSingle21  
{ 
	send = "<L21>"; 
	LocalSingle21_FB = 1; 
	CommanSingle21_FB = 0; 
}  
CHANGE SendAllAsk1  
{ 
	send = "<A01>"; 
	SendAllAsk1_FB = 1;  
	Delay(200); 
	SendAllAsk1_FB = 0; 
}   
CHANGE SendAllAsk2  
{ 
	send = "<A02>"; 
	SendAllAsk2_FB = 1;  
	Delay(200); 
	SendAllAsk2_FB = 0; 
} 
 
CHANGE SendAllAsk3  
{ 
	send = "<A03>"; 
	SendAllAsk3_FB = 1;  
	Delay(200); 
	SendAllAsk3_FB = 0; 
} 
 
CHANGE SendAllAsk4  
{ 
	send = "<A04>"; 
	SendAllAsk4_FB = 1;  
	Delay(200); 
	SendAllAsk4_FB = 0; 
} 
 
CHANGE SendAllAsk5  
{ 
	send = "<A05>"; 
	SendAllAsk5_FB = 1;  
	Delay(200); 
	SendAllAsk5_FB = 0; 
} 
 
CHANGE SendAllAsk6  
{ 
	send = "<A06>"; 
	SendAllAsk6_FB = 1;  
	Delay(200); 
	SendAllAsk6_FB = 0; 
} 
 
CHANGE SendAllAsk7  
{ 
	send = "<A07>"; 
	SendAllAsk7_FB = 1;  
	Delay(200); 
	SendAllAsk7_FB = 0; 
} 
 
CHANGE SendAllAsk8  
{ 
	send = "<A08>"; 
	SendAllAsk8_FB = 1;  
	Delay(200); 
	SendAllAsk8_FB = 0; 
} 
 
CHANGE SendAllAsk9  
{ 
	send = "<A09>"; 
	SendAllAsk9_FB = 1;  
	Delay(200); 
	SendAllAsk9_FB = 0; 
} 
 
CHANGE SendAllAsk10  
{ 
	send = "<A10>"; 
	SendAllAsk10_FB = 1;  
	Delay(200); 
	SendAllAsk10_FB = 0; 
} 
 
CHANGE SendAllAsk11  
{ 
	send = "<A11>"; 
	SendAllAsk11_FB = 1;  
	Delay(200); 
	SendAllAsk11_FB = 0; 
} 
 
CHANGE SendAllAsk12  
{ 
	send = "<A12>"; 
	SendAllAsk12_FB = 1;  
	Delay(200); 
	SendAllAsk12_FB = 0; 
} 
 
CHANGE SendAllAsk13  
{ 
	send = "<A13>"; 
	SendAllAsk13_FB = 1;  
	Delay(200); 
	SendAllAsk13_FB = 0; 
} 
 
CHANGE SendAllAsk14  
{ 
	send = "<A14>"; 
	SendAllAsk14_FB = 1;  
	Delay(200); 
	SendAllAsk14_FB = 0; 
} 
 
CHANGE SendAllAsk15  
{ 
	send = "<A15>"; 
	SendAllAsk15_FB = 1;  
	Delay(200); 
	SendAllAsk15_FB = 0; 
} 
 
CHANGE SendAllAsk16  
{ 
	send = "<A16>"; 
	SendAllAsk16_FB = 1;  
	Delay(200); 
	SendAllAsk16_FB = 0; 
} 
 
CHANGE SendAllAsk17  
{ 
	send = "<A17>"; 
	SendAllAsk17_FB = 1;  
	Delay(200); 
	SendAllAsk17_FB = 0; 
} 
 
CHANGE SendAllAsk1  
{ 
	send = "<A18>"; 
	SendAllAsk18_FB = 1;  
	Delay(200); 
	SendAllAsk18_FB = 0; 
} 
 
CHANGE SendAllAsk1  
{ 
	send = "<A19>"; 
	SendAllAsk19_FB = 1;  
	Delay(200); 
	SendAllAsk19_FB = 0; 
} 
 
CHANGE SendAllAsk20  
{ 
	send = "<A20>"; 
	SendAllAsk20_FB = 1;  
	Delay(200); 
	SendAllAsk20_FB = 0; 
} 
 
CHANGE SendAllAsk21  
{ 
	send = "<A21>"; 
	SendAllAsk21_FB = 1;  
	Delay(200); 
	SendAllAsk21_FB = 0; 
} 
change CmdData 
{ 
	integer c1,c2,c3,c4,c5,pos,icmd; 
	string CmdTemp1[12],CmdRemove[12],Temp[3]; 
	   
	CmdTemp1 = CmdData;  
	c1 = Find("{",CmdData);  
	c2 = Find("}",CmdData); 
	c3 = Find(";",CmdData); 
//	c4 = Find("/",CmdData);  
	c5 = Find("|",CmdData); 
	if((c1 > 0) && (c2 > 0) && (c1<c2)) 
	{ 
		if(c5 > 0) 
		{ 
			CommanSingle1_FB = 1;CommanSingle2_FB = 1;CommanSingle3_FB = 1;CommanSingle4_FB = 1;CommanSingle5_FB = 1;CommanSingle6_FB = 1; 
			CommanSingle7_FB = 1;CommanSingle8_FB = 1;CommanSingle9_FB = 1;CommanSingle10_FB = 1;CommanSingle11_FB = 1;CommanSingle12_FB = 1; 
			CommanSingle13_FB = 1;CommanSingle14_FB = 1;CommanSingle15_FB = 1;CommanSingle16_FB = 1;CommanSingle17_FB = 1;CommanSingle18_FB = 1; 
			CommanSingle19_FB = 1;CommanSingle20_FB = 1;CommanSingle21_FB = 1;  
			LocalSingle1_FB = 0;LocalSingle2_FB = 0;LocalSingle3_FB = 0;LocalSingle4_FB = 0;LocalSingle5_FB = 0;LocalSingle6_FB = 0; 
			LocalSingle7_FB = 0;LocalSingle8_FB = 0;LocalSingle9_FB = 0;LocalSingle10_FB = 0;LocalSingle11_FB = 0;LocalSingle12_FB = 0; 
			LocalSingle13_FB = 0;LocalSingle14_FB = 0;LocalSingle15_FB = 0;LocalSingle16_FB = 0;LocalSingle17_FB = 0;LocalSingle18_FB = 0; 
			LocalSingle19_FB = 0;LocalSingle20_FB = 0;LocalSingle21_FB = 0; 
			CmdRemove = Remove("|",cmdTemp1); 
			Temp = Left(cmdTemp1,c3-c5-1); 
			pos = atoi(Temp); 
			AsxStatus1_FB = 0;AsxStatus2_FB = 0;AsxStatus3_FB = 0;AsxStatus4_FB = 0;AsxStatus5_FB = 0;AsxStatus6_FB = 0;AsxStatus7_FB = 0; 
			AsxStatus8_FB = 0;AsxStatus9_FB = 0;AsxStatus10_FB = 0;AsxStatus11_FB = 0;AsxStatus12_FB = 0;AsxStatus13_FB = 0;AsxStatus14_FB = 0;AsxStatus15_FB = 0; 
			AsxStatus16_FB = 0;AsxStatus17_FB = 0;AsxStatus18_FB = 0;AsxStatus19_FB = 0;AsxStatus20_FB = 0;AsxStatus21_FB = 0; 
			switch(pos) 
			{ 
				case(1): 
				{ 
					AsxStatus1_FB = 1; 
//					Delay(500); 
//					AsxStatus1_FB = 0;			 
				}  
				case(2): 
				{ 
					AsxStatus2_FB = 1;			 
				} 
				case(3): 
				{ 
					AsxStatus3_FB = 1;			 
				} 
				case(4): 
				{ 
					AsxStatus4_FB = 1;			 
				} 
				case(5): 
				{ 
					AsxStatus5_FB = 1;			 
				} 
				case(6): 
				{ 
					AsxStatus6_FB = 1;			 
				} 
				case(7): 
				{ 
					AsxStatus7_FB = 1;			 
				} 
				case(8): 
				{ 
					AsxStatus8_FB = 1;			 
				} 
				case(9): 
				{ 
					AsxStatus9_FB = 1;			 
				} 
				case(10): 
				{ 
					AsxStatus10_FB = 1;			 
				}case(11): 
				{ 
					AsxStatus11_FB = 1;			 
				}case(12): 
				{ 
					AsxStatus12_FB = 1;			 
				}case(13): 
				{ 
					AsxStatus13_FB = 1;			 
				}case(14): 
				{ 
					AsxStatus14_FB = 1;			 
				} 
				case(15): 
				{ 
					AsxStatus15_FB = 1;			 
				} 
				case(16): 
				{ 
					AsxStatus16_FB = 1;			 
				} 
				case(17): 
				{ 
					AsxStatus17_FB = 1;			 
				} 
				case(18): 
				{ 
					AsxStatus18_FB = 1;			 
				} 
				case(19): 
				{ 
					AsxStatus19_FB = 1;			 
				} 
				case(20): 
				{ 
					AsxStatus20_FB = 1;			 
				} 
				case(21): 
				{ 
					AsxStatus21_FB = 1;			 
				} 
			} 
		} 
		else if(c3 > 0) 
		{ 
			CmdRemove = Remove("{",cmdTemp1); 
			CmdB = Left(cmdTemp1,c3-c1-1) + "%";  
			CmdRemove = Remove(";",cmdTemp1); 
			CmdC = Left(cmdTemp1,c2-c3-1) + "%"; 
		} 
		else  
		{ 
			CmdRemove = Remove("{",cmdTemp1);  
			CmdC = Left(CmdTemp1,c2-c1-1) + "%"; 
		} 
	}  
				  
	clearbuffer(CmdData); 
} 
 
/* 
EVENT 
{ 
    // TODO:  Add code here 
} 
*/ 
 
/******************************************************************************************* 
  Main() 
  Uncomment and place one-time startup code here 
  (This code will get called when the system starts up) 
*******************************************************************************************/ 
/* 
Function Main() 
{ 
    // TODO:  Add code here 
    // Initialize declared global and local variables/arrays as needed. 
 
    // WaitForInitializationComplete(); 
    // If you are reading any Input or Output variables, uncomment 
    //   the WaitForInitializationComplete statement above and read 
    //   them afterwards.  Input/Output variables will not have 
    //   their correct values set until after the logic processor 
    //   runs and propagates the values to them. 
} 
*/