Hello Guest it is April 25, 2024, 02:40:11 AM

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.


Topics - matrix

Pages: 1
1
Mach4 General Discussion / io.open path wit special char
« on: November 16, 2019, 06:58:01 AM »


Hello,

I need change some line from a Gcode every time I load on mach4, so I made a script that
open this file, replace the lines I want and load to mach4 without problem.


So, the problem is, if the Gcode Path (on windons) have some special char like "c:Users\Alçada\test.nc" , the "ç" char dont work
on "file,err = io.open( "c:Users\Alçada\test.nc")"

Any way to solve this?

Thanks





2
Mach4 General Discussion / If is running lua code
« on: October 31, 2018, 02:48:52 PM »

Hello,

I need a lua code for check if the gcode is running or not.

I try set one led on screen with (File Running, File Feed Hold), and this work on led, while start ou pause run the led is on, if stop the led turm off.


I create a lua script that ckeck is this led is on or off:

State = scr.GetProperty("RunningLed","Value")
if State == 1 then
   print ("led on")
   else
   print ("led Off")
   end


for some reason (I think that is a bug)  return always ON.

The same script for other diferente led, work OK


Any tip??






3
Mach4 General Discussion / Run Script on startup
« on: October 26, 2018, 12:07:04 PM »


Hello, me again.

I'm in the process of upgrading from mach3 to mach4, and as I have many scripts in VB, I need to redo everything for Lua.

At this point I am still understanding the Lua syntax, and define how I am going to do this upgrade with the least possible effort.


So,
I created a script just for outgoing tests / inputs, messaging etc, and I recorded it with the name outputCheck.mcs on the macro folder, so far so good.

the strange thing is, every time I start mach4 this script runs once, if you turn off the mach 4 and start again the script run agains one time.

What's the secret, who knows?




4
Mach4 General Discussion / Lua append txt file
« on: October 25, 2018, 01:16:56 PM »
   
   
Hello,

I try append on txt file, and there is a problem, if the file dont exist, this script create a file and write the message.

but if the file already exist, the File return a nil values, and dont append the message

File = io.open("C:/perfLogs/Log1.txt", "a+" )
File:write("test...")
File:close()


Is this code supposed to work for append mode? Why does not it work?

Any one?


5
Mach4 General Discussion / If output/input is off or onn
« on: October 22, 2018, 01:23:26 PM »
Hello,

I'm trying to do something simple like, check if an output or input is active.

I'm use mach3 VB, and I'm not able to find the dynamics of the LUA.


This command dont work, why not?

local inst= mc.mcGetInstance()
local Output0 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
if (sig == Output0) then
   wx.wxMessageBox("Output on")
end


what is the trick??

6
VB and the development of wizards / do user button
« on: June 13, 2017, 07:12:18 AM »


I set on screen a button with a vb script, this is a user button, I need call this button from macropump,I already tried calling as  ex: "douserbutton(1500) but dont work, Does anyone know how I can do this?


tanks

7
VB and the development of wizards / SetParam("AccelerationX",)
« on: December 04, 2015, 12:50:07 PM »


I put a script on macropump to change the ACC X/Y  by speed, some like:
 

If Getoemdro(55) < 200 Then
call SetParam("AccelerationX",210)
call SetParam("AccelerationY",125)
else
call SetParam("AccelerationX",700)
call SetParam("AccelerationY",350)
End if


It works but, only change the acc if the reset button is pressed,  there is any command to force?













8
VB and the development of wizards / Get Current Gcode Name
« on: December 04, 2015, 04:22:32 AM »
 I need  make a button to load a gcode into mach3 to run, but I need load the last
and new file on the folder (by date, and independ of name), like:

File = ("C:/mach3/Gcode/" & laste file on this folder)


and I need a script to read the Current file gcode name like:

FileName = current file name



Can someone help?

9
Mach4 General Discussion / Lua (Steps into Script)
« on: May 03, 2014, 07:03:57 AM »


Hi,


I've been exploring the demo Mach4, The first impression (Forgetting the bugs) is fantastic, the editor screen is much improved with new options, very good.

For begin I want say, I'm not a programmer, and my programming knowledge is very limited, however that did not stop me from making my own scripts in VB,  and I think there are many people like me, I use a lot VB script, brains and screen editor, VB for Button ect.

All the knowledge I acquired was seeing and testing other scripts, I was watching the LUA will be a little more complex than VB, one of the things that helped me was the
STEP INTO SCRIPT function available in the VB editor mach3, this way it is easy to run line by line and see what makes each line and if is Ok, values etc.

I wonder if some equivalent function exists in the new LUA editor Mach4?? I've been exploring but without a little push will not easily.

PS: Sorry my english

Pages: 1