Hi Admin,
Sorry but I tried your script,
i add the first script to Custom CSS '/scada-main/main/editor?id=css'
add pre to the Additional class, pre
I add a groupadres with 250 byte string '0/1/1'
I run the script and sent it to the group adress i added.
I'm not sure what i'm doing wrong, but it didn't work.
Not if i look at the groupadress by it self and not on desktop view of the visualization (not the edit mode).
i got the next value when i sent it to the group adress: 2.234W 23.450W 345.600W 4567.000W
It looks like the %10 didn't work the second part of it (.3f W) works fine.
Is it also possible to got a value like
01.123W, and not 1.123W?
I tried to do it by myself, but all i tried didn't work.
what i try to get is this
I hope you can help me with this.
Sorry but I tried your script,
i add the first script to Custom CSS '/scada-main/main/editor?id=css'
add pre to the Additional class, pre
I add a groupadres with 250 byte string '0/1/1'
I run the script and sent it to the group adress i added.
Code:
v1 = 2.234
v2 = 23.45
v3 = 345.6
v4 = 4567
text = string.format(' %10.3fW %10.3fW %10.3fW %10.3fW', v1, v2, v3, v4)
-- write value (e.g. boolean 'true') to object with group address 1/1/1, datatype must be set for this object
grp.write('0/1/1', text)
I'm not sure what i'm doing wrong, but it didn't work.
Not if i look at the groupadress by it self and not on desktop view of the visualization (not the edit mode).
i got the next value when i sent it to the group adress: 2.234W 23.450W 345.600W 4567.000W
It looks like the %10 didn't work the second part of it (.3f W) works fine.
Is it also possible to got a value like
01.123W, and not 1.123W?
I tried to do it by myself, but all i tried didn't work.
what i try to get is this
Code:
v1 = 0.234
v2 = 3.45
v3 = 45.6
v4 = 123.7
string showing like:
00.234 W 03.450 W 45.600 W 123.7 L --(for the first 3 values, always show 2 digits before the .(dot) and 3 digits behond the .(dot) and for value 4, 3 digits before the .(dot) and just 1 behind.
1234567890123456789012345678901234567890 (position of character)
I hope you can help me with this.