From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus/TCP connection to Eurotherm EPack power controller

Solved!
Go to solution

Are there any examples of how to connect to an Eurotherm EPack power controller using a modbus/TCP connection?

I have downloaded the Modbus LabVIEW Library ni_lib_modbus_library-1.1.3.32.vip and installed it using VIPM.

However, I am not familiar with the modbus protocol and terminology such as Coils, Holding Registers and the like.

I cannot even successfully run the Modbus Master and Slave examples from this library 😞

Most important for me now is just to read the process value from the EPack.

 

The Eurotherm controller software "iTools" provides information on something I think is a memory address of the process value I'd like to read.

However, I have no clue how to set the various parameters to get  succesfully connect and read the process value.

0 Kudos
Message 1 of 6
(6,138 Views)

Update (too late for edit)..

I also installed the Datalogging and Supervisory Control toolkit containing an Modbus Library.lvproj example (example finder).

This project contains Modbus  Master and Slave examples.

I can run these successfully on my desktop (reading and writing coils).

A liitle reading on the web provides me the following information:

There are discrete inputs (read-only boolean), coils (read-write boolean), input registers (read-only integer), and holding registers (read-write integer).

That's about all the knowledge I have.

 

0 Kudos
Message 2 of 6
(6,127 Views)

Hello,

 

I am Ed from National Instruments Applications Engineering. I have been forwarded your forum post, which I am happy to assist you with.

 

So, Modbus is primarily a communication protocol for communicating with PLCs. PLCs store the data of their sensor values, current operational status and operational parameters in what is called registers/coils which can then be read/written from/to via Modbus. If you are indeed using the Datalogging and Supervisory Control Toolkit you need not know the finer details of Modbus and how it works further but primarily since the registers/coils of each PLC differ in functionality, you will need to know the PLC registers/coils that you would like to read/write.

 

This should be available in the devices manual/data sheet or provided upon request to the manufacturer.

 

You can either communicate Modbus using I/O Variables setup in a LabVIEW library or by using the Modbus palette functions themselves. With the example you cited, this is reading/writing coil data using the Modbus palette functions so I will continue to discuss the subject in reference to this.

 

So, a coil stores boolean data such as on/off, so this may be, an alarm on the PLC for say, overheating.

 

Then a register stores numerical values such as the actual recorded temperature within the PLC.

 

There are overall 2 tables of registers and 2 tables of coils. The example project writes to coils 1-11, which are 1 bit values. If you would like to read/write registers, you can use the read holding registers within the Modbus function palette under Data Communication -> Modbus Library -> Modbus Master/Slave.

 

The differing tables have differing ability, the first table of coils (addresses 1-9999) can be read to and written to the PLC whereas the second set (10001-19999) can only be read from the PLC. The first set of registers are addresses 30001-39999 and are also read only whereas the second set is 40001-49999 and can be written to as well as read.

 

Please note: a majority of PLC addresses begin at 1 whereas LabVIEW is zero-based so you may need to offset in LabVIEW your register values to account for this. Additionally LabVIEW views data as Most Significant Bit whereas most PLC's are Least Significant Bit which can jumble the information. You may need to account for this and use split numbers and join numbers for data values of greater than 8 bits. (to which registers are 16 bits so this will be most likely the case).

 

I have included some further documentation below:

 

1. http://www.simplymodbus.ca/FAQ.htm

 

2. http://www.ni.com/white-paper/7675/en/

 

3. http://www.ni.com/white-paper/52134/en/

 

If you have any further questions please don't hesitate to ask.

 

Best regards,

 

Ed

0 Kudos
Message 3 of 6
(6,081 Views)

Hi Ed,

 

Thanks for the reply.

I can grasp the idea of MODBUS which is not that difficult (I read www.simplymodbus.ca). It is just the details, that makes it hard to have (robust) communication. Once you have the (register) value you are interested in, you need to know how to convert it to engineering, floating point, data.

 

The EPack power controller I want to read out for instance explains the use of a sub protocol:

This sub-protocol provides two consecutive Modbus addresses for all parameters. The base address for any
given parameter in the IEEE region can easily be calculated by taking its normal Modbus address, doubling it,
and adding 8000h. For example, the address in the IEEE region of the Target Setpoint (Modbus address 2) is
simply
2 x 2 + 8000h = 8004h = 32772 decimal
This calculation applies to any parameter that has a Modbus address.

 

For now, I am even not able to have the LabVIEW master/slave examples communicate with each other. Could you show me how I have to set the various values and in which order run the vi's and press buttons?

I tried to start the slave, then the master, then press 'connect' on the master only to have an error thrown on the master:

"Error 56 occurred at TCP Open Connection in TCP Master.lvclass:Initialize Master.vi->Modbus Master.lvclass:Initialize.vi->API Main.lvlib:Create TCP Master.vi->Modbus Master Example.vi"

 

Thanks,

 

 

0 Kudos
Message 4 of 6
(6,063 Views)

Meanwhile I tried something very basic (see attachment) and have communication over ethernet between PC and Eurotherm's EPack.

I need to convert the 16 bit numbers to engineering data, for that I will contact the manufacturer (Eurotherm).

 

Is this the way to go?

 

 

0 Kudos
Message 5 of 6
(6,048 Views)
Solution
Accepted by topic author donkdonk

In the process of solving my own problem I managed to have basic communication and conversion to engineering data.

Now I can read process values like power line frequency, voltage and the like.

Once you know it, it is pretty simple (once you have the modbus library) Smiley Very Happy

 

Some things that remain unclear:

- which values are 32 bit and which 16 bit?

- is the addressing method the same for all parameters?

- is it the same for for reading and for writing?

 

I would like to be able to write the setpoint, for instance.

 

I will contact the vendor for these remaining questions. The manual is not really clear (at least not for me). It mentions that some values may be treated differenly (they may be 16 bit, but scaled; so 5001 with a scaling factor of 100 actually means 50.01 for instance).

 

See attachment for basic EPack readout.

0 Kudos
Message 6 of 6
(6,022 Views)