Hello Guest it is April 21, 2021, 02:40:33 PM

Author Topic: Problem in front or behind the screen?  (Read 2287 times)

0 Members and 1 Guest are viewing this topic.

Problem in front or behind the screen?
« on: April 27, 2017, 02:27:12 AM »
Hello,

is there something wrong with my writings? Three posts and no reply? If so, than I apologize my english. I'm not an native english.

I wonna find out, which mach-version will be the right for me. With mach3 I reached a point, where mach3 does not support my wishes/requirements.
So I tried mach4. Working with its screen designer showed some promising features, but working with mach4 is like working with an application in alpha stadium. So many quirks and wired things.
I found out recently, that running my simple sample with a machine using inch-setup works fine. As soon as I change machine setup to metric units it fails.
Coordinates of failure are different, but not the timecode. Elapsed time is always 5:41.36 - is that the limit for demo mode, or do I have to look for another reason of failure?
Trying roadrunner.tap fails at first motion command (G0 of line2).

I like the new event system and the new screen-elements of mach4, so I'd like to go for mach4 - but if mach4 does not work reliably, than all the goodies are worthless and I have to arrange with mach3.

So what is the state of mach4 - and what are your recommendations for me?

Offline Tweakie.CNC

*
  • *
  •  8,696 8,696
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Problem in front or behind the screen?
« Reply #1 on: April 27, 2017, 02:53:30 AM »
Quote
I found out recently, that running my simple sample with a machine using inch-setup works fine. As soon as I change machine setup to metric units it fails.
Coordinates of failure are different, but not the timecode. Elapsed time is always 5:41.36 - is that the limit for demo mode, or do I have to look for another reason of failure?

Try downloading and installing Mach4 build 3372 from the ftp section. ftp://anonymous:guest@ftp.machsupport.com/Mach4/DevlopmentVersions/Mach4Hobby%20Installer-4.2.0.3372.exe

Tweakie.
« Last Edit: April 27, 2017, 02:59:58 AM by Tweakie.CNC »
KEEP SAFE !
Re: Problem in front or behind the screen?
« Reply #2 on: April 27, 2017, 03:58:45 AM »
Hi Tweakie,

thank you very much for your attention and your hint.

I tried it, but no change. I found out, that the break is in deed related to the demo timeout. The problem is, that there's no message indicating the reason of the stop.
The message appears, when you hit start again - but I think, its not obvious to hit start again, when the machine stops during motion command without any visible reason.
So it would be nice, to raise the message, when motion stops working.
The demo-timeout is completely ok, but it would be very nice to tell the user what happened :)

The groupbox-title are completely weired (see attachment) and its stil not possible to enter a little "Oh" in button-text or element-names ...

... so I'm happy, that the problem does not sit in front of the screen :)
Re: Problem in front or behind the screen?
« Reply #3 on: April 27, 2017, 04:40:05 AM »
Hello,

I miss the dro-value "feedrate overwritten", which existed in mach3. Is there something similar in mach4?
I'm not interested in the percentage of feed-overwriting, but in the resulting real value.

Is there a possibility to format the cycle-time? I'm not interested in milliseconds of processing time and I don't like the hectic flicker/field-update.

Ah - and is there a way to inhibit the automatic scaling like mach3?
« Last Edit: April 27, 2017, 04:41:44 AM by django013 »

Offline smurph

*
  • *
  •  1,384 1,384
  • "That there... that's an RV."
    • View Profile
Re: Problem in front or behind the screen?
« Reply #4 on: April 29, 2017, 08:14:09 PM »
Mach 4 is not Mach 3.  There really isn't anything that directly correlates between the two as far as screen design goes.  So the first mistake is to think what/how/why things work in Mach 3 vs. Mach 4.  Just force yourself to not do this!  You life will get easier.  :)

Most of what you want can be done with custom scripting.  For example, you can get the cycle time with the API and format it any way you want it with LUA.
Code: [Select]
if (machEnabled == 1) then
    local cycletime = mc.mcCntlGetRunTime(inst)
    if (machState ~= mc.MC_STATE_IDLE and mc.MC_STATE_JOG and mc.MC_STATE_HOME) then
        scr.SetProperty("CycleTime", "Label", SecondsToClock(cycletime))
    end
end
That code is in the PLC script on a screen I have.  The LUA function SecondsToClock() does the format.  This function is defined in the screen load script and is thus available to all screen scripts.

Code: [Select]
-- In screen load script.
function SecondsToClock(Seconds)
if Seconds == 0 then
return "00:00:00.00";
else
local Hours = string.format("%02.f", math.floor(Seconds/3600));
local Mins = string.format("%02.f", math.floor(Seconds/60 - (Hours*60)));
local Secs = string.format("%04.2f",(Seconds - Hours*3600 - Mins*60));
return Hours..":"..Mins..":"..Secs
end
end

As you can see, you can format the time in any manner you wish!  You can also solve your "feedrate overridden" this way as well.  

As to the flicker, all that you have to do is slow the rate at which the cycle time is updated.  In the example above, is is called every PLC script interval.  This interval is defined in the screen set.  Say it is fifty milliseconds.  Just put in a counter that is checked before calling the API to get the cycle time.  That way, you can slow the update down to every x * 50 milliseconds.  

I would suggest reading the API documentation and getting familiar with what all can be used.  You will soon be dreaming up all kinds of ways to do things!  LUA is the way to call these API functions in a screen, so reading up on it will help too.  

There is no way to inhibit the scaling.  We are using a cross platform framework with Mach 4 instead of MFC that was used in Mach 3.  The cross platform capabilities are nice but it comes at a cost sometimes.  i would suggest designing the screen at or near the resolution you wish instead.  

