char stag1[20],stag2[20];
short int i;
int a[20];
int b[20];
a[1]=GetTagWord("ZBY4_1");
a[2]=GetTagWord("ZBY4_2");
a[3]=GetTagWord("ZBY4_3");
a[4]=GetTagWord("ZBY4_4");
a[5]=GetTagWord("ZBY4_5");
a[6]=GetTagWord("ZBY4_6");
a[7]=GetTagWord("ZBY4_7");
a[8]=GetTagWord("ZBY4_8");
a[9]=GetTagWord("ZBY4_9");
a[10]=GetTagWord("ZBY4_10");
a[11]=GetTagWord("ZBY4_12");
a[12]=GetTagWord("ZBY4_12");
a[13]=GetTagWord("ZBY4_13");
a[14]=GetTagWord("ZBY4_14");
a[15]=GetTagWord("ZBY4_15");
a[16]=GetTagWord("ZBY4_16");
for (i=1;i<=16;i++)
{
sprintf(stag1,"NewTag_%d",i); //状态
switch (a[i])
{
case 17017: SetTagChar("stag1[i]","B2_3拉绳停机");
case 17018: SetTagChar("stag1[i]","B2_4拉绳停机");
case 17019: SetTagChar("stag1[i]","B2_5拉绳停机");
想要实现的功能是:
根据zby-1 zby-2 zby-3等的值而在上位的一个输入输出域里显示不同的字符串
newTag是wincc中内部字符串变量
case 17017: SetTagChar("stag1[i]","B2_3拉绳停机");这段中的stag1[i],这样表示应该不对,请问怎么表示