Hello Guest it is May 17, 2024, 08:37:14 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 - subnoize

Pages: 1 2
I posted a question in ModBus but it might be a Mach4 scripting question more than ModBus; https://www.machsupport.com/forum/index.php?topic=45738.0

Thanks for the help!

Modbus / Re: Arduino to read spindle speed via modbus
« on: January 18, 2022, 10:20:59 PM »
*** Oops! I missed the part about you using Mach3 but the idea is the same ***

You mean write to the Arduino hosted holding register? Arduino's can't read but Mach4 ModBus plugin can write the value to the Arduino.

All I know is Mach4 and Lua. Which is nothing more than the following;

Code: [Select]
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "MBUS/hr0")
mc.mcRegSetValue(hreg, spindleSpeed)

You would have to look up the call to get the spindle speed but writing to a ModBus holding register is as simple as writing to any other register in Mach4.

Hope that helps.

Hello, scripting/ModBus question;

I have set up ModBus and I can see the values being written out in the diagnostics window. I have made the connection between the discrete input to an input signal in Mach4. Now, when I go to "signal wait" on the input it never seems to be available to the mc.mcSignalWait(...) call.

If I do this I can manually pause on the signal but its ugly...

Code: [Select]
local isig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT50)
local state = mc.mcSignalGetState(isig)

while mc.mcSignalGetState(isig) > 0.0
-- snore

So why doesn't this work?

Code: [Select]
rc = mc.mcSignalWait(inst, mc.ISIG_INPUT50, 0, 30) -- Wait 30 seconds for input 50 to go low

And, yes, I do put a wx.wxMilliSleep(25) to force Mach4 to see the next read from ModBus (which is disappointing but not unexpected) and it still doesn't seem to get the value.

And yes, I tried all this in reverse, waiting for it to go high.

Thanks for the help!

Mach4 General Discussion / Re: X Box here we come!
« on: October 30, 2021, 04:15:32 PM »
Nevermind! It's already installed in Mach4. Cool!

Mach4 General Discussion / Re: X Box here we come!
« on: October 30, 2021, 01:15:39 PM »
I tried to go to the FTP site and it asked me for my credentials and I entered my login for machsupport.com but it came back with denied. What are the credentials needed to download this plugin? Is this a private beta or something?

Modbus / Re: ModBus as a Input Signal
« on: July 30, 2021, 03:31:49 PM »
OK, what is missing from the documentation is that ONLY coils and discrete i/o can be used as I/O for Mach4.

Modbus / ModBus as a Input Signal
« on: July 29, 2021, 08:06:31 PM »

I set up the ModBus and everything is all green and happy.

Then I go into the Control Configuration / Input Signals and the drop down for devices has my ModBus, great! I select it. Then I click on the Input Name and I get an empty list.

What am I missing? I can access the values via scripts but I really want them as first class Input Signals and I can't seem to get it to work.

Thanks for the help!

For the records this Post file for Fusion DOES NOT support THC.

Also, you write the same code that turns on the torch to turn it off...

function onPower(power) {
  initialG31 = false;
  //writeBlock(mFormat.format(power ? 62: 63));
  powerIsOn = power;
  if (power) {
    writeln("M62P3 (+++ Turn Torch On +++)");
    if (zFormat.isSignificant(getProperty("pierceHeight"))) {
      var f = (hasParameter("operation:tool_feedEntry") ? getParameter("operation:tool_feedEntry") : toPreciseUnit(1000, MM));
      zOutput = createVariable({prefix:"Z"}, zFormat);
      writeBlock(gMotionModal.format(1), zOutput.format(getCurrentPosition().z), feedOutput.format(f));
  } else {
      writeln("M62P3 (---Turn Torch Off ---)");
    if (zFormat.isSignificant(getProperty("pierceHeight"))) {
      zOutput = createVariable({prefix:"Z"}, zFormat);

Shouldn't the turn off code be?

      writeln("M63P3 (---Turn Torch Off ---)");

Forgive me for asking stupid questions here; I gave up on Fusion 360 and anything plasma related with Mach4/ESS. So I was intrigued with this conversation and opened the file and there were a bunch of references to Mach3 and such.

I have tried to roll my own post for Fusion and Mach4/ESS with THC for some time. I get the basics working but the torch height control never works.

My OEM claims that the fault is with AutoCad. Does this post processor have THC using the ESS ?

Pages: 1 2