Controllogix math to convert float number to scientific parts?

OK - I've run into real problems with testing for bad values. The Pic shows clearly that the REAL range, as described in the Help, is not congruent, notice the e-43 !!. And I think it might be platform/revision dependent as well.

So, the best advice I can give right now is to range check what you give as the input parameter to the AOI, use a LIM to ensure you only give it input values that are appropriate to your process.

2014-02-22_014843.jpg
 
Last edited:
It will still be okay for my range though?

It will be OK in any applicationj that can guarantee, with 100% confidence, that the input value cannot, under ANY circumstances, be infinity, or a NaN.

Having said that, I would still recommend preceding it with a LIM so that it only sees valid values.
 
It will be OK in any applicationj that can guarantee, with 100% confidence, that the input value cannot, under ANY circumstances, be infinity, or a NaN.

Having said that, I would still recommend preceding it with a LIM so that it only sees valid values.

I was playing with this too, as bounds protection added a loop counter, and bailed out when greater than 128 loops... As an aside, found the fp maths started being a problem around +/- 40exp
 
How do I use the Mantissa and Exponents in the logic. I cannot see how to reassign or rename these these tags?
I have 3 vacuum gauges I need to break the Exponent and Mantissa from.
 
I have assigned these as internal tags.

to use them in external logic, you will need to address the components of the AOI tag.

In my example code the tag was called Convert1, so to address the data for that instance call, use Convert1.Mantissa and Convert1.Exponent.

If you want, declare those parameters as "Required", then when you use the AOI, you will need to specify where those parameters are written to for each time you use it.
 
Here's the AOI in a V20 .ACD file.

It has the +/-INF and NaN protection complete, and a trap for the Exponent exceeding +/-38, which is what the Help on REAL says is the maximum, although, like Lemming, I have seen greater.

I'm not going to sit and enter every bit pattern to see the results, though, unless I can think of a way of doing this automatically !!
 
Well I wrote some test code, to cycle through every possible bit pattern in a DINT, COPied into a REAL tag, and fired all of these bit patterns at the AOI.

I'm sure you will appreciate it took a while to complete....

All went well, and the AOI from my last post gave the expected results from the F.P. coding.
 

Similar Topics

'Morning All, I've run into something that is just annoying me on a CLX System using counter modules. The counter modules have 24 bit counters...
Replies
5
Views
12,416
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
86
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
215
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
197
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
233
Back
Top Bottom