Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Slave server stop functions if have request frame with address 0 (broadca

Solved!
Go to solution
Modbus Slave server stop functions if have request frame with address 0 (broadcast massage)
0 Kudos
Message 1 of 12
(5,452 Views)
Solution
Accepted by topic author alexart

Hi alexart,

 

How are you setting the address to 0? When I set my Modbus Slave server address to 0 in the communication settings, it defaults to 1, so I am not able to change the address to 0.

 

Also, is the server not functioning? What is happening and how do you know? Is there an error code, or what else is happening?

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 2 of 12
(5,441 Views)
I have multipoint serial network with Modbus protocol. I put CompactRio to this network like Modbus Slave (serial port). I use request with address zero for write multiregisters cod 16 for send information to all PLCs. Past it CompactRio stay dummy.
0 Kudos
Message 3 of 12
(5,424 Views)

Hi alexart,

 

Are you using the ModBus Library to do this, or are you using the DSC Module? It would help to know what you are using to set this system up to be able to help you further.

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 4 of 12
(5,399 Views)

Hello,Stephan!!

 

I go simplest way. I write program for Compact RIO in Scan mode work and use shared variables wich mapped to Modbus Slave(any address for examle 1). Then I put CompactRIO in multipoint serial network where is broadcast modbus request ( which have address 0) possible. Stop modbus communication with CompactRio after it guarantee.

I seek this bug to generate broadcast modbus request specially from PC connected to Com port CompactRio. I understand drop brroadcast request, but I don't understand stop communication after it. It is possible we have same request after logical or communication error.

 For information,  no reply for broadcast request, but request  erxecution. Then  broadast request for read. operation senseless may be.

With regards,

Alexander Artyomenko.

0 Kudos
Message 5 of 12
(5,385 Views)

Hi alexart,

 

I am having a hard time understanding how your system is set up and what is happening when this problem occurs. What is your Modbus master? How are the slaves and master connected to each other?

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 6 of 12
(5,360 Views)

Hello, Stephen_S!

 

It is possible to simulate situation. Run Modbus slave serial on cRio with address 17.

Connect cRio to PC by cross serial cable.

If you send from COM-port PC string in hex 11 03 00 00 00 01 86 9A, you can receive reply like this  11 03 02 00 00 79 87.

Past it send string 00 10 00 00 00 01 02 00 00 AB C0.

Now If you send  any request, for examle same llike first request ( 11 03 00 00 00 01 86 9A) you have'nt any reply.

0 Kudos
Message 7 of 12
(5,324 Views)

Hi alexart,

 

Could you post a screenshot of the code you are using to do this? Or if not a screenshot, post the VI that you are using so that I can see how you are doing this

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 8 of 12
(5,289 Views)

Hello Stephen.

You can use attached VI to generate massage in hex and send it to Com port on PC and read bytes too. from it

I set breakpoint  for read operation to do it step by step.

I put first request in write string for look You have answer from cRio with Modbus Slave. If it work, put in write string broadcast request and you haven't to have any answer.

If You put first string again You can't see any answer - it is problem!

Be sure You have same port setting for Com ports on PC and cRio. Address for Modbus Slave is 17.

 

With best regards,

Alexander Artyomenko. 

0 Kudos
Message 9 of 12
(5,185 Views)

Hi alexart,

 

It looks like you are using the Basic 2 Port Serial Write and Read example, and you have modified it for a single port. If you want to do this, there is a Basic Serial Write and Read example program that I would suggest using instead to see if it solves your problem.

 

This example is in the same folder, under Help>>Find Examples...>>Hardware Input and Output>>Serial>>Basic Serial Write and Read.

 

Regards,

Stephen S.
National Instruments
Applications Engineering
0 Kudos
Message 10 of 12
(5,162 Views)