From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Modbus libary to connect to Yaskawa G7 drive - framing error

We're using Labview trying to communicate with a G7 drive via a third-party USB-RS485 device. The communication is OK using Yaskawa DriveWizard software (we can read/change the parameters), and we just want to do further functions by using Labview Modbus library. I assume the communication is fine since their software works.

 

But when I use modbus library, I get the "Framing error" all the time. I checked the port settings (Baud rate, #of bits, Parity, Stop bits, mode, slave address etc) and they are consistent on both sides.

 

Anybody here ever met such a problem? Any suggestion will be appreciated!

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

I use the LV Modbus lib all the time to talk to Yaskawa F7 and P7 drives.  Never had a problem.  Can you post a simple example of your code?

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

 

A framing error is a serial interface problem.

If you are sure that all settings are OK there is probably something wrong with your RS-485 interface.

Can you check the connections and terminators ?

0 Kudos
Message 3 of 10
(4,442 Views)

Wayne,

 

Attached is the simple vi used for testing the communication. The stop bits was set to 1.0 inside the Init vi.

Is there any special settings I missed?

 

Thanks.


@Wayne.C wrote:

I use the LV Modbus lib all the time to talk to Yaskawa F7 and P7 drives.  Never had a problem.  Can you post a simple example of your code?


 

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

@K C wrote:

 

A framing error is a serial interface problem.

If you are sure that all settings are OK there is probably something wrong with your RS-485 interface.

Can you check the connections and terminators ?


KC,

 

The RS-485 interface should be fine. Wwe used the DriveWizard software... I assume the connection should be fine then.  

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

Well, I was not referring to the software. As far as I can see your framing error has nothing to do with ModBus. ModBus is a protocol. The ModBus data is tranfered over a serial link in your case with a RS-485 interface. This serial interface reports the framing error.

 

Framing error means that the bit sequence of startbit-databits-(parity)-stopbit(s) is not correct. Mostly caused by wrong parameters and/or bad interface.

 

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

Inhaler_jun,

 

Modbus spec states that when no parity is used, 'stop bits' should be set to 2.  This is actually an error in the LV modbus lib.  This is what is causing the framing error.  I never noticed this before because I don't use that particular function of the Modbus lib.

0 Kudos
Message 7 of 10
(4,419 Views)

@Wayne.C wrote:

Inhaler_jun,

 

Modbus spec states that when no parity is used, 'stop bits' should be set to 2.  This is actually an error in the LV modbus lib.  This is what is causing the framing error.  I never noticed this before because I don't use that particular function of the Modbus lib.


Wayne, the G7 manual states that "stop bits" is 1.

I will try it if I get chance to work on the machine.

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

Wayne,


@Wayne.C wrote:

Inhaler_jun,

 

Modbus spec states that when no parity is used, 'stop bits' should be set to 2.  This is actually an error in the LV modbus lib.  This is what is causing the framing error.  I never noticed this before because I don't use that particular function of the Modbus lib.


Finally I got another Yaskawa unit (another model though V1000, previously on G7) to test. I still have some issues. -- Is it possible you can share the code that initialize the communication? Appreciated for helping out.

 

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

Inhaler_jun,

 

I'm communicating using the following settings:

 

Mode = RTU

Baud = 9600 or 19200

Parity = Odd 

 

If you continue to have problems, I suggest you use an o-scope to look at actual data packets being transmitted to and from the drive.

 

 

 

0 Kudos
Message 10 of 10
(4,132 Views)