Boolean tags and Boolean variables
|Boolean state||Numerical value in a…|
|IWS project tag||VBScript variable|
|TRUE||1 (or non-zero)||−1|
This can cause problems during run time as logical and arithmetic operations — especially the NOT operator — might change tag values in unexpected ways. To prevent these problems and ensure that Boolean tags have the correct values at all times, the VBScript interface in InduSoft Web Studio has been modified to preprocess Boolean tags and handle them like Boolean variables. In other words, while a Boolean tag has an actual value of 1 in the tags database, it is handled as if it has a value of -1 in VBScript so that you can perform operations using both Boolean tags and Boolean variables.
After you do this, however, you must thoroughly test your project to make sure that your VBScript code still behaves as expected.
'The following statements are valid If $MyBoolean = 1 Then End If If $MyBoolean = True Then End If If #Mne:@MyPointer = True Then End If 'The following statement is invalid If #Mne:@MyPointer = 1 Then End If