Hello Guest it is April 18, 2024, 03:27:05 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TommyG

Pages: 1 2 3 »
1
Mach4 General Discussion / Re: Best way work with Modbus
« on: February 07, 2022, 07:01:39 AM »
I'm not an expert on this (see my previous posts for evidence  ;)) but I think it's pretty much the standard to open the channel (I'm assuming Serial/RS485 or similar) and keep it open.

Opening the COM port and establishing a connection is orders of magnitude slower than sending actual traffic once the port is open. Also, if you want to read information via MODBUS then you'll be polling the COM port many times per second.

With regard to saving computer time, the processing power needed to maintain a serial connection is negligible to any modern computer and by modern, in this case I mean any PC less than 20 years old.

If you're having regular communication port failures then it could be that you've a lot of electrical noise in your system and it could be worth trying to resolve that. VFDs can be a particular source of electrical noise. In my experience the popular low cost Huanyang brand of VFDs were incredibly noisy, I gave up trying to resolve that with shielding and grounding and just replaced them with other brands.

Hope this helps

2
Mach4 General Discussion / Re: Signal Library - RPM change signal?
« on: February 07, 2022, 06:50:29 AM »
Thanks both

@Craig - I figured it was something along those lines but you explained it very succinctly and clearly, thanks.

@SwiftyJ, good suggestion, I'll definitely look into that.

As it turns out I was trying to solve a problem that didn't exist. I didn't want Mach4 sending spindle speed updates to the VFD every cycle of the PMC but it appears that Mach4 is smart enough to only send updates if the new value written to the register is different to the previous value. Apologies to the coder(s) for my lack of faith :-)

3
Mach4 General Discussion / Signal Library - RPM change signal?
« on: January 30, 2022, 11:57:21 AM »
Continuing my mission to use the Signal Library to control a VFD via MODBUS...

Is there a signal in the Signal Library that's raised when the spindle RPM is changed?

On that topic, is there a document anywhere with all the signals listed?

Thanks

Tommy

4
Mach4 General Discussion / Re: Writing to a register from Signal Script
« on: January 30, 2022, 11:07:49 AM »
Never mind folks, the classic case of 'read the manual one more time after posting a forum message'

The command is, of course, 'mc.mcRegSetValue(hreg, 0)' rather than 'mc.RegSetValue(hreg, 0)'

Doh!

5
Mach4 General Discussion / Writing to a register from Signal Script
« on: January 30, 2022, 10:55:49 AM »
Hi folks

I'm new to Mach4 programming although I've a reasonable bit of experience with both Mach4 and programming individually :-)

I'm trying to configure Mach4 to control a VFD via MODBUS. I've the MODBUS bit up and working and can control the spindle via the "Diagnostic - Newfangled Solutions - MODBUS" screen but I'm having trouble wiring the relevant control signals to the MODBUS registers.

I can do this with a PMC script but a more elegant method would seem to be to use a signal script. However, went I try to set the register value I get an error "attempt to call a nil value (field 'RegSetValue')" I've added some debugging messages and I can see that the 'hreg' variable is getting a value.

The code below has been added to my screen load script in the 'SigLib' section. I'm just using test registers for debugging.
Code: [Select]
[mc.OSIG_SPINDLEFWD] = function (state)
    if (state == 1) then
local hreg = mc.mcRegGetHandle(inst, "iRegs0/test/spindleCtrl")
mc.RegSetValue(hreg, 1)
    else
mc.mcCntlSetLastError(inst, "INFO: OSIG_SPINDLEFWD != 1")
local hreg = mc.mcRegGetHandle(inst, "iRegs0/test/spindleCtrl")
mc.mcCntlSetLastError(inst, "INFO: hreg value was " .. tostring(hreg))
mc.RegSetValue(hreg, 0)
    end

end,

I get the error when I click on 'Enable' in Mach4, I'd assume part of the enable process is to set the motor off so that makes sense.

Any help would be greatly appreciated.

Tommy