We will never make that demo timeout message evident at the time the demo times out.  The reason is that lets the hackers know what to look for to try and disable the timeout!  
Re: Problem in front or behind the screen?
« Reply #5 on: April 29, 2017, 11:32:14 PM »
Hi,

thank you for your attention!

Quote
Mach 4 is not Mach 3.
I already read and understood that. I read the threads about feature requests and bug reports ...
I guess, mach3 was coded by using win32 calls, whereas mach4 uses wxwindows.

My thinking does not depend on mach3. I don't know much of it. My thinking comes from other applications / gui systems like java swing or ibm c++ class library ...
I don't know wxwindows, so I don't know, what's possible. Therefore I wrote about what I miss in mach3 and in mach4.

Quote
I would suggest reading the API documentation
Yes sir, I already did.
But with the reading, I thought, that the api documentation looks like c++ documentation - and therefor I thought, api docs might be intended for plugin/c++ developers.
No api from c++ level is accessible through lua if you don't create an intermediate function call.
I found the file "LuaCalls", which might be the api-specs for scripting, but looking at the samples, I have no feeling about what needs to be done and what is optional.
Many samples use dialogs. I don't want dialogs. I want most functionality happen in the screen, so that all functions are accessible without mouse interaction.

Thank you very much for the samples in your post. I will go for that.

Respect to what I'm missing in gui: is it possible to add lua-gui-elements to existing panels like notebooktabs or groupboxes?
Then of cause I will have to learn lua and wxwindows.

by the way: when I read about mach4 and lua and wxwindows, my heart started jumping and I thought, so may be the day comes, where machLinux will be available ;)
I'm quite sure, I'm not the only linux guy willing to pay for machLinux.

Quote
The reason is that lets the hackers know what to look for to try and disable the timeout!
Hehe - in germany there's a phone company called "O2" - which spends more menpower in disabling functionality than in supporting paying users. Hope you don't follow that direction :)

P.S.: are you interested in po-file fixes (diffs?)
« Last Edit: April 29, 2017, 11:39:50 PM by django013 »
Re: Problem in front or behind the screen?
« Reply #6 on: April 30, 2017, 12:02:49 AM »
Quote
The LUA function SecondsToClock() does the format.  This function is defined in the screen load script and is thus available to all screen scripts.
Ok, found a menuentry to view the script, but no way to edit it.
So I'm trapped again :(

Offline smurph

*
  • *
  •  1,384 1,384
  • "That there... that's an RV."
    • View Profile
Re: Problem in front or behind the screen?
« Reply #7 on: April 30, 2017, 12:50:52 AM »
You edit the screen scripts in the screen editor.  They are on the root tree item.  Click on the root tree item and then look to the properties/event window.  Click on the little lightening bolt. 

The API documentation has both a C/C++ syntax and a LUA syntax.  The LauCalls.txt file will be gone in the next release.  It is old and not relevant.  In fact, I didn't even know it was there.  Someone else put it in the documentation repository and it gets automatically included in the builds.  I was just recently made aware of it's existence and I looked at it and found that the return variables are called out in the wrong order!  So that is not the document to use at all.

We go in the direction which keeps us in business.  We don't choose to have to resort to protection methods.  If everyone were honorable then we would not have the issue at all.  So please do not blame us.  We offer a great product for not a lot of money and do what ever it takes to keep it affordable.  And part of keeping it affordable is not having it pirated.

Sure, send the po-file fixes to support@machsupport.com and we will merge them in!

BTW, I don't see a problem with little 'Oh" in buttons text and element names.  Perhaps the keyboard plugin is capturing the keys?  you can disable the keyboard capturing with the small task bar icon.
 
Steve
Re: Problem in front or behind the screen?
« Reply #8 on: April 30, 2017, 01:25:06 AM »
Hi Steve,

Quote
So please do not blame us.
Please take for granted, that I don't want to blame you. I'm far away from that point and if anything I write sounds like that, than its sourced by the lack of my english and not by the spirit to blame you.

I run several pcs and not one runs windows. So if I write here, you can take for sure, that I have to blame linuxcnc and mesa - but not mach.
You're doing a great job and when I write about issues, its to help you improve mach and not to blame you.

Quote
And part of keeping it affordable is not having it pirated.
100% agreed!

But I compare mach with eagle. Don't know, whether you heard about it (pcb designer). eagle had a very hobbyfriendly licensing policy and for so, it became a standard in open source community. Sure it get hacked and several guys spent lot of time, abusing the license.
But I think, the hackers helped eagle to become famous - so I see both sides: the creators of eagle lost money with the hacks, but they probably earned money from others, cause of the increased rumors.
Now that autocad bought eagle and changed license - eagle is dead.

So from my point of view: I'm willing to pay for mach, cause you support hobbyists in doing what they want and don't force them to do what you want.
You are on the right way and I hope, that my feedback is treaten right: I want to help you improve mach.
Nothing more.

beside that, I'm learning mach and I know, that I don't know anything.

Offline smurph

*
  • *
  •  1,384 1,384
  • "That there... that's an RV."
    • View Profile
Re: Problem in front or behind the screen?
« Reply #9 on: April 30, 2017, 02:15:08 AM »
I tried using Eagle, but the board size was too limited.  And the next version up was a bit out of my price range.  So I started using DipTrace and liked it so much that I bought the full version.  I hope they don't get bought out!  I used to use Altium Designer (and DXP 2004 before that) when I worked at a company that had it and got spoiled.  Before that, I used a program called CircuitMaker 2000, which was part of the Protel lineage.  Altium has resurrected the CircuitMaker product as a free "maker" EDA software.  I have not tried it though.  If the software is free, I tend to worry.  Because YOU then become the product.  :)

Sad to hear AutoDesk ruined Eagle.

Steve