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 domotic

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



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

modbus domotic
PostPosted: Sat May 23, 2020 9:40 am     Reply with quote

hi all,
I have been trying to make a small modbus protocol with one master and several slaves to make a residential home domotic system. But the main issue is that I have to inquire each slave from time to time (around 100/150ms) to know if they have an new order...that is why I rather prefer to have a different approach, eventually and modbus ethernet (so that each slave could acknowledge directly the master, but I don't have the source code for that, is there any one that has it? By the way, is there any other option to accomplish that? I will have one master and around 20/25 slaves... (push buttons and/or outputs)...
Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Sat May 23, 2020 10:29 am     Reply with quote

That is Modbus TCP/IP. Drivers with the compiler.
How old is your compiler?. The basic modbus 'layer' has been with the
compiler for ages, but the TCP drivers needed were updated a while ago.

You would probably need to talk to CCS. There are a number of examples
for the ModBus TCP, that they can supply separately.

Be 'aware', this is quite a bulky/complex driver, compared to the standard
serial Modbus implementation, and you are going to be adding
Ethernet hardware to each board.
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Sat May 23, 2020 2:44 pm     Reply with quote

My compiler has several months... But somehow I don't have the tcp/ip drivers... But for my system I need somehow a solution similar to the tcp/ip modbus... The idea is to have communication only when is needed ( when you press a button for instance), to reduce at most the power consumption... It is not interesting (IMHO) to have domotic and spend a lot of energy to control the system...
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Sat May 23, 2020 2:49 pm     Reply with quote

Is there any other system/protocol to accomplish this?! The idea is to control my house spending the less energy possible... Just for record, I will use bistable relays..and optocoupler entrys...
temtronic



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

View user's profile Send private message

PostPosted: Sat May 23, 2020 4:17 pm     Reply with quote

There are several 'systems' that can be used, RS485 is a popular one. Which depends upon amount of data,'points' or slaves, and speed you require. Everyone has their 'favourite'. For a wired system, I still like what I used 30+ years ago, not fast at 24 baud but 99.999999% hackerproof AND can still communicate if a wire is cut or shorted.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 23, 2020 6:47 pm     Reply with quote

ralph79 wrote:

My compiler has several months... But somehow I don't have the tcp/ip drivers.

Look in the Drivers folder. There are several files. Here is one of them:
Quote:
\drivers\modbus_app_layer_tcpip.c 2/12/2015

What is you compiler version ?
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Sun May 24, 2020 4:51 am     Reply with quote

Hi temtronic,

When I thought in the "system" I think immediately in the modbus protocol (stable, with several nodes, good baud rates, etc) but when I come in the developing.. I somehow saw that is not good option (besides de tcp/ip module), it is not good programming inquire each 50ms all the 40/60 slaves checking if a push button was pressed... A and according to that send the data to the other 20/30 slaves for toggling one output... It's a spending a lot of energy for nothing... So i rather prefer to use a system that could trigger directly the master when it is needed... The bau rate I would like to use is something thing like 9600bps...
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Sun May 24, 2020 5:10 am     Reply with quote

hi PCM,
I have two versions (5.089) for the newer chips, and an ancient one: 4.140...in the recent one I have the following files:
Quote:
modbus_app_layer_tcpip
modbus_phy_layer_tcpip
(both from 12/05/2015)
but i can't find any basic example of it .. I don't like a lot the version 5.089 because I had several problems with some chips (and you all the guys (Ttelmah, temtronic and also allenhuffman here helped me (a lot), finding the problem).. so when is possible I try to use the ancient one..
Is there any basic example of how to use correctly the tcp / ip library?
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Sun May 24, 2020 7:27 am     Reply with quote

As I said, you have to ask CCS for the examples. They do supply them with
one of their development kits, but have been friendly in the past and
let other users have them.
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Mon May 25, 2020 11:30 am     Reply with quote

Hi Ttelmah,
I have asked for the examples to CCS, untill now, I didn't receive any info.. I will wait a couple of more hours/days...
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Mon May 25, 2020 5:44 pm     Reply with quote

ralph79 wrote:
Hi Ttelmah,
I have asked for the examples to CCS, untill now, I didn't receive any info.. I will wait a couple of more hours/days...


Today is a holiday in the US. You should get a response later this week.
ralph79



Joined: 29 Aug 2007
Posts: 87

View user's profile Send private message

PostPosted: Wed May 27, 2020 11:26 am     Reply with quote

Hi newguy,
In fact I have received the feedback from CCS yesterday. Thanks in advance.
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