View previous topic :: View next topic |
Author |
Message |
anjali
Joined: 22 May 2012 Posts: 9
|
Modbus RTU program |
Posted: Fri Jun 22, 2012 3:55 am |
|
|
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
|
|
Posted: Fri Jun 22, 2012 6:25 am |
|
|
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
|
|
Posted: Fri Jun 22, 2012 7:16 am |
|
|
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
|
|
Posted: Fri Jun 22, 2012 7:26 am |
|
|
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
|
|
Posted: Fri Jun 22, 2012 7:50 am |
|
|
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
|
|
Posted: Fri Jun 22, 2012 3:57 pm |
|
|
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
|
|
Posted: Sat Jun 23, 2012 12:36 am |
|
|
Thanks a lot for both...!!!! it worked correctly : :)
as you said it was just a mistake of "s"...
Thanks once again:) |
|
|
|