Home AMX User Forum NetLinx Studio

How fast can I trigger stuff to happen simultaneously?

Im tasked with speeding up the "startup" process on a system. This process includes reading a configuration from a text file, populating the appropriate structures with that info, setting up com ports based on the config, drawing the appropriate graphics on up to four touch panels based on the config, etc. There is a lot going on at startup. In the existing code, there is a timeline that is triggering these events, with time in between to space it out. In fact, the timeline triggers other timelines that carry out each process.

Everything works great now, they just want it to be faster, I just have no concept of how fast these events can be triggered and if there would be any negative to taking out all the space in between triggering functions.

For example, instead of--
case 1: someFunction
case 20: readFileFunction
case 70: readAnotherFilefunction

I want---
case 1: someFunction
case 2: readFileFunction
case 3: readAnotherFilefunction

I have tried it the way I want and nothing caught on fire, all info seemed to populate as expected and I was able to reduce the startup time by half. I guess Im just looking for a best practices, "watch out for --", or "you can do this or that to check processor load during those events"...What would dictate how fast these things can happen? Is it memory? processor speed?

Any help is appreciated. Thanks in advance

Comments

  • a_riot42a_riot42 Posts: 1,624
    There is no built in speed limit that I am aware of. I see people put waits in between send_commands and have never understood this. The only time I use a wait is for an external device that can't keep up, but never for the controller itself.
    Paul
  • ericmedleyericmedley Posts: 4,177
    If it ain't broke, don't fix it...

    This is not meant as a snarky answer...

    There are a lot of things going on under the hood that we cannot know or predict due to our lack of said info. (internal AMX secret spy stuff NS all that...)

    I typically try to run stuff as fast as I can abd see if any parts fall off. If they do, I slow it down only after truly determining the root cause. For what it's worth I've never really seen an Internal programming thing outrun itself. Remember: it's a single threaded machine...

    Like a_riot opines, I find that I'm waiting on another device.
  • AuserAuser Posts: 506
    In large systems with ICSNet connected devices I frequently find a need to hold off much of the initial processing at boot time as it seems to cause the ICSNet connected devices to not come on line reliably. Aside from that I never generally need to delay processing.

    As an aside, this is the fundamental difference between AMX and Cr3stron control systems:

    - If you approach the processing limit of an NI it will slow down while chewing through what it needs to do.
    - If you approach the processing limit of a Cr3stron 2 series it will spontaneously reboot.

    In a processor intensive Cr3stron program you frequently need to delay operations to make sure you don't push the control system too hard.
  • Questioning the premise

    Another thing to consider is why you need to keep restarting your system!

    Even if you have new config parameters (hourly/daily/etc), Perhaps you could just reinitialize certain aspects of the system with some event without restarting everything.
  • ericmedleyericmedley Posts: 4,177
    Another thing to consider is why you need to keep restarting your system!

    Even if you have new config parameters (hourly/daily/etc), Perhaps you could just reinitialize certain aspects of the system with some event without restarting everything.

    While this is true and something I've done for a long while now, it's kinda wide of the discussion at hard. The system will need to be rebooted at some point and the OP was asking for info on how to speed up reboot.
Sign In or Register to comment.