可以使用脚本来实现,例程参考如下:
Below is a script to compare two string variables in Vijeo Designer:
String s1, s2; //declare two internal script string variables called s1 and s2
int mycompare; //declare integer variable mycompare
s1 = MyString01.getStringValue(); //let s1 equal to the external variable called MyString01
s2 = MyString02.getStringValue(); //let s2 equal to the external variable called MyString02
mycompare = s1.compareTo(s2); //compare the two strings, returns 0 if equal and anything else if not equal
if (mycompare == 0) //if statement to compare if mycompare is equal to 0
ResultString.write("String are equal"); //write a string constant to the external variable ResultString
else
ResultString.write("String are not equal"); //write a string constant to the external variable ResultString
是否有帮助?