AutomationTechBrian
Lifetime Supporting Member
I'm being directed to fill process values into an array of DINTs. A portion of the REAL values got copied into 2 DINTs each, but there are more REAL values than designated slots for them. So I was directed to multiply smaller REAL values by 1,000 and copy them into individual DINTs.
So, tonight I'm playing with test values on my CompactLogix L16ER to find the simplest way to do it before converting all the values. I expected to have to use a command to convert values, or at least remove the decimal values before coming up with the resultant DINT, but it seems I don't need to do any of that. I've been playing around with the conversion, however, and it's not perfect. The rounding seems odd... not always what I would expect it to be. But maybe for insignificant values, it is acceptable. But I should check with you guys... is this a good way to accomplish the conversion?
So, tonight I'm playing with test values on my CompactLogix L16ER to find the simplest way to do it before converting all the values. I expected to have to use a command to convert values, or at least remove the decimal values before coming up with the resultant DINT, but it seems I don't need to do any of that. I've been playing around with the conversion, however, and it's not perfect. The rounding seems odd... not always what I would expect it to be. But maybe for insignificant values, it is acceptable. But I should check with you guys... is this a good way to accomplish the conversion?