Haberler Michael wrote: >Hi > >I have two VFD's (a pDrive MX eco and a Toshiba VF-S11) both of which >are Modbus-capable and I'd like to integrate into Emc. I've read the >GS2 VFD driver, and adapting this good example would be an option. It >seems Modbus integration comes up frequently though. > > Yep, frequently enough :)
>I'd be curious what people think about a generic userspace hal >component to deal with different Modbus devices (without going through >ClassicLadder), and what would be good design choices to map Modbus >read/write commands to signals and parameters in a generic fashion. > > A generic modbus component would be excellent, but it is a bit of a complex beast. We have had discussions about using an XML-like language (similar to pyvcp) to describe the variables that a particular modbus device represents. >On an abstract level, I'd see a parameter being mapped to one or >several register writes, possibly with some arithmetic and boolean >expressions applied; on the input side: certain registers or 'coils' >being read, fed through expressions and resulting in signals. A >generic, configurable python component might be an option. > > I'm not sure I'd go so far as to do any boolean math, unless you're talking about taking a couple of bits and turning them into a number. I think the only expression support that shold be needed is combining registers to form longer words (ie, two 16-bit registers are treated as the high and low parts of a 32-bit value). >Is it worth the effort? or should I just go ahead and adapt the gs2 >driver for each component? > > It's almost assuredly easier to adapt the gs2 driver to your VFD. If you're willing to put in the effort, I'd love to see a generic modbus component though. Here are some of the things that I'd like to see in a generic driver (of course, any subset would be a fine starting point): support for multiple serial ports (this could be done by making a single component that can change its name, and loading multiple instances of it) support for multiple devices on the same serial port support for (at least) the following data types: bit, bitfield (possibly offset within a register), byte, short (16 bits=1 register), long (32 bits), packed bits. The three number formats should have scaling and offsets available, for conversion to/from floats. the ability to set a scan rate (ideally for each variable, but each device or each port is also good) the ability to name quantities, like the way you can name things in pyvcp the ability to have range limits for numeric quantities (ie, min and max parameters for "analog" values) Like I said, there's a lot to a generic interface. Any help you'd like to provide would be greatly appreciated. - Steve ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users