Hello Guest it is May 22, 2024, 04:11:34 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.


Messages - thosj

311
Mach4 General Discussion / Re: LUA Script error in PLC, PoKeys
« on: March 11, 2017, 04:42:52 PM »
To follow up in case anyone else reads this.

The whole issue was I copied the dofile line from Pokeys web site and pasted it into the PLC script and that somehow corrupts the text. I hand typed the dofile line in the PLC script and it worked fine. So the PoKeys downloaded lua file was fine as it was, the "45", script or not, worked fine.

The Mach support guys, James and Brett, fixed me up on this, so thanks to them.

312
Mach4 General Discussion / Re: Single block mode
« on: March 09, 2017, 05:29:35 PM »
Bertho,

It's very easy to change, VERY easy. And once changed it works like we expect, one press of Cycle Start executes one line of code, next press, next line, ad nasuem.

Just follow DaztheGas instructions above. This'll be the easiest screen edit you EVER make, trust me!!! Wait'll you try LUA script  :-\

Not sure what happens if Mach4 gets upgraded, I guess nothing as the screen is the screen and this edit is in the screen.

And I, too, have no clue why this isn't default behavior of Single Block. Daz seems to think it was merely an oversight up there in Maine!!

If you need more help, let us know, maybe I can get a screen capture or two to help, but, again, this is toe-in-the-water with the screen editor.

Tom

313
Mach4 General Discussion / Re: Hobby/Industrial and Profiles
« on: March 09, 2017, 07:44:42 AM »
I packaged my hobby profile, imported it into industrial, copied my ESS plugin to industrial. ESS won't initialize in industrial. Is there a problem with the ESS plugin in Mach4 industrial? I don't think it's my imported profile, I created a new profile from the default industrial profile and the ESS won't initialize with that either. Hmmmm.......... ???

314
Mach4 General Discussion / Re: LUA Script error in PLC, PoKeys
« on: March 08, 2017, 05:20:35 PM »
I made your edit, one line, right?

local percent = toNumber(analog)/1*250 --calculate percentage from 0% to 250%  *****changed here******

I get the exact same error exiting the screen editor after adding the line to run the file.

I've attached the screenshot of the error again for ref.

Maybe I shouldn't be adding this at the bottom of the PLC file, maybe it should be in the Screen Start?

It's amazing this is this hard!! I sure wish I knew more about how all this really works, Screen Load, Screen Unload, PLC, on and on.

Tom

315
Mach4 General Discussion / Re: Hobby/Industrial and Profiles
« on: March 08, 2017, 04:59:16 PM »
Ach, that'll teach me to use a desktop shortcut with /p *********x!!

Thanks   :P

316
Mach4 General Discussion / Re: Hobby/Industrial and Profiles
« on: March 08, 2017, 04:14:40 PM »
I packaged up my profile in hobby, so I've got a *.m4prof file, but how do I get it into industrial? I don't see an "import" or anything?

Tom

317
PoKeys / PoKeys 57E buttons, MACH4
« on: March 08, 2017, 06:20:48 AM »
I have a new PoKeys 57E. I need to get 5 buttons working before I can move on with my Mach4 learning experience. Well, actually 5 buttons and two analog pots. I downloaded the script for FRO on a pot with inputs 41/47 on the PoKeys, but out of the box it doesn't work. Someone on the Mach 4 thread is helping me there, so maybe.....

So I need 5 buttons to do:

Cycle Start
Cycle Start
Feed Hold
Coolant on/off (M8/M9)
Mist on/off (M7/M9)

I can't find anything in the documentation for a simple button in Mach4. I guess they think I just know how to do that. I find examples for all the complicated stuff, matrix keyboards, lcd's, but nothing for a simple button and how to make it work in Mach4.

Can anyone help me or point me? I need to get these 5 buttons and two pots working before I can confidently keep my painful transition to Mach 4 going.

Thanks, Tom

318
Mach4 General Discussion / Re: LUA Script error in PLC, PoKeys
« on: March 08, 2017, 06:08:14 AM »
OK, I'll try that later today, thanks. If it works I'll be all over PoKeys to get them to post the proper code for this. THEN I need to do the same thing for SRO, get an analog pot to do Speed Rate Override. I sure wish this stuff was documented somewhere better, if it is, I sure can't find it. In Mach3  the script seemed easier to understand. I have a hard time reading even a small lua script and making sense of it. If I wrote that one we're working on I'd have put a comment behind every damn line so later I'd know what I did

Oh, BTW, how do I get that "code" window, like in your last post, in the forum? I'm going to be needing to know that!!

Thanks again, I'll be back later to comment if my pot works now.

Tom

319
Mach4 General Discussion / Re: LUA Script error in PLC, PoKeys
« on: March 07, 2017, 06:34:18 PM »
OK, I change the "45" to 45, done?

Or do I leave "45" as "45" and use your code to create a new variable, alog, as in alog=toNumber(Analog)

Maybe you could just edit my script like it should be, post it back up here, and maybe I can learn something.

OH, and to the unwashed, it looks to me like analogPIN is what's set to "45", not analog, but perhaps I don't get that either

What I don't get is why PoKeys posted this code on their blog for dopes like me to try to use. I guess to force a learning experience on us, those clever bastards!!!

Thanks for the help!

Tom

320
Mach4 General Discussion / Re: LUA Script error in PLC, PoKeys
« on: March 07, 2017, 06:05:05 PM »
You lost me, I know almost nothing about LUA. This is my first attempt and I downloaded the lua file from PoKeys.

Change analog to a number? What number? 1, 1000?

And how do you "run" it? In my case, the lua file is being run by the PLC with the line I added as shown in one of the screenshots. I get the error shown, something about a symbol near character 226!!

Sorry!!