一段程序如下
....
....
printf("\n");
printf(" Valve_SteamPress= %1.2f ",Valve_SteamPress);
SetTagDouble("Valve_SteamPress",Valve_SteamPress);printf("Valve_SteamPress_1= %1.2f Valve_SteamPress= %1.2f ",Valve_SteamPress_1,GetTagDouble("Valve_SteamPress"));
....
.....
在应用程序窗口观察到:
Valve_SteamPress= 80.21 Valve_SteamPress_1= 80.42 Valve_SteamPress= 80.42
是不是Valve_SteamPress 没有存到“Valve_SteamPress ”这个内部变量里?为什么SetTagDouble函数不起作用呢?
最佳答案
经测试,此段脚本单独运行没有问题,建议检查脚本上下代码,重新编译脚本。
测试环境:
WinCC V7.0
添加内部实型变量Valve_SteamPress
脚本前添加声明:
double Valve_SteamPress=80.21;
double Valve_SteamPress_1=80.42;
结果:
Valve_SteamPress= 80.21 Valve_SteamPress_1= 80.42 Valve_SteamPress= 80.21
提问者对于答案的评价:
谢谢
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc266227.html