Linux has great i2c bus support, I have made i2c adapter and client (i2c
device drivers), they are only a page or so of code. This is a two wire
protocol. They are great for non-realtime sensors or controls.

-----Original Message-----
From: Stephen Wille Padnos [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 01, 2008 12:10 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Additional I/O Modbus card.

Kirk Wallace wrote:

>On Fri, 2007-12-28 at 18:33 -0500, Dave Keeton wrote:
>  
>
>>How did you get it to work with EMC2.2.2?
>>    
>>
>I may be wrong, and you should wait for Peter to get back from
>walk-about, for a reply, but I suspect he hasn't. I think that he is
>offering options to people seeking Modbus hardware. Using Modbus with
>EMC is another issue.
>
>There have been rumors that Modbus is available with EMC, but for me,
>finding any information on it, is like finding hen's teeth.
>
I have written a user-space modbus-based driver that exports HAL pins.  
I haven't checked it in because (1) it's written to talk to a PLC with 
proprietary register mapping and (2) is constructed such that you would 
need a separate driver for each device you wanted to communicate with 
(and they couldn't share a serial port ...).

If we can come up with a good way of implementing a reasonably generic 
modbus driver, then I can change mine or rewrite it to conform to 
whatever scheme we come up with.  The trouble I've had is that modbus is

quite generic.  There are (at least) two classes of data - registers and

coils.  You can read and write either, and you can read or write groups 
of either type with a single command.  You can't read and write with the

same command, and you can't read coils and registers with the same 
command either.  So a relatively simple I/O device with a couple of AD, 
DA, and relays and digital inputs, would require 4 serial commands for a

full read/write update.  Each command is a minimum of 9 or 11 bytes (I 
don't recall which), and the responses are the same minimum size.  As 
you can see, this gets outside the realm of realtime pretty quickly.  
Additionally, it's non-trivial to (a) describe the register mapping of a

device and (b) combine reads and writes to make communications
efficient.

The other option (vs. a generic driver) is to use the paradigm I've 
already used, and make a separate driver for each modbus-connected 
device.  Ideally, these would all use the same modbus library (which I 
already borrowed for the task, though it needs a little bit of work).



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to