Applies To:
  • CitectSCADA 5.xx, 5.50, 5.50 Service Pack A, 5.50 Service Pack B, 5.50 Service Pack C, 6.00, 6.10

Summary:
Multiplication of numbers do not work in CiVBA when the product is passed to a Single Precision or Double Precision Variable. For example, if I multiply 3600*24 and pass the product to a single or double variable, the product is returned as zero or a a null.
 

Solution:
If you multiply the two numbers as 3600 and 24, the compiler will get two integer (2 byte variables) and multiplying them together will produce a new integer (2 byte variable) and this will overflow the size of the integer which is 32768.

Changing your code to 3600.0 * 24.0 forces the compiler to do a floating point arithmetic. That should fix the problem.

Citect has confirmed this to be a problem in CitectHMI/SCADA. We are researching this problem and will post new information here as it becomes available.
 

Keywords:
 

Attachments