LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

et3500 driver rounding error

Solved!
Go to solution

Hello

 

I am currently working on a project involving a Eurotherm 3508 instrument. I am controlling this instrument using the et3500 driver (http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=FA24DAC594CD4665E0340003BA7CCD...), but I have a rather serious problem with it:

 

I can connect to the instrument just fine, and also change the configuration and send new setpoints to it. But when I try to read data from it I only get integers.

 

I have tried connecting to the instrument using Eurotherm's own software (itools), and with this I can read decimals just fine. With the labview-driver, however, I only get integers. I cannot find any settings that will let me change the accuracy. 

 

 

Does anyone have experience with this driver?

 

 

 

- Anders

0 Kudos
Message 1 of 14
(3,882 Views)

I have looked some more into the driver. It reads the temperature via modbus from register address 360.

 

iTools also seem to be reading the temperature (IO.PV.PV) from this address. In iTools I find the value IO.PV.PV, right click and look in the properties menu. It reads

Comms address: 21276

Display address: 360

 

 

When I look at the bytes before and after address 360, they are all empty (=0). Since the temperature is a float (and iTools can read the decimals, supposedly from the same register), shouldn't there be values in the two bytes following address 360 as well rather than constant zero? The decimals read by iTools change with the temperature. The bytes following 360 do not.

 

I have also tried changing the address in the driver to 21276 (the comms address found in iTools). The resulting number was not the temperature, and changes almost twice as fast as the temperature from 360. (So I'm guessing this is not the number I am looking for)

 

The attached image shows the 4 bytes on address 360 and 361. 360, where the temperature (no digits) is read from shows the temperature as it should look without decimals, but the last 2 bytes are constantly zero.

 

(I am not a programmer or computer scientist, so I am not too familiar with all this number-storage. Please correct me if I have misunderstood anything that could help me solve this problem)

 

 

-Anders

0 Kudos
Message 2 of 14
(3,835 Views)

The reason you are not getting the precision you want is because of how you are representing the numbers.

Notice in you block diagram your values are represented with blue wires that say 'I16'.

These are 16 bit integers, meaning you will get no decimals.

Try using single or double precision float, that should give you decimals 

Cory K
0 Kudos
Message 3 of 14
(3,826 Views)

I have followed the data flow back through the subVI's. Eventually I end up in the subVI where the values are read via modbus. Modbus returns an array of bytes, and these bytes are combined into the register values before being passed on to my program. The returned value is an integer from the beginning, and  has not been a float anywhere on the way. The problem is not that it is rounded somewhere in the program - is is not read as a float to begin with, as far as I can tell.

 

As I understand it, a single precision float takes up 4 bytes. The modbus driver only gives me 1 word (2 bytes) from each register. If i want to convert this to a floating point number, will I not need another 2 bytes containing more information?

 

-Anders

 

0 Kudos
Message 4 of 14
(3,807 Views)

As I understand it, a single precision float takes up 4 bytes.  


Correct
 

If i want to convert this to a floating point number, will I not need another 2 bytes containing more information?


 

You could typecast the value from an integer to a single or double precision float, but that wouldn't gain you any decimals because they are not present when the number is stored as an integer.
For example, all it would do is give you 17.0 instead of 17, and thats not really what you are looking for, you want the actual decimals.
Is there any way you could attach the VI so I could look at what is going on? I do not have that instrument, so I cannot run the VI, but maybe it will help to take a look at the code.

 

Message Edited by Cory K on 06-02-2010 11:43 AM
Cory K
Message 5 of 14
(3,795 Views)

I have put my own example program and the required subvis into the attached zip-file.

The program I have attached is a simplified version of the example program that came with the driver, and the subvis are unaltered copies of those found in the driver. The driver came with labview and you might already have it, but I have included the subvis anyway, just in case.

 

- Anders

0 Kudos
Message 6 of 14
(3,788 Views)
Solution
Accepted by topic author A.Soerensen

I have found the solution!!! (and I'm going to write it here if anyone with the same problem should need it)

 

It turns out that the driver was reading the temperature from the "wrong" register. Inside the instrument, the different values are stored several different places for different purposes.

 

In the iTools properties window there were 2 addresses listed, 360 and 21276. I had previously looked at 21276 and assured myself that it was not the value I was looking for. It turned out that I had forgotten how floating point numbers work (or maybe I never understood it in the first place). After having read a bit more about floating point representation I realized that 21276 was the correct address after all.

 

So now, by reading 21276 and 21277 and combining them into a 32 bit integer and converting them, I can read the temperature with as many decimals as I want (or at least as many as I need).

 

Important: This also applies to other instrument values such as setpoint and power output. They are stored rounded in one place for use on the display, and in another location as single precision float for taking measurements.

 

As for the address that was used in the driver by default, I'm not entirely sure what's it for, but I have an idea. In iTools there was a property labelled "Display address" with the value 360. On the front panel of the instrument there is a display that shows the temperature without any digits. I think that maybe address 360 is used to store a rounded temperature for use on the display.

 

 

Anyway, my problem has been solved.

 

Thank you for your help, Cory. I hope you haven't wasted too much time on me 🙂

 

 

- Anders

Message 7 of 14
(3,757 Views)
I'm glad you figured it out.
And thank you for posting the solution in case anyone else runs into this problem in the future.
Cory K
0 Kudos
Message 8 of 14
(3,753 Views)

1. "So now, by reading 21276 and 21277 and combining them into a 32 bit integer and converting them, I can read the temperature with as many decimals as I want (or at least as many as I need)."

 

Is it possible to provide a simple example on this?

 

2. I can't get my 3508 controller to "Self Tune". E.g. when I reach a set temperature (e.g. 300 deg.), controller goes to 304 deg. (sometimes 306) and then suplied power goes straight to 0%. Temperature goes down to 296 deg. then controller gives the FULL 100% power to bring the temperature back up to 300 again. And this continues on back and forth.

I would have thought that controller should start to stabilise the power output and then provide a contstant amount automatically, rather than providing either 100% power or 0%.

 

Any thoughts appriciated.

 

Kas

0 Kudos
Message 9 of 14
(3,486 Views)

I'll try and make a simple VI for you some time tomorrow.

 

Your problem with over- and undershooting sounds like a problem with your PID parameters. The Eurotherm uses a PID proces for controlling the temperature. A PID proces works through three terms, each with their own parameter:

P: Proportional term. This term adjusts the power proportionally to the error (difference between the setpoint and the current temperature). If the P parameter is set wrong, the eurotherm will go to 100% even at the slightest temperature variation.

I: An integral term that adjusts more power (or less) the longer the error has been there.

😧 A derivative term. Controls power according to the derivative of the error. If the error is decreasing rapidly (T is approaching the SP) the D-term will turn the power up or down to prevent over- or undershooting.

 

There should be two examples with the et3500 driver. One of them shows how to set the PID parameters.

 

0 Kudos
Message 10 of 14
(3,476 Views)