citect floating point problem

dusmir

Member
Join Date
Apr 2008
Location
Missouri
Posts
7
Hello, I've got a problem displaying a 'real' or floating point number in citect. I am using a scadapack plc and citect ver. 5.41. I have a floating point value being written to a register in the scadapack plc and when I get online with it and monitor the register, I see the proper value. (it is a minute/hour counter that displays in 1/10 hr increments) When I set up citect to look at this register, (with 'real' selected as the data type) I do not get the proper number. Sometimes it is '0' other times it is something way different than what is supposed to be there. I have not worked with scadapack or citect for very long, so I may just be missing something obvious. Any Ideas?
 
It could be an endian problem. What exactly are the two numbers you are seeing when you are online with the PLC and what is CiTect showing at the exact same time? If you provide those numbers we can help you determine if its an endian problem or something else.
 
For example, the PLC will have +2.95 and the citect will have -3.70e+028. A few minutes later, it might go to '0'.

The scadapack is showing the data correctly though, I can watch it time up and compare it with a stopwatch.
 
What protocol are using in Citect? In some protocols the REAL type uses two adjacent memory locations. If some of the tags are addressed on an even boundary (tag in Citect addressed as V1000 which means it occupies V1000 and V1001) and other tags are are addressed on an odd boundary (say addressed at V1055 and V1056. This may cause problems. Check that all your "two memory location tags" like REALs are all on the same boundary either all even or all odd.
 
dusmir said:
For example, the PLC will have +2.95 and the citect will have -3.70e+028. A few minutes later, it might go to '0'.

The scadapack is showing the data correctly though, I can watch it time up and compare it with a stopwatch.

It does look like an endian problem. The negative sign is a big clue, and I suspect that the reason it periodically reads 0 is because an invalid IEEE-754 float pattern is occuring.

The solution could be as simple as swapping the high order word for the low order word, but then it might be more involved. First we need a floating number that can be represnted EXACTLY in IEEE-754 format and that we can test the bit arrangement of. One such number is 3.71875 (406E0000). Enter this number into your scadapak register and let us know what CiTect reports.
 
One more thing:

You probably have CiTect rounding the display to 1 or two digits - if you can show more that will help in determining exactly what order CiTect is expecting to read the float.

If you can't do that then also use the number 2.5 and post both results.
 
I get zero on both numbers. I can change the tag to an unsigned int. in citect and the plc data view and get the same number then. (2.50 floating point value, change the data view in PLC to unsign int., I see 16416 in the plc and 16416 in citect)
 
You need to configure the float mode parameters in your Modbus driver (under the Citect ini file) to suit the order of the floats (REAL) in your PLC

[MODBUS]FloatMode

Control byte order for floating point values (the MODBUS driver supports floating point values). Some systems expect to use a different byte order for their floating point data.


Allowable Values 0 to 3, where:

0 - Byte order = 1 0 3 2

1 - Byte order = 3 2 1 0

2 - Byte order = 0 1 2 3

3 - Byte order = 2 3 0 1

Default Value 0
 
That did it! I knew it would be something really simple in the end! I'm not really up on Citect so I didn't even know about that setting. Thank you very very much!!!
 
No problem, been there myself !!

Its not really a Citect issue, its more spcific to Modbus and the way different devices handle REAL's

Like most of the Citect help its usually there somewhere but its finding it thats the problem.

I generally have a read through the specific driver help every time i use a new driver so i know what i am dealing with.
 
If I had used citect or scadapack for a while, I probably would have stumbled across it. I use mainly wonderware and direct logic PLCs, but had this thrown at me out of the blue. Thanks again.
 
tragically1969 said:
You need to configure the float mode parameters in your Modbus driver (under the Citect ini file) to suit the order of the floats (REAL) in your PLC

[MODBUS]FloatMode

Control byte order for floating point values (the MODBUS driver supports floating point values). Some systems expect to use a different byte order for their floating point data.


Allowable Values 0 to 3, where:

0 - Byte order = 1 0 3 2

1 - Byte order = 3 2 1 0

2 - Byte order = 0 1 2 3

3 - Byte order = 2 3 0 1

Default Value 0

Thanks for chiming in. I was going to try swapping the bytes around until we got agreement - I'm glad someone had the answer already.
 
MODNET floating point issue in CITECT

You need to configure the float mode parameters in your Modbus driver (under the Citect ini file) to suit the order of the floats (REAL) in your PLC

[MODBUS]FloatMode

Control byte order for floating point values (the MODBUS driver supports floating point values). Some systems expect to use a different byte order for their floating point data.


Allowable Values 0 to 3, where:

0 - Byte order = 1 0 3 2

1 - Byte order = 3 2 1 0

2 - Byte order = 0 1 2 3

3 - Byte order = 2 3 0 1

Default Value 0

Hello:

I have the same problem, but bigger. I'm configuring a network with 2 modbus tcp/ip nodes. The first one is connected to a Twido PLC and is working fine. The second one has 5 units of Powerlogic PM710MG meters. While reading the floating point address from CITECT, they have and offset of -2 . this means that if the address on the manual says 1050, the value would be on 1048.

Before connecting the equipment I use a tool named Modscan32. I notice that for this particular item, in order to have the correct reading at the correct address you need to swap the bytes.

I read the CITECT help and found the issue you say here but the question is: if I modify this parameter, it will affect the twido reading also?

I believe the answer will be yes, so how do I change this parameter without affecting the twido reading?

Hope you can help,

regards,

Joaquin Negreteo_O
 
It is possible to set this parameter per IOdevice.

Only I don't know the syntax by hard, its something like

[Clustername.Iodevice]
FloatMode = 1

If you make the setting for the modbus protocol [MODBUS] all modbus devices are affected. If you set the parameter for a specific IOdevice only that IOdevice is affected.

Marsi
 

Similar Topics

Hello, the system we use is Scada 7.5 series. We have usb key activ now we need additional key to make the system work, how do we solve this...
Replies
0
Views
33
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
67
Hello, i've been at this for months now, i tried creating accounts on the aveva website but it seems to never approve my accounts or at least when...
Replies
3
Views
97
Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
76
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
83
Back
Top Bottom