Re: [Emc-users] SJ200 VFD and Modbus
Am 04.02.2012 um 00:30 schrieb Frank Tkalcevic: >> I haven't considered a generic VFD or Modbus device driver, because not >> only do the device functions vary widely, but so do implementations of the >> Modbus standard. > > Yes, I found that too. Amen. I had that grandiose plan too, despite advice to the contrary. After a day or three of trying to figure how the Toshiba guys understood the Modbus spec, I finally was humbled into the one-driver-per-manufacturer model. I had to write a utility to talk to a modbus device, as an aid in reverse engineering: http://git.mah.priv.at/gitweb/modio.git , maybe its useful for the task > I built my code based on the GS2 module and > Michael's code. I guess I'll add that to master since it seems a popular base for cloning and I get no complaints here's another modbus driver for an Altivar which Martin Kaplan sent me: http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/altivar-vfd-comp -m -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Fri, 2012-02-03 at 14:58 -0800, Karl Cunningham wrote: > On 02/03/2012 12:20 PM, Kirk Wallace wrote: > > I have some more thoughts on VFD components. My plan for my SJ200 > > component was to have a bare-bones version that let one operate speed, > > direction and maybe a fault signal, then a more complete version with > > more features, but still only those necessary for machine operation and > > monitoring, and finally have a component meant to run separately from > > LinuxCNC that would allow setting registers relevant to features such as > > for tuning the system for the motor being used. > > You might also think about including the at-speed signal (is it > "frequency arrival"?), and fault reset from linuxcnc to the VFD. Until I > get everything dialed in I've found it handy to have a VFD reset button > in the pyvcp panel. > > We have a Hitachi X200 VFD, hard-wired at the moment, but I want to use > it with modbus. I'm eager to see how yours turns out. > > Karl The X200 manual I found on-line: http://www.hitachi-america.us/products/business/inverters/products/ac_variable_speed_drives/x200/ looks very similar to my SJ200-2 and has the same register addresses for at least the major functions. So when I get my SJ done you'll most likely have a Modbus component you can use. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
> I haven't considered a generic VFD or Modbus device driver, because not > only do the device functions vary widely, but so do implementations of the > Modbus standard. Yes, I found that too. I built my code based on the GS2 module and Michael's code. > Early on, I avoided using the GS2 component as a sample because it > appeared that it had to be compiled within the LinuxCNC tree. It seemed I > would need to compile LinuxCNC every time I made a change, but this is > most likely because I don't understand programming very well. The idea was to have one user hal module that would be configured by an ini file, eg loadusr -W vfdmodule sj2002.ini All that would change would be the ini file. My module is driven by the two tables, currently in the code, but I planned to move the vfd specific part to the configuration file. The tables define the Modbus registers and coils, and which ones you want to appear as hal pins. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On 02/03/2012 12:20 PM, Kirk Wallace wrote: > I have some more thoughts on VFD components. My plan for my SJ200 > component was to have a bare-bones version that let one operate speed, > direction and maybe a fault signal, then a more complete version with > more features, but still only those necessary for machine operation and > monitoring, and finally have a component meant to run separately from > LinuxCNC that would allow setting registers relevant to features such as > for tuning the system for the motor being used. You might also think about including the at-speed signal (is it "frequency arrival"?), and fault reset from linuxcnc to the VFD. Until I get everything dialed in I've found it handy to have a VFD reset button in the pyvcp panel. We have a Hitachi X200 VFD, hard-wired at the moment, but I want to use it with modbus. I'm eager to see how yours turns out. Karl -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Fri, 2012-02-03 at 11:38 -0800, Kirk Wallace wrote: > On Thu, 2012-02-02 at 19:50 -0800, Kirk Wallace wrote: > > I'm trying to get my SJ200 VFD connected with Modbus. In preparation for > > this I ported a MVX9000 which I had on the shelf. It turned out to be a > > slam dunk, almost. > > http://www.wallacecompany.com/machine_shop/EMC2/mvx9000/ > > I've noticed on the different versions of VFD C file derived components > there is a usage message at the top of the source file then a usage ... snip I have some more thoughts on VFD components. My plan for my SJ200 component was to have a bare-bones version that let one operate speed, direction and maybe a fault signal, then a more complete version with more features, but still only those necessary for machine operation and monitoring, and finally have a component meant to run separately from LinuxCNC that would allow setting registers relevant to features such as for tuning the system for the motor being used. Just a thought. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Thu, 2012-02-02 at 19:50 -0800, Kirk Wallace wrote: > I'm trying to get my SJ200 VFD connected with Modbus. In preparation for > this I ported a MVX9000 which I had on the shelf. It turned out to be a > slam dunk, almost. > http://www.wallacecompany.com/machine_shop/EMC2/mvx9000/ I've noticed on the different versions of VFD C file derived components there is a usage message at the top of the source file then a usage message in the usage function. Why can't we live without the message at the top? Also, with the comp utility there is an automated means to create and install a man page, is there a means for doing this for C file derived components? -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Fri, 2012-02-03 at 19:13 +1100, Frank Tkalcevic wrote: > I've taken the existing gs2_vfd.c from src/hal/user_comps and made an > sj200_vfd.c > > I don't like writing code that isn't modular and reusable, so I started to > write the module so it could be configured by a table of values. I only got > as far as making it work for my use. The plan was to have one "vfd" module, > and just pass in a config file of values, however I don't have more than one > device to test against. I haven't considered a generic VFD or Modbus device driver, because not only do the device functions vary widely, but so do implementations of the Modbus standard. I'm leaning more towards preferring a wizard that can help create a custom component. Having a custom component for each VFD would be similar to display or other drivers, after a while a library of components will get filled in and normal users will likely be able to just plug in the one that matches their device. Having a utility to aid in making the components could help fill the library more quickly. > I've attached a zip file with the .c file and SubMakefile. I remember at > the time I had a lot of trouble getting the submakefile to work and couldn't > find any info on it. > > I put it in src/hal/user_comps, modify the submakefile and build. From > memory, I don't think I could build from the src/hal/user_comps directory. > I had to build the lot. Early on, I avoided using the GS2 component as a sample because it appeared that it had to be compiled within the LinuxCNC tree. It seemed I would need to compile LinuxCNC every time I made a change, but this is most likely because I don't understand programming very well. > You'll notice in the code, 2 sets of tables. I too, had problems with v1 > and v2 documentation. I am hoping to find the time to gather this VFD and Modbus information and post it to the wiki so others won't need to go through the same problems. >From above "... however I don't have more than one device to test against.", I wonder how hard it would be for someone to access my VFD's with VNC? I am getting my components sorted out, but in general, being able to use remote devices for development (through the wiki?) might be a good thing. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Fri, 2012-02-03 at 11:36 +0100, Michael Haberler wrote: > Am 03.02.2012 um 04:50 schrieb Kirk Wallace: > > > I am able to modpoll the proper registers now, but I have a problem > with > > Do you mean 'modpoll the proper registers' to mean 'read several > holding registers in one operation'? > > If so: I had that problem with the Toshiba VFS-11. See the note in my > driver at > http://git.mah.priv.at/gitweb/vfs11-vfd.git/blob/refs/heads/f12-prod:/vfs11_vfd.c#l216 > > - Michael Yes, I meant I could get modpoll to read multiple registers as expected and according to a plan based on the register list (after getting the proper list). Of course with modpoll, I got errors when my base address and count pushed the end of the read into registers that do not exist. Also the SJ200 manual indicates that no more than four holding registers can be accessed at a time. The SJ200 must have a very small communication buffer, maybe due to having to deal with a tiny processor in the operator unit that occupies the Modbus port. With more experimentation I was able to get my comp to read even numbers of registers, with the last byte missing. This leads me to believe I have a endian or data type problem, so I'll need to learn more about the types used in modbus.c and types in general, or just read each register one at a time. I often can learn just enough about a sample C file to tweak some key words to get something that works, but this may not be the case for me here. Thanks Michael for your all the work you do on LinuxCNC. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
Am 03.02.2012 um 04:50 schrieb Kirk Wallace: > I am able to modpoll the proper registers now, but I have a problem with Do you mean 'modpoll the proper registers' to mean 'read several holding registers in one operation'? If so: I had that problem with the Toshiba VFS-11. See the note in my driver at http://git.mah.priv.at/gitweb/vfs11-vfd.git/blob/refs/heads/f12-prod:/vfs11_vfd.c#l216 - Michael > reading more than two holding registers in my component. It looks like > I'll need to get into the bowels of libmodbus, unless someone here has > dealt with this problem and can provide some advise. Thanks. > -- > Kirk Wallace > http://www.wallacecompany.com/machine_shop/ > http://www.wallacecompany.com/E45/index.html > California, USA > > > -- > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > ___ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
On Fri, 2012-02-03 at 16:12 +1100, Frank Tkalcevic wrote: > So which version do you need? I've made my own revision 2 driver. I have rev. 2, or rather SJ200subscript2. If your component is GPL'd then I'd appreciate getting a copy, although my problem seems to be with libmodbus. I'm planning on getting the latest libmodbus and compiling with that. I've been getting a couple of data type mismatch warnings, that I have been ignoring because the compile goes through, but I wonder if I need to address it. On my recent MVX9000 component I had to change a read function variable to "short int" from "int" because an "int" is two bytes and the modbus data comes out as single bytes, so two registers would end up on one HAL pin. Maybe I should cast the variables, but then I would have to learn how to do that. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] SJ200 VFD and Modbus
So which version do you need? I've made my own revision 2 driver. > -Original Message- > From: Kirk Wallace [mailto:kwall...@wallacecompany.com] > Sent: Friday, 3 February 2012 2:51 PM > To: LinuxCNC Users List > Subject: [Emc-users] SJ200 VFD and Modbus > > I'm trying to get my SJ200 VFD connected with Modbus. In preparation for > this I ported a MVX9000 which I had on the shelf. It turned out to be a slam > dunk, almost. > http://www.wallacecompany.com/machine_shop/EMC2/mvx9000/ > > The SJ200 is a different story. It turns out Hitachi made a rev. 1 and 2 of the > hardware, and the register addresses are different. I only found the rev. 1 > manuals on-line, but fortunately had a paper manual, that I finally found, > which indicated what the problem was. > > Plus, there is conflicting information in the application notes about the > resister addresses being offsets from the register type base address. For > holding registers, it appears to be 40001. In practice thogh, the Modbus > query uses only the offset and the query type, read holding register in this > case, and the absolute address is handled inside the VFD. > > I am able to modpoll the proper registers now, but I have a problem with > reading more than two holding registers in my component. It looks like I'll > need to get into the bowels of libmodbus, unless someone here has dealt > with this problem and can provide some advise. Thanks. > -- > Kirk Wallace > http://www.wallacecompany.com/machine_shop/ > http://www.wallacecompany.com/E45/index.html > California, USA > > > -- > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > ___ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users