ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#22470 - 04/17/11 04:49 PM Code Snippet for Adnet poll
Cristian Adamo Offline

Registered: 01/21/03
Posts: 32
Loc: Buenos Aires, Argentina
Hi there.

I am trying to figure out why it is taking so long for y RLY8 to turn on/off a relay when a dry contact in my SECU16i happens (which is connected to a PIR). It can take up to 6 seconds from the time the PIR goes off to the time the light goes on.

I have written a code that enables me to know how many times per second the program in my ocelot loops (3 times-per-second), so I know that that is not the problem.

Is there any way I can write a piece of code that would enable me to know how often the ocelot is polling the secu16i?

Initially, I had no problems but as I extended the network (is now about 100m) and added more modules (21 in total) I've seen a significant drop in response time.

From other polls, I know that timing related problems are usually caused by bad bus connections and I've made sure connections are as solid as they can be with 21 modules.

I just want to know if there is a way that I can know when and how often the ocelot is communicating with modules, and if there are any connection problems that are lowering my response times.

As always, your invaluable help is always appreciated!!


#22471 - 04/18/11 09:06 AM Re: Code Snippet for Adnet poll [Re: Cristian Adamo]
ADI Tech Support Moderator Offline
old hand

Registered: 12/22/02
Posts: 723
Loc: Branson West, MO
The Ocelot communicates at 9600 baud and polls one module at a time. The more modules you add, the longer it will take for the modules to respond. For 21 modules, could take up to three seconds to respond as it polls. Six seconds is kind of long though.

You may need to terminate the bus. Place a 150 ohm resistor on the last module between comms A and B.

Kevin Barrett
ADI Tech Support

#22472 - 04/18/11 05:02 PM Re: Code Snippet for Adnet poll [Re: ADI Tech Support]
Cristian Adamo Offline

Registered: 01/21/03
Posts: 32
Loc: Buenos Aires, Argentina
thank you kevin!

I already did that from the beginning (terminating the bus).

I've lowered param 8 in my ocelot from 15 to 4 and things got much smoother (COM light is also more steadily active), so I guess I am having a bus problem somewhere. Respose time is now about 3 seconds or less.

All posts I found about this topic mention that if problems are fixed with this, it means I have a COM problem.

Re-doing the wiring is out of question at this time. I've spent hours searching the forums and while there is a lot of info about fixing problems with module communication, I could not find one comprehensive, practical and reasonable guide on how to solve/debug communication problems. Most are try-and-see solutions.

How can I know which module(s) are the one(s) causing the problem? If the problem is wiring, how should I go about figuring out which segment of the adnet is causing the problem?

Most responses to this topic are try-and-try but I am trying to think how can I systematically narrow down the problem without going around my entire house and disconnecting one module at a time, a process which I think might take extremely long and stress the family as I turn off segments of the house's electricity.

For example, is there any max resistance I should have from start to end of the adnet bus (in terms of ohms). If resistance (read: connections) are OK, wouldn't that mean that cabling is not the problem (because there is good contact between all cable segments).

Any help on how to go about this step-by-step until I can find the responsible module(s) would be greatly appreciated.

Thank you,


#22473 - 04/18/11 06:28 PM Re: Code Snippet for Adnet poll [Re: Cristian Adamo]
Guy Lavoie Administrator Offline
Beyond All Hope

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
If your comms LED is blinking at a brisk pace (like 5 or 6 flashes per second) with the odd 1 second pause every 10 seconds or so, then it is operating normally. If you have 21 modules and you're getting a 3 second average response time, I figure that you're already doing pretty good!

If it is less steady then that, you might want to try a few things to identify any problem spot. The best approach would probably be to try disconnecting the bus at the halfway point between the Ocelot and the last module, and put the terminator resistor there. See if the comms flash pattern improves somehow or if it stays the same.

One potential problem with disconnecting modules for test purposes is if you have any instructions in your C-Max program that is looking for the analog value of a SECU16/16I input or tracking slave variables in a slave controller: if that module is now disconnected then the bus routine will pause and eventually time out from the non-response. If that is the case then you could load in a blank program (with just an "End of Program" statement) for the purpose of testing this.
"If you don't know what you're doing, do it neatly..."

#22476 - 04/22/11 01:22 PM Re: Code Snippet for Adnet poll [Re: Guy Lavoie]
Cristian Adamo Offline

Registered: 01/21/03
Posts: 32
Loc: Buenos Aires, Argentina
Thank you guy.

None of my program lines request analog values or slave variables. I have some BOBCATs but even those are mapped to variables and what I do is read the variables, not the module's data.

The 3 seconds response time I got after changing parameter 8 in my ocelot from 15 to 4. My problem is that I've read all over the forum that while this is a valid "solution", it does not solve the underlying problem, which is what I would like to do.

I've created a counter variable that checks for IO Errors but after 2 days none occurred, so I guess I will leave this at this and assume that whatever the problem is might not be worth my time figuring out.


Page 1 of 1 1

Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 65 anonymous users online.
Recent Posts
Secu16 inputs not working correctly
by ADI Tech Support
10/03/17 06:01 AM
Ocelot Battery
by ADI Tech Support
09/22/17 07:38 AM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4003 Topics
23440 Posts

Max Online: 132 @ 11/13/16 10:07 AM
Su M Tu W Th F Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31