ModIO - rmu75/linuxcnc-wiki GitHub Wiki
This is a serial Modbus peripheral (RTU, RS232 or RS485) similar to a Modbus MPG pendant or VFD, which can be configured for various applications, from simple digital I/O, to an MPG pendant. EMC2 can talk to the Modio in userspace, so real-time functions are not supported.
There are two drivers or components. One talks to the application registers and provides halpins for use with EMC2. The other uses pyVCP in a standalone application to set the configuration registers.
In this AXIS demo, the Modio features shown on the right of the screen just show evidence of the Modio signals. Usually, the signals would be connected to functions that may or may not show up on the screen when used in a real application. |
The configuration utility runs separately from EMC2 and is used only to change the features shown. pyVCP is very limited in flexibility, so there were many compromises to the layout, but it does serve the purpose. GladeVCP might be better, but it was not available at the time. The LED's show the current status of the registers in the Modio. The radio buttons setup the data that will be sent to the Modio registers by clicking the Write button. The LED's update after the write is complete. Some of the radio buttons are graphically inverted and LED colors changed for features that are initially FALSE with the factory default settings. |
The drivers are C files and can not be installed with comp. Each driver's files should be copied to their own directory, cd to a directory, then run "make && sudo make install" More documentation needs to be done.
In ~/emc2/homann/modio
upload:homann_modio.c upload:Makefile In ~/emc2/configs/my_modio_config upload:modio_pyvcp.hal upload:modio_stepper.xml upload:stepper_inch.ini upload:modio_config.xml upload:core_stepper.hal
modio_pyvcp.hal calls for a conv_u32_bits.comp >upload:conv_u32_bits.comp copy conv_u32_bits.comp to your ~/emc2 directory and run "sudo comp --install conv_u32_bits.comp" and "sudo comp --install-doc conv_u32_bits.comp" to make and install the component and its man page. ##### Configuration Driver
In ~/emc2/homann/modio_config
upload:h_modio_config.c upload:Makefile_config <--- change name to Makefile after download so 'make' will find it, or use 'make -f Makefile_config' upload:h_modio_config.hal upload:h_modio_config.xml
modio_config.hal calls for a conv_u32_lowbits.comp >upload:conv_u32_lowbits.comp copy conv_u32_lowbits.comp to your ~/emc2 directory and run "sudo comp --install conv_u32_lowbits.comp" and "sudo comp --install-doc conv_u32_lowbits.comp" to make and install the component and its man page. conv_u32_lowbits.comp could have been used in modio_pyvcp.hal above, but I got too lazy to change it.
To run, use:
>
cd ~/emc2/homann/modio_config halrun -I h_modio_config.hal #(plus settings if needed)##### Both Driver Directories Need
modbus.c modbus.h findbindir find-libdir find-modinc
Available from the vfs11_vfd directory in (someone's) GIT here, http://git.mah.priv.at/gitweb/vfs11-vfd.git/tree/master . I used a PC with Ubnuntu 8.04, EMC2 2.4.6, emc-dev installed, and the configuration from EMC2 from source, http://wiki.linuxcnc.org/wiki.pl?Installing_EMC2#On_Ubuntu_10_04_or_8_04_from_source . I have no idea if the drivers will compile and install with any other configuration -- time will tell.
(Draft 2011/03/05 Kirk Wallace)