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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication ModBus TCPIP Error 6004

Solved!
Go to solution

I'm getting error 6004 Modbus Exception code: 4.

I'm trying to connect to  a Beckhoff BK9050 with 16 output KL2809 and 16 inputs KL1809.

I used a VI from the Modbus library (MB Ethernet Example Master.vi).

When I start, everything seems to work. I can control the outputs and I can read the inputs in my program.

But when I stop the program and start it again, then the error 6004 exception code 4 arrives when I will control an output. What can cause this problem?

Thanks in advance for the support.

0 Kudos
Message 1 of 7
(4,617 Views)

I'm getting error 6004 Modbus Exception code: 4.

I'm trying to connect to  a Beckhoff BK9050 with 16 output KL2809 and 16 inputs KL1809.

I used a VI from the Modbus library (MB Ethernet Example Master.vi).

When I start, everything seems to work. I can control the outputs and I can read the inputs in my program.

But when I stop the program and start it again, then the error 6004 exception code 4 arrives when I will control an output. What can cause this problem?

Thanks in advance for the support.

0 Kudos
Message 2 of 7
(4,618 Views)

Modbus exception 4 is an error within the slave device.  It couldn't do what it was asked so it is responding back with that message.

 

It is not a problem with your LabVIEW code, but a problem with the slave device.

 

You'll need to contact Beckhoff for help on that.

0 Kudos
Message 3 of 7
(4,580 Views)
Solution
Accepted by topic author Willem1978

Thanks for your reply.

I have solved the problem.

The problem was that the Beckhoff module had a Watchdog error when I stopped my VI.

Now I reset the Watchdog Timer just before I close the VI by transfering 0xBECF and 0xAFFE to register 0X1121.

I got it from http://forums.ni.com/t5/forums/v3_1/forumtopicpage/board-id/170/thread-id/518237/page/1.

 

Message 4 of 7
(4,577 Views)

Hello RavensFan,

 

I am trying to communicate with Oriental Motor using Modbus Protocol. But I am getting 6004 Error.

Is it because I am sending the command Incorrect?

 

 

Thanks & Regards,
Bharath Kumar
GCentral
0 Kudos
Message 5 of 7
(3,306 Views)

All we can see is your front panel.

 

But one thing I see is that you have "Write Single Register" but the quantity to write is set to 2.

Message 6 of 7
(3,300 Views)

Hello RavensFan,

 

Thanks for the reply. Sorry I did not attach the VI. I am trying to drive Rksd507-cd Driver from Oriental motor by modbus. Learning modbus. and looking for more examples. Any library will be helpful.(Oriental motor with LabVIEW is so hard):smileymad:

 

any link to modbus example will be helpful(Communicating with adam4561 serial converter).

 

 

Thanks & Regards,
Bharath Kumar
GCentral
0 Kudos
Message 7 of 7
(3,291 Views)