On 12/02/2014 02:56 PM, Jeremy Jones wrote: > Ok. The code looked similar but I figured it had nothing to do with what I > need to do. I'll sit down later and figure it all out when I have time.
Giving it a brief look, you just put: "loadusr wj200_vfd" in your .hal file. Or to play with a bare bones setup, from a terminal window, invoke halrun. Then at the prompt "loadusr wj200_vfd". For me, I got a permission error, which means you need access rights to the serial port. I typed "quit", then tried again with "sudo halrun", then the loadusr bit. After that you can type "show" to see all the pins and such available from the wj200_vfd component. From here you can create a thread, add the component to the thread and start it. Use setp to set pins or parameters. Looking in the comp source, it looks like the serial port settings are hard coded to: ... /* modbus connection settings*/ char *device = "/dev/ttyS0"; int baud = 9600; char parity = 'N'; int data_bits = 8; int stop_bits = 1; modbus_t *ctx; ... So you will need to put an RS-485 adapter on your serial port 0 and run the two wires to your VFD's SP (Serial Positive) and SN (Serial Negative) terminals. Then make sure the VFD serial port parameters match the settings above. If the serial communications is working, you should be able to enable and other pins from your halrun session, or set up you .hal file to make the pin connections to LinuxCNC/AXIS pins. If needed, the serial port can be checked using minicom and a jumper on serial port pin 2 and 3. Set minicom for software handshake. Then anything you type should echo back to your terminal display. That's what comes to mind so far. You probably need to run down the permission issue to run the component as a normal user. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/ ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users