CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ModBus RS485

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
monttec



Joined: 30 Mar 2009
Posts: 5
Location: São Paulo, Brasil

View user's profile Send private message

ModBus RS485
PostPosted: Mon Mar 30, 2009 7:53 am     Reply with quote

Bom dia, Srs.

Estou estudando a estrutura do protocolo ModBus, com o driver e exemplos que vem com o kit PCWH, porém, nos testes, ocorre um fato interessante mas ainda não conseguir descobrir o porque.

Quando utilizado somente os pinos RX/TX “ PIN_B0 e PIN_B1” na comunicação, as respostas transmitida pelo slave vem com as quantidades de bytes solicitado pelo master no caso “8” “isso no exemplo do programa” , quando habilito para comunicação Rs485 e utilizando MAX487 . O slave manda 1 byte a mais no final da transmissão.

Porque, isso só ocorre na comunicação Rs485 ?
Tem como desabilitar esse último byte ?

Exemplo:

Master – RS232
Holding Registers
DATA: 00 88 00 77 00 66 00 55 00 44 00 33 00 22 00 11 OK

Master – RS485
Holding Registers
DATA: 00 88 00 77 00 66 00 55 00 44 00 33 00 22 00 11 60 {60) ?????
-------------------------------------------------------------------------------------

Good morning, Mr.

I am studying the structure of the Modbus protocol, with the driver and examples that comes with the kit PCWH, However, in tests, an interesting fact but still can not figure out why.

Used only when the pin RX / TX "PIN_B0 and PIN_B1" in communication, the answers supplied by the slave chips with the quantity of bytes requested by the master in "8" in this example the "where to enable communication using RS485 and MAX487. The slave sends 1 byte more
at the end of transmission.

Because it only occurs in RS485 communication?
Is to disable the last byte?

Example:

Master – RS232
Holding Registers
DATA: 00 88 00 77 00 66 00 55 00 44 00 33 00 22 00 11 OK

Master – RS485
Holding Registers
DATA: 00 88 00 77 00 66 00 55 00 44 00 33 00 22 00 11 60 {60) ?????

thanks.

Att. Márcio Medeiros
yerpa



Joined: 19 Feb 2004
Posts: 58
Location: Wisconsin

View user's profile Send private message Visit poster's website

PostPosted: Tue Mar 31, 2009 3:55 pm     Reply with quote

The RS-485 pins might float after last byte, sometimes a garbage byte can be caused by floating data lines.
hugo_br



Joined: 01 Aug 2011
Posts: 26
Location: BRAZIL

View user's profile Send private message Visit poster's website

PostPosted: Thu Aug 15, 2013 7:24 pm     Reply with quote

Estou tentando utilizar um PIC16F1938 para fazer comunicação RS485 por modbus com inversores. Comecei utilizando o exemplo da CCS, porem não compila a rotina. Vc tem alguma dia para ajudar?

Desde de já agradeço.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group