12-19-2023 08:21 AM
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
Solved! Go to Solution.
12-19-2023 10:00 AM
@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
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).
12-19-2023 10:07 AM
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?
12-19-2023 10:44 AM
@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.
12-19-2023 11:15 AM
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":
If you do that now, you can see what you are actually sending is this:
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.
12-19-2023 02:05 PM
The default port setting is shown as 8000 yet you have it set as 5900. Is that correct?
12-20-2023 02:39 AM
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.
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.
Thanks for your support.
12-20-2023 02:41 AM
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!
12-20-2023 09:33 AM
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.
04-14-2024 12:32 AM
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