LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to monitor parameters using Modbus protocol in LV

Solved!
Go to solution

Hello everybody

 

I have a problem with my LabVIEW  project. I need to monitor my MI4100 Power monitor parameters using LV 8.5 and I do not realy Know how. I'm using modbus RTU protocol and I am able to comunicate with the instrument, but I can not figure it out how to monitor the registers.

I've attached my comunication VI to see what i allready did. Please help me if you can.

 

 

Thanks in advance, Sylvia

 

0 Kudos
Message 1 of 10
(4,395 Views)

How are you communicating with the instrument now?

 

You need to make sure you use the slave address that the instrument is set for.  (The default value of zero for that control will not work.)

 

What kind of registers are you trying to read?  coils, input, holding?  You will have to select the correct value for the enum in the modbus command control.  You will also have to set the number of registers to read and the starting address of the register.

 

Let's say you want to read holding registers at 40,010 and 40,011.  Set the command to be Read holding registers (3),  starting address is 9 (LV is zero based, and you ignore the leading 4 of the address),  and read 2 registers.

 

If you still have problems, post back with more information.  Post your VI with your control settings saved as default values.  Post a link to the instrument's communication manual.  Give details on any error messages or error numbers you are getting.

0 Kudos
Message 2 of 10
(4,375 Views)

 

Thank you for responding so quickly.

 

The comunication is thru RS485, and i have a RS485-RS232 convertor(ADAM-4520).both the convertor and the instrument are set with the same features, same BR, same parity, same stops bits, etc.

Sorry for the default values I forgot to save mine.now they are set.

I did not find the manual for the instrument on the network so i've attached it to.

So if you wil read it you will see that every parameter is set on a register, so i need to read them with LB. but i can not figure it out how.

i have to read only voltage, curent, frequency and energy. and i think they are holding registers. i am able to read them with the Modbus Poll program, so I know the comunication is working, but i don't know how to implement it in LabVIEW.

Sorry for my english, i'm not so good at writing.

 

 

 

Download All
0 Kudos
Message 3 of 10
(4,358 Views)

You have to use MODBUS init.vi and MODBUS read.vi.

 

In Modbus Read.VI select holding register, specify register address, and quantity.

 

Quantity depends on the data format. So, if 16 bytes is data format for 1 register give quantity as 2. respectively calculate for each register.

 

I think this will help you.

Message Edited by Ranji on 06-25-2009 07:05 AM
0 Kudos
Message 4 of 10
(4,351 Views)

I'm new with LabVIEW, and i'm trying understand how it works, how are the register read. for example can i build a LabVIEW program so i can write directly  the comand (like 01 03 00 05 00 01 [CRC] ) and after that to get the response. how do i do that?  can u please tell me what to study, or were to find some tutorials.

 

0 Kudos
Message 5 of 10
(4,341 Views)

As I said earlier, you have to set the parameters Modbus Command Control.  That is the cluster at the top center of your VI.  The enum should be set to Read Holding Registers,  starting address 5, quantity is 1.

 

If you would like more details about modbus, look at the specifications posted at http://www.modbus.org/tech.php

0 Kudos
Message 6 of 10
(4,337 Views)

thank you but I know about modbus, the labview program is new for me, that's why i am asking a lot of questions, probably some of them are stupid Smiley Sad

my instrument has two words format registers, like lo and hi, how do i do to read them together.

in the manual is specified that the register adress i need to read is 263(107hex) for Frequency and i tried to write it as a starting adress, but if i write starting adress higher than 30 it get's me a 6002 error

0 Kudos
Message 7 of 10
(4,329 Views)
Solution
Accepted by topic author BlueEyed

If you are working with 32 bit numbers needing two registers, then what you are already doing with joining numbers will work.   Read 2 registers starting at 256, join the numbers and you will have total actife power.

 

If you are only reading 1 register, then you will have an array of 1 element.  Decimating that array  and joining numbers will make no sense.  You would just read that register directly.

 

What is the error description for 6002?

 

I don't see any reason why you wouldn't be able to read an address higher than 30.

 

 

0 Kudos
Message 8 of 10
(4,325 Views)

it is not described this error but i think is error 2, and for that this is what it says:

Possible reason(s):

LabVIEW:  Memory is full.

0 Kudos
Message 9 of 10
(4,323 Views)

thank you verry much it's working 😄  I don't realy know what was the problem but now it's ok.

thak you again for everything

 

Sylvia
0 Kudos
Message 10 of 10
(4,297 Views)