Hello Guest it is April 29, 2024, 12:08: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 - django013

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 »
71
Mach4 General Discussion / understanding Jog and signals?
« on: May 27, 2017, 09:33:25 AM »
Hi,

I try to synchronize on-screen buttons and external switches (not mpg) for jogging purpose.
Therefore I tried to watch signals during jogging - but I could not see any signal changes.

I placed a LED on the screen and attached it to input-sigal "jogX+".
I have an on-screen button with down-action "jogX+" and up-action "stop X-jogging", which works as expected: the x-coordinate increments as long as I press the button.
I have another on-screen button with down-script that executes mcJogIncStart(...) and up-script that executes mcJogIncStop(...). That button does not work as expected. The increment-interval is applied only once - no matter how long I press the button.

But worse for synchronization matter, the signal "jogX+" does not reflect the state of jogging, when using on-screen buttons.

So if I want to use a switch attached to "jogX+", how can I get the same action (as the button with up/down-actions), no matter whether I touch the onscreen button or the external switch?
Is there a signal (I thried the most obvious ones, but did not see any changes) that reflects the jogging state of motion control?


72
Mach4 General Discussion / access images from screen-file
« on: May 25, 2017, 03:48:03 AM »
Hi,

is it possible to access the images from screen-file from lua-code attached to some widget?

73
Hi,

did you rename your compiled script to extension *.lua?
When you look at the samples from scripting manual then the package path contains only patterns with ?.lua

hth Reinhard

74
Mach4 General Discussion / Re: Mach 4 stops while running program
« on: May 11, 2017, 11:46:10 PM »
Hi,

that sounds like the demo-timeout. Could it be, that you changed something to your laptop so that mach does not recognize the license?
Look at the titlebar of mach, whether it says something like "demo".
Or when mach stops, just press "start" again. When in demo mode mach will issue a message then.

cheers Reinhard

75
Hi Keith,

Quote
Just had some success with regfile entries now on to .ini file work.
you should work on your discipline!
mach4 has API for regfile- and inifile-entry-access, so you should treat both as taboo for direct io!

cheers Reinhard

76
Hi Keith,

I have no idea, what you're going to do ...

... but after a quick look to your code: did you read, that lua is casesensitive?
In line 18 you declare a variable "token" and in line 20 (I guess) you'll try to access that variable as "Token".
That does not work.

I recommend using the mcLuaEditor.exe provided by mach4. The colorizing ability of the editor helps find those bugs.
Then try to debug your code.
Normally the editor tells the lines, that fail to compile and tells the lines, that stop execution of lua interpreter.
It does not provide that many features, than other ide, but of cause helps a lot in programming lua!

cheers Reinhard

77
Mach4 General Discussion / Re: more lua (?) questions
« on: May 08, 2017, 08:31:44 AM »
Quote
The fixture-dialog seems to use a different value of mc.MC_FIXTURES_START - or why don't I get the values, when I coded the formula from your sample?
I solved the problem on my own ;)

There's another gap in the pound vars between G59 and G54.1 P# - so I fixed GetID from "LuaExamples/Fixture Offset Table.mcs", which I renamed to getFixtureID():
Code: [Select]
--------------------------------
--This returns the #variable that is associated with a given row of the offset table.
--------------------------------
function getFixtureID(row, axis)
    local index = 0;
    local exFixStart = 7001;

    if (row == 0) then
        index = mc.SV_WORK_SHIFT_X + axis
    elseif (row == 1) then
        index = mc.SV_HEAD_SHIFT_X + axis
    elseif (row > 1 and row < 8) then
        -- G54 .. G59
        --                  5221                                    -- 20
        index = (mc.MC_FIXTURES_START + axis + ((row - 2) * mc.MC_FIXTURES_INC))
    else
        -- G54.1 .. G54.100
        index = (exFixStart + axis + ((row - 8) * mc.MC_FIXTURES_INC))
    end
    return (index);
end
with this patched function I get all fixtures of the grid :)

cheers Reinhard

78
General Mach Discussion / Re: screen size
« on: May 06, 2017, 11:58:43 PM »
I wrote what Steve had already written - but I got aware of his answer after I pressed the post-botton.
So just ignore my writings.

79
General Mach Discussion / Re: screen size
« on: May 06, 2017, 11:52:36 PM »
Oups - first read, then write =:O

80
Take a look at your screen load script and there at the function CycleStart()
The point is, that mach works with the name of screen-elements (which is a good thing), but when you change the screen and copy/delete several objects their name will change and so functionality is broken. I did not find a possibility to move elements across their panel-borders. So you have to copy/delete the elements. But its vital to rename the new object after deleting the old one ;)

There are plenty scripts that refer to exisiting screen elements. If lua reaches a line, which refers to a non-exisiting element, the script-processing silently stops and failed.
So I startet to debug my changes, before I continue work :)

cheers Reinhard

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 »