LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus TCP/IP Communication

Solved!
Go to solution

Hello to everyone!

 

I'm trying to control the SANWOOD climatic chamber which uses a TCP/IP communication protocol, but every time I try to send a message I get error 66. Can anyone help me understand why?

 

I attach the VI and the example message.

 

Thanks

 

Comandi.PNG

0 Kudos
Message 1 of 11
(2,242 Views)

@gennaro95 wrote:

Hello to everyone!

 

I'm trying to control the SANWOOD climatic chamber which uses a TCP/IP communication protocol, but every time I try to send a message I get error 66. Can anyone help me understand why?

 

I attach the VI and the example message.

 

Thanks

 

Comandi.PNG

 


Did you read the text associated with error 66? I think it is a remote client closed connection error. Meaning the chamber closed the connection (or timed out).

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 11
(2,213 Views)

Yes, I read the explanation of the error, but I don't understand why it happens. Is it possible that I'm wrong in the way I send the message?

0 Kudos
Message 3 of 11
(2,210 Views)

@gennaro95 wrote:

Yes, I read the explanation of the error, but I don't understand why it happens. Is it possible that I'm wrong in the way I send the message?


Yes, if the client does not understand the message it can close the connection. Best tool you can use in this case is wireshark: https://www.wireshark.org/

 

If you get in a habit of using it, you will have less stress in your life when it comes to debugging TCP/IP stuff.

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 4 of 11
(2,187 Views)

In the example VI you post, the string you are sending is wrong.  If you want to send raw data like in the example, you need to change the format of the string to "hex":

 

Kyle97330_0-1703005947629.png

 

If you do that now, you can see what you are actually sending is this:

 

Kyle97330_1-1703005980302.png

 

Also, don't add the end of line after the string.  

 

You might have better luck using a premade toolkit for Modbus with LabVIEW.  There's something like 3 different ones out there to try if you search a bit.  Those toolkits will nearly all the work in assembling the data to send to the target properly.

Message 5 of 11
(2,175 Views)

The default port setting is shown as 8000 yet you have it set as 5900.  Is that correct?

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 6 of 11
(2,131 Views)

Hi Kyle, thanks for your help. I changed to Hex display and sent the message correctly. The only thing I noticed is that it now gives me a timeout error, even though it gives me an exit string. The problem is that the temperature value in the string is always 0, while on the chamber I read 24.85.

 

gennaro95_0-1703061481494.png

 

 

I also made another VI with modbus libraries, but the result is strange. Writing and reading in the registers, I read the same values. I attach the 2 modified VIs and the related images.

 

gennaro95_1-1703061536883.png

 

Thanks for your support.

 

Download All
0 Kudos
Message 7 of 11
(2,104 Views)
Solution
Accepted by javixl1

Hi Minions, 

 

In the VI I sent I forgot to change the port number, but everything I wrote was done with the port number 8000.

 

Thanks!

 

0 Kudos
Message 8 of 11
(2,102 Views)
Solution
Accepted by javixl1

Normally this error is when saturate the communication port, Slave/Master can close the communication if it have a lot data. due to size limitations of the Modbus protocol data unit. In this case you should separate the data array in portions to send it. EX: In Write Multiple Coils VI a maximum of 1,968 coils can be written at once.

0 Kudos
Message 9 of 11
(2,039 Views)

Hi Gennaro,

 

I have the same problem with another type of a climatic chamber but I couldn't open your VI because you are using a higher version of LabVIEW, can you please share your VI with 2020 version.

 

Thank you

Best Regards,
Applications Engineer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
CLAD // CLD
0 Kudos
Message 10 of 11
(1,452 Views)