{}

Our Brands

Welcome to the Schneider Electric Website

Welcome to our website.
How can we help you today?
How to read Double Float values in Citect?

Attached is a VB6 code for creating a 64 bit double precision floating point value from a binary value stored as a string. It isn't especially efficient since it uses string conversions but it should work. I just added a wrapper function to convert 4 integer registers into binary so it can convert the whole binary string into a double.


For example, 1234567890.123456 in binary is: 0100000111010010011001011000000010110100100001111110011010110111
If you read that from a PLC as 4x 16-bit unsigned integers, they will be:
16850 (0100000111010010)
25984 (0110010110000000)
46215 (1011010010000111)
59063 (1110011010110111)

Call IntsToDouble(16850, 25984, 46215, 59063) and it will return 1234567890.123456 as a 64-bit REAL.

Schneider Electric South Africa

Attachment(s)
servlet.txt [4.08 KB]
Explore more
Range:
Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Range:
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.