How to read a floating point on InTouch?

J

Thread Starter

Jhon

Hi there,

I'm trying to read a floating point from an OPTO22 on InTouch. I'm doing this through OPC, the issue is that on OPTO22's software I read values like 2.215, 4.234, but on InTouch I get 10 digits like 1094025478.

So far, I've founded this is relationed to IEEE 754 32 bits but I don't know wheter I need to make an script to convert these ten digits in values like I read on OPTO22's software or not.

BTW the current scaling is:

min eu: 0
max eu: 9999999999
min raw: 0
max raw: 9999999999

Hope you can help me.

Jhon
 
I apologize. It's been my fault.

What I had done was to access to a float variable like an integer.

When I realized it, I changed the way how I accessed this variable and that has been working fine until now.

Before: [CONT|ip|tcp:10.99.0.25:22001]I32;Value;nTA_56A

Now: [CONT|ip|tcp:10.99.0.25:22001]F;Value;nTA_56A

The I32 was the matter.

Jhon
 
I
hi dear.

i could solve the problem in my project.

if you can pass this exotic condition, follow below steps. you must programming in script of InTouch.

first you must define I/O Integer tag for example, IW20 then in script page write this code:

Floating_point(or your selected name) = IW20 ... equation (and write your equation)

then you must define floating point or your selected name in "memory real"

okay...
now in run time of your project you could view accurate floating point number.

best.
 
Top