6
Mach4 General Discussion / Re: Mach 4 and fusion 360
« on: February 18, 2019, 05:13:42 AM »
I regularly use Fusion 360 with Mach4 and it works fine. As the posts above state you probably have the wrong post processor selected.

Some instructions below on how to select the correct post processor but I would add that some of the advice above is very good. I'd particularly echo Craig's (joeaverage) advice that if you're totally new to Mach4 and CNC then Fusion 360 is going to add a layer of complexity you probably don't need or want. I like it for CAM but it took me some time to get my head around its peculiarities, it's certainly not as intuitive as other programs I've used.

To select the CAM processor

Go to https://cam.autodesk.com/hsmposts? and search for Mach4Mill. Download that post processor to somewhere on your computer. I'd suggest creating a folder in the Mach4Hobby directory, something like C:\Mach4Hobby\Fusion360Posts. You're better clicking on the "Download" button rather than opening the file and copying the contents, you avoid issues with different types of newline characters between different OSes that way.

In Fusion360, when you select "Post Process" in the CAM workspace, change the "Configuration Folder" to point at the location above. The "Post Configuration" should automatically change to "Mach4Mill / mach4mill" assuming it's the only post processor in the directory. That should be you good to go.

You're also better opening the gcode file in Mach4 rather than copy and pasting the contents to the MDI window, that can also cause the issue with newline characters being mixed up and result in the single line issue you noted above. Windows Notepad (up until the very newest versions in the latest builds of Windows 10) is a particularly bad offender when it comes to this.


Hope this helps

Tommy

7
Mach4 General Discussion / Re: Mach 4, Modbus and HuanYang VFDs
« on: November 30, 2018, 08:16:24 AM »
Folks

In case it's any use to anyone developing a Mach 4 plugin, here's a link to a Windows application I wrote a few years ago to control the HuanYang VFD I had at the time.

I haven't done any further development on it (I had to Google it myself to see where I'd uploaded it to!) as I got rid of the HuanYang kit and invested in a FRENIC Mini.

Code written in C# with Visual Studio

https://github.com/GilchristT/SpindleTalker2/releases

Tommy

8
Mach4 General Discussion / Re: Rebuild Problem
« on: February 13, 2018, 07:45:18 AM »
I rebuild my PC fairly frequently (my day job is an IT professional so I end up testing all sorts of stuff on my poor PC)

I typically find that if you just copy the C:\Mach4Hobby folder across and run the c:\Mach4Hobby\Mach4GUI.exe executable then everything works just fine.

9
Mach4 General Discussion / Re: Suggested OS
« on: January 27, 2018, 12:08:16 PM »
I can't answer for either Steve or indeed for Mach4 but in general, any APPLICATION that runs on Windows 7 will run on Vista.

Typically, when you see that an application is supported on certain versions of Windows it means that the product has been TESTED against those versions of Windows, not that it's KNOWN not to work with versions not listed.

Windows 7 and Windows Vista have very broad compatibility, I'm yet to encounter an app that would run on one but not the other.

Drivers, on the other hand, are another matter. Here you're more likely to encounter issues if a version isn't supported. This is because the framework for drivers gets updated with most Windows version upgrades although they mostly maintain backwards compatibility.

I've had fairly good luck with using drivers certified for older or newer versions of Windows on versions they weren't supported by. That said, if my sound card doesn't work properly it doesn't have the potential to cause thousands of pounds worth of damage so I'd probably stick with supported versions for CNC breakouts :-)

10
Mach4 General Discussion / Re: Suggested OS
« on: January 26, 2018, 11:51:42 AM »
See https://www.howtogeek.com/197232/microsoft-is-misleading-consumers-with-windows-8.1-system-builder-licensing/ for a potted history.

I've had the misfortune to work for a Microsoft partner up until about a year ago so we had to play by the rules. Unfortunately finding out what the rules were on any given day was more or less impossible.

If you think that is fun, try getting MS to give a straight answer on portability of virtual machines between physical hosts...

And if you think THAT'S fun, try getting Oracle to give a licensing answer to anything other than "What's your annual IT budget? Right, send that to us."

Pages: 1 2 3 »