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.c and ex_modbus_slave.c problem

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








modbus.c and ex_modbus_slave.c problem
PostPosted: Mon Jan 28, 2008 11:17 am     Reply with quote

When I try to compile the example (ex_modbus_slave.c) I get an error on line 193 (Unidentified identifier setup_uart). I've been working on it for awhile and still can't seem to find what is going on. If anyone could shed some light onto this it would be greatly appreciated.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 28, 2008 11:41 am     Reply with quote

The setup_uart() function only works with a hardware UART. If you
have the #use rs232() statement setup for a software UART, then you
will get that error message.

I did a text search for "setup_uart" for all files in the Drivers and
Examples directories, and I didn't find it in the modbus source files.
It's only in the files listed below. This is with PCM & PCH vs. 4.066:
Quote:
c:\program files\picc\examples\ex_linbus_master.c
c:\program files\picc\drivers\rs485.c
c:\program files\picc\drivers\linbus.h
Guest








PostPosted: Mon Jan 28, 2008 12:01 pm     Reply with quote

It appears that the modbus files for v4.050 are different then. It is also missing modbus_kbhit() as well. Shoddy QA from CCS again.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 28, 2008 12:20 pm     Reply with quote

I did a file compare on the four Modbus files, and the only one that's
different between vs. 4.050 and 4.066 is Modbus.c

This is the new one, from vs. 4.066:
Quote:

c:\program files\picc\drivers\modbus.c 60,622 bytes 7-13-07


This is the old one, from vs. 4.050:
Quote:

c:\program files\picc\drivers\modbus.c 43,405 bytes 8-23-06

You could email CCS support. If you bought the compiler in the past
and have a customer Reference number, then email that information
to them and ask if they will send you the latest Modbus.c file.
Guest








PostPosted: Mon Jan 28, 2008 12:38 pm     Reply with quote

I figured out what they did at CCS. I do have the modbus driver but it's not the one in the drivers directory. What they did was call it "ex_modbus.c" in the examples directory. I copied it over the modbus.c file in the drivers directory and all is well now. CCS needs to have some kind of errata section on their site to keep track of these problems as it would save everyone a huge amount of time in tracking this stuff down especially since no one was there to answer my call on the tech support line today.
rfreddy



Joined: 03 Jun 2007
Posts: 7

View user's profile Send private message

Problem with 18f452
PostPosted: Thu Mar 13, 2008 5:30 pm     Reply with quote

Hi, I changed modbus.c for ex_modbus.c and I have this example running correctly for 2 16f877 as master and slave.

Now I tried to port slave's code to a 18f452 and my master now gets only exceptions, it seems to be that there is no data sent or received from the slave.

Does anybody have a running slave for this kind of pic or anybody could point me if I'm doing something wrong?

Thanks in advance,

Freddy
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