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 CCS Technical Support

Modbus RTU program

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



Joined: 22 May 2012
Posts: 9

View user's profile Send private message

Modbus RTU program
PostPosted: Fri Jun 22, 2012 3:55 am     Reply with quote

Hello..


I am doing project on modbus using pic c compiler, but am getting error for the inbuilt functions like:use parameter value is out of range "error" , undefinied identifier kbhit ...

But if i remove the error in the given statement below the complier is not giving any error.. I want to know what is the function of the "error" here..
Is it ok if i dont use "error"?

#use rs232(baud=MODBUS_SERIAL_BAUD, UART1, parity=N, stream=MODBUS_SERIAL,error)

looking forward to the reply....
jeremiah



Joined: 20 Jul 2010
Posts: 1353

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 6:25 am     Reply with quote

you didn't spell it correctly. It is "errors"...notice the "s".

The purpose of it is to keep your hardware from locking up. Leaving it out will cause your UART to lockup eventually.
anjali



Joined: 22 May 2012
Posts: 9

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 7:16 am     Reply with quote

Oh okay... is it an that essential? because am using modbus poll to check the transfering of data, but when i click the connect option of modbus poll software its giving timeout error... why do time out error occurs? is including "errors" must??

waiting for the reply...!
jeremiah



Joined: 20 Jul 2010
Posts: 1353

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 7:26 am     Reply with quote

I know little of modbus. ERRORS is a general UART option, not specific to modbus. If the UART encounters a particular hardware error, it will stop receiving if I understand it correctly. Using ERRORS makes the compiler add code that clears those hardware errors and allows the UART to work correctly again. Leaving it out means that if those errors occur your UART connection will no longer function correctly.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 7:50 am     Reply with quote

Yes, you absolutely should use errors. But there may be other problems in your MODBUS application in addition.
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 3:57 pm     Reply with quote

You might be getting the 'timeout' error due to the UART being 'locked up' or 'jammed' since you don't have the 'errors' option.
I'm not a MODBUS guy but do know you must have 'errors' in the uses rs232(....) line.
anjali



Joined: 22 May 2012
Posts: 9

View user's profile Send private message

PostPosted: Sat Jun 23, 2012 12:36 am     Reply with quote

Thanks a lot for both...!!!! it worked correctly : :)
as you said it was just a mistake of "s"...


Thanks once again:)
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