Is there some way to operate with 64-bit variables? LINT, ULINT, LWORD
I need to read energy consuption from energymeter over MB (thats no problem) and operate in program (compare) and show them in mappView.
Convert to LREAL or to string in a c-task.
I do the C-Library with “long long int” variable, which return LREAL, DINT,… → I need to calculate difference from INT64 and result in DINT is OK.
The easiest solution is probably as you do, to use a C library or a C task. If I needed 64-bit integers in ST, I wouldn’t use string conversions. Instead, I’d create a small function library on top of a struct containing two UDINTs.
UInt64Add()
UInt64Sub()
UInt64Compare()
UInt64ToLReal()
etc.
Using:
STRUCT
High : UDINT;
Low : UDINT;
END_STRUCT;