ControlLogix REAL number oddity.

T

Thread Starter

Trevor Ousey

Hi All,

I have just had a curious fault with a ControlLogix 5550 processor and am wondering if anyone has any ideas;

The processor had faulted, error was that a negative number had been passed to a timer preset. The tag that the timer preset comes from is a REAL, but it had 1.$ as its value. I set it
to 1.0 and everything is fine, so I tried
entering 1.$ from RSLogix and it loaded it to the tag and then faulted the processor. Truly odd.

We are running Ver.10, so maybe its version related.

Regards,

Trevor Ousey

BJH Controls P/L
Mt. Gambier, SA, 5290.
 
T
I checked it out on one of my CLXs running ver 11.11 and found the same thing. 1.$ will convert to a -1 when moved to a DINT, and your timer ACC is a DINT data type.

Usually the $ character is used in strings to designate a special character, such as $13 for ascii char 13. The CLX will let you plug 8 bit ascii chars into SINT, INT, DINT types up to the size of the data types. Apparently something is letting you plug into a REAL.

Looks like you uncovered an anomoly. Send it to Rockwell or post it on RSForum. I uncovered one a couple of months ago and found them to be responsive and they provided a work around. In the meantime write a routine to trap the negative value before the timer instruction is executed.
 
M
I don't have the answer, but I can add to the curiosity. I was purposely creating various faults in order to teach fault recovery. One of them was "divide by zero". It generated a minor fault indicating arithmetic overflow, and placed 1.$ in the destination. I gathered that 1.$ was a placeholder for unreal (or is it irrational?) numbers. Later, after more tinkering, I found that dividing a positive number (integer or real) by zero will return 1.$, dividing any negative number by zero returns -1.$, and dividing zero by zero returns 1.#QNAN.

Curiouser still.

M.Pebworth
 
T

Trevor Ousey

Actually I finally found what 1.$ is, from Rockwell tech support.

<clip> from Rockwell support reply
The REAL value "1.$" actually means 'Positive Infinity'.
- If you are getting this in your ladder code it is most likely being caused
by a 'Divide by Zero'.

<clip>

So I would assume that -1.$ is negative infinity, and 1.#QNAN is a
'non-result' type.

Cheers.
 
T
Thanks Trevor, that makes sense because
-1 is 11111111111111111111111111111111.
positive infinity in a real number converted to a DINT would fill the 32 bit integer with ones, which is -1 in twos compliment binary.

You can stop the timer from executing if there is a negative number in the accumulator by putting the instruction XIO TIMER_TAG_NAME.ACC[15] in front of the timer, but it is better to not divide by zero.
 
Top