01-19-2021 08:37 PM
Hi everyone, I am trying to comunicate with a VFD (D700 mitsubishi) by modbus rtu protocol using labview 2020.
I have already done some examples like these : https://www.youtube.com/watch?v=m1TB9twXYaA&t=442s
but it didn't work. I thought it was that I need to wait a time to receive the answer from the VFD, so I tried with a VI library called 'KELLER' but It didn't work, I think that keller is no compatible with labview 2020.
I already set the VFD with the parameters to be have to communicate by modbus protocol.
I read some posts on the community but I couldn't get a solution.
Here I added two examples of what I am trying to do.
Any help or suggestion is welcome
Solved! Go to Solution.
01-19-2021 09:43 PM
Your attachments are missing.
01-20-2021 12:23 AM
Sorry, here they are!
01-20-2021 01:52 AM
Hi,
Couple of reasons why it is not working:
Kees
01-20-2021 03:47 AM
And in my experience, the most notorious problem is hex / decimal representation of numbers.
Register Adresses are usually, (but not always!!!) given in hex, and controls and constants are shown in decimal by default in LV.
So, first try: Change representation of controls/constants to hex, and try again.
Anyway: I also recommend to try an other modbus tool. Maybe, the supplier has a specific tool for this device, but since Modbus is a standard, there are 3rd party tools available. I've used "CAS Modbus Scanner" a while ago.
01-20-2021 09:46 AM
When I stop it using the control of the while loop...I get this error
Thank you
01-20-2021 09:56 AM
Put an error indicator on the error wire inside the while loop.
Get rid of the shift registers on that error wire.
Error 56 is a timeout error. Basically the device didn't respond in time. But what is strange is that you created a serial master, and I associate an error of 56 with TCP/IP communications.
Something else weird I see. When I hover over the Create Serial Master, I see an extra input on the left called Device Data Model. A cluster with a single boolean of Initialized. I've never seen that before. I clicked on the polymorphic selector and see it is set for Automatic. Go down and explicitly select New Serial Master. The extra input goes away.
Try running it again.
And look into Kees's comment about the slave address and verify that 17 is actually what your device is set for.
01-20-2021 10:19 AM
Yeah, ID = 1 is normally set, but I was trying the same example that the manual has, just to verify that the values are the same!
I change the pins on my usb-rs485 module and it worked!!!! It seems that was the problem, but I don't get why if in the 2 wire echo connection rec+ and send+ are connected to the A+ , and rec- send- to B- .
But well boys, it is working! Thank you so much for your help!
01-21-2021 01:51 AM
'A two wire Echo connection' ??
With a RS-232 interface has a transmit and a receive. It is obvious that the transmit cannot be connected to the transmit. A Cross cable is used.
With RS-485 a differential line is used. Both sides (there can be more than two) are bi-directional. A differential line is the same for each connected device. SO the + is connected to the + and the - to the -
Because of this used differential line the maximum distance is higher than the distance wit a RS-232 interface.
If you use long lines (> 10-100 meter, also depends on the speed) you also should use proper terminate resistors and the 0V connection.
Kees
01-21-2021 09:46 AM - edited 01-21-2021 09:49 AM
@K C wrote:
'A two wire Echo connection' ??
With a RS-232 interface has a transmit and a receive. It is obvious that the transmit cannot be connected to the transmit. A Cross cable is used.
With RS-485 a differential line is used. Both sides (there can be more than two) are bi-directional. A differential line is the same for each connected device. SO the + is connected to the + and the - to the -
Because of this used differential line the maximum distance is higher than the distance wit a RS-232 interface.
If you use long lines (> 10-100 meter, also depends on the speed) you also should use proper terminate resistors and the 0V connection.
Kees
It is because he has a 2-wire connection. The same wires are used for transmitting and receiving. Only one device can talk at a time. With 2-wire, the transmit and receive buffers in each device are wired together. So if device starts talking on the wires, device B will receive it at both the transmit and receive pins. Device A will also receive it at its receive pins. So device A will wind up getting an echo of the message is just sent.
The RS-485 ports have means of ignoring the message back to itself, or doing some sort of tri-state on the transmit and/or receive pins so they don't have intefere with the communications.
If this was 4-wire RS-485, the transmit and receive pins on each end would be distinct and only connected to the transmit and receive buffers in each device's serial port. They would not be tied together internally. And of course transmit pins would connect to receive on the other device, and vice versa. And of course polarity always matters.
It all comes down to reading the manual for the serial port to know how to wire it and setting any dips switches or jumpers, or software driver configuration settings, as needed to make it work.