So, having been using DeltaV for the last two years now, there's a question I have regarding parameter types.
What is the difference between discrete and boolean parameter types?
According to BOL:
• Boolean — a logic value that is True (1) or False (0).• Boolean with Status — a True or False value with status indicator.• Discrete with Status — an unsigned 8-bit integer value with a status indicator. A value of 0 (zero) means False. A value between 1 and 255 means True.
My interpretation, I see Boolean with Status and Discrete with Status as the same thing.
Can someone shed some light on this for me? Thanks
In reply to Michael Krispin:
Hmm. Not sure what you are asking. DeltaV will coerce the value to match the required type if it can. Bitwise Operators allow you to work with integers and extract bit values, shift and combine the integers without converting integers to floats. The biggest problem with Floating point numbers is when one writes if (x+y) = z then... . The expression might skip Z as a valid answer. As "x" gest bigger, its Log portion gets bigger, which decreases the precision of the number. When you add "y", the number is expessed in the same logarithm range as the larger number and the reduced precision affects the result. For more robust code, check Floating point values for a limit threshold, or a range. To preserve data type, store an integer into a module parameter especially a 32 bit float as this number exceeds the resolution of the float mantissa. If you store it in OUT1 or an internal register, it converts to a Float. Say you want to combine two 16 bit integers into a 32 bit integer. use one line to read both values, shifting one 16 positions to the left with a bitwise OR and write this to a 32 bit integer parameter: '^/32BIT_VALUE.CV' := SHL('^/MSB_16BIT.CV', 16) | '^/LSB_16BIT.CV' If you stored this result in OUT1 or an internal variable, it would convert to Float and would not be equal to "32BIT_VALUE.CV" One last thing. The value in the above 32 bit parameter will not be available to the expression until the next scan of the module. Output writes from an expression occur at the end of the expression, and are available for any subsequent function block during that scan, and to the rest of the controller/system. If you need to work with intermediate values stored in parameters, split the work into two Calc blocks with the first one conditioning the data and the second one using it. Otherwise, your result is delayed by a module scan.
Andre Dicaire
In reply to Andre Dicaire:
In reply to SNosnam:
In reply to Lun.Raznik:
In reply to jwherwig:
In reply to Michael Moody:
As Michael stated, the DISCRETE can be wired from an integer from 0 to 255. This very important. From my experience, if you pass an integer > 255 into the IN_D of most function blocks, it DOES NOT ALWAYS resolve as TRUE. Therefore, if you want to pass an integer to IN_D of a function block, you need to make sure it is no greater than 255.