Re: [Emc-developers] Multiple instances of user mode modules

2011-04-24 Thread Les Newell
Well, it turns out that pthreads are dead easy to use. I now have a fully working Modbus component that can access any number of devices on any number of serial or Ethernet channels. It works much faster than ClassicLadder's Modbus implementation with a tiny fraction of the CPU load. It is

[Emc-developers] Multiple instances of user mode modules

2011-04-22 Thread Les Newell
Is it acceptable to load multiple instances of user space HAL modules? e.g: loadusr mymodule name=copy1 loadusr mymodule name=copy2 The other alternative is to make my module multi-threaded so I only need one instance: loadusr mymodule names=copy1,copy2 The would have to be multi-threaded as it

Re: [Emc-developers] Multiple instances of user mode modules

2011-04-22 Thread Jeff Epler
You want 'mymodule' to use a different name to hal_init for each distinct instance. Furthermore, you want to use that component name in the loadusr command, so that processing of hal commands doesn't continue until the component has created all its pins. Assuming that you want to use the

Re: [Emc-developers] Multiple instances of user mode modules

2011-04-22 Thread Les Newell
Hi Jeff, loadusr -Wn copy1 mymodule name1=copy1 loadusr -Wn copy2 mymodule name2=copy2 Hmm, that is starting to look a little ugly and doesn't really fit in with the way most modules are loaded. Perhaps I would be better off keeping it all in one multi-threaded module. I'll have a