Big (64 bit) numbers in PcVue

5 Posts
3 Users
0 Likes
32 Views
RM
 RM
(@r-martinarcinfo-com)
Posts: 56
Estimable Member
Topic starter
 

I have a customer that wants to read and display a 64 bit signed integer in PcVue. Ignoring the issue of how the number gets into PcVue in the first place, what are the issues with managing (saving and displaying) such large numbers in PcVue. I am sure there must be some!

Cheers, Robin

 
Posted : 01/10/2015 2:27 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

At least you must keep the option "Use register variables as double in Scada Basic" in the general Settings/Program. It's true by default.

Nico

 
Posted : 01/10/2015 3:25 pm
LM
 LM
(@l-micaudarcinfo-com)
Posts: 383
Member Admin
 

If we trust Wikipedia it can be Signed: From −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, from −(2exp(63)) to 2exp(63) − 1

and Unsigned: From 0 to 18,446,744,073,709,551,615 which equals 2exp(64) − 1

In PcVue if I try to put this value in a register it says value out of limits

 
Posted : 01/10/2015 3:33 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

Indeed!
According our super training manual register variable has the folling limits:
Register: -3.37E+38 to +3.37E+38

Nico

 
Posted : 01/10/2015 4:19 pm
RM
 RM
(@r-martinarcinfo-com)
Posts: 56
Estimable Member
Topic starter
 

The customer has told be that the 64 bit value is supplied as 4 x 16 bit words (modbus)
I had a play using 4 words (as registers) , shifted left by 0, 16, 32 & 48 bits and then added together - all using expressions. It almost works but there are two problems.

  • Larger numbers loose accuracy. I think this is because PcVue stores register variables as 32 bit floats (yes anyone?)
  • Very large numbers are displayed as negative values. I suppose something is interpretting the top bit as a sign bit?

Anymore comments anyone?
Cheers, Robin

 
Posted : 01/10/2015 6:05 pm