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 working great with my Modbus front panel with 55 inputs
(buttons), 55 coils(LEDs) and 4 registers(pots). I'll post the code and
docs here once I have tested it a bit more and done a bit of tidying up.
Due to the number of possible settings it uses a config file instead of
command line arguments. The config can either be a standalone file or
part of the main ini file.
Les
On 22/04/11 15:54, Les Newell wrote:
> 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 look and see
> how difficult Linux threads are...
>
>> int main(int argc, char **argv) {
>> char *name = "mymodule"
>> ... parse argv and find any name= and point the variable 'name' at it
>> ..
>> comp_id = hal_init(name);
>> ...
>> }
> Yes, I already do command line parsing in my single-threaded version of
> the module.
>
> Thanks,
> Les
------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers