LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU labview communication issue

Solved!
Go to solution

Hi all,

     Here i am interfacing TAIE FU 400 temperature control with labview though modbus rtu protocol using RS485, at first i downloaded modpoll application and interfaced using USB to RS485 transreceiver module with temp controller and i able to set the values in a controller but same when i try use with labview which is bit confusing from the beginning itself, can anybody help me go through this?. 

Thank you in advance for your reply

Regards

Dinesh

0 Kudos
Message 1 of 13
(6,796 Views)

Attach your LabVIEW code so we can see what you are trying to do.

0 Kudos
Message 2 of 13
(6,787 Views)

Thanks for your reply

I've attached a simple vi and the user manual for Modbus protocol there you will see a example for modbus rtu to set a value for SV(set value) in temperature controller, go through it.

Thanks in advance for your reply

Regards,

Dinesh

Download All
0 Kudos
Message 3 of 13
(6,769 Views)

Thanks for your reply

I've attached a simple vi and the user manual for Modbus protocol there you will see a example for modbus rtu to set a value for SV(set value) in temperature controller, go through it.

Thanks in advance for your reply

Regards,

Dinesh

0 Kudos
Message 4 of 13
(6,769 Views)

Thanks for your reply

I've attached a simple vi and the user manual for Modbus protocol there you will see a example for modbus rtu to set a value for SV(set value) in temperature controller, go through it.

Thanks in advance for your reply

Regards,

Dinesh

Download All
0 Kudos
Message 5 of 13
(6,767 Views)
Solution
Accepted by topic author dineshmeena

Your VI doesn't have any of the controls saved with values as default to know what slave address, function code, starting address, .... you are trying to use.

 

Let me make a list of comments, and also questions you'll need to answer.

 

1.  Are you sure your baud rate is 9600?

2.  Are you sure you have odd parity?

3.  You are using the MB Init subVI.  I have never used it because (and I consider this a flaw of that subVI) it assumes that the number of stop bits is 1 and that is hard-coded into the subVI.  I've had devices that require stop bits to be 2.  MB Init is just a glorified wrapper around the same functions you'd find in a regular VISA Serial Configure.  I'd use VISA Serial Configure so you can fully control all of the settings.

4.  Are you using RS-485 or RS-232?

5.  You have flow control set for DTR/DSR.  Are you sure the device requires that?  The manual you attached doesn't mention anything about DSR/DTR or even flow control at all.  Flow control is only associated with RS-232 connections.  And the wiring diagram on page 3 for RS-232 doesn't show any flow control wires being used.

6.  Are you using a slave address that matches what is programmed in the device?  Slave address of 0 will not work as it is used to broadcast messages to all devices, and those devices are not permitted to respond.  Slaves will only react to messages and send responses to Modbus commands that are specifically addressed to its slave address number.

7.  Are you using the correct function code?  Your default value of 0 won't work.  If you are setting a holding register, you will either need code 06hex for a single register, or 16hex  for multiple consecutive registers.

8.  Which register are you trying to set?

9.  Go to www.modbus.org and read the technical resources there about the Modbus protocol.

0 Kudos
Message 6 of 13
(6,751 Views)

Hi sir,

   Thank you so much for your reply,

   First of all, the baud rate(9600) and parity(odd) which i set is correct and i'm sure i was using RS-485 protocol, i don't have any idea about flow control, the slave address which i set here is 1 and the function code i set here is 06, which means i want  to write a single register value.

Regards,

Dinesh

0 Kudos
Message 7 of 13
(6,743 Views)

Hi sir,

        Thank you so much for your advice and now i able to set the value, as you've mentioned about the MB init function, that i replaced it with visa serial, now it is working fine.

Regards,

Dinesh

 

0 Kudos
Message 8 of 13
(6,741 Views)

Hi sir,

      I've attached you a edited vi but it displays timeout error, i cannot justify where exactly the error exists? and to get the response or process value from he controller, should i have to use the same method? with different register address as mentioned in the communication manual, i need some suggestions from you.

Thank you in advance

Regards,

Dinesh

Download All
0 Kudos
Message 9 of 13
(6,739 Views)

In your VI, you are writing to a single register, but you don't have any data in your "DATA" array.  That array is empty.  You need to have an element in there.

 

One more thing.  when you use VISA Serial Configure, make sure you wire a False into the Enable Termination Character input.  Since you are sending binary values, it is very likely at some point the device will send back a value of 10 decimal (line feed, the default termination character) and that would cause the VISA Reads inside the Modbus VI's to end early with incomplete data.

0 Kudos
Message 10 of 13
(6,721 Views)