Script+Pokeys

C Scripting questions and answers
ArtF
Global Moderator
Global Moderator
Posts: 4556
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: Script+Pokeys

Post by ArtF »

Hi Kirk:

 Well, the flourishes work quite well at the moment, but as Yanvrno noted, ( the only guy to have tested them) ,
you just nvrno what your gonna get. You enter a fertilizer for bushiness, and a motif for shape, but the motif is a
control reall yof the outside boundry sizes in a circle packing algorithm, the shapes do get intuitive when you get used to them,
but I wondered.. what if you could point to a photograph to set the motif.

 SO Im experimenting with it.. this , for example is th ebasis graph from a photo of a dog.. needs work, but it shows
perhaps photos could set a quick motif for a vines tendencies....

Art
You do not have the required permissions to view the files attached to this post.
Amazon [Bot]
Full Member
Full Member
Posts: 185
Joined: Tue Jan 06, 2026 4:56 pm

Re: Script+Pokeys

Post by Amazon [Bot] »

Just so everyone knows what the original image was, turned out pretty good I thought.
You do not have the required permissions to view the files attached to this post.
DanL
Site Admin
Posts: 357
Joined: Thu Sep 11, 2014 12:35 am

Re: Script+Pokeys

Post by DanL »

you can see what it is
satco
Site Admin
Posts: 28
Joined: Tue Jan 19, 2016 4:23 pm

Re: Script+Pokeys

Post by satco »

Hi Art,

>>3. I set LED ID number...
My mistake is - use "Var. Name" and "ID" simultaneously. Now all ok.

>>4. How Get/Set Label?
  Mylabel = Label("Main_LABEL_66");
  MyLabel.SetText("Yho");
return mistake
  Mylabel = Label("Main_LABEL_66");
  Mylabel.SetBkgndColor(0x444400);
return mistake
if only
  Mylabel = Label("Main_LABEL_66");
no mistake

>>5. Help please with Block.
...you wouldnt waste cpu time polling a button, allow the button to call you instead.
By making a function equal to the variable name, that function will be called automatic ally when the item changes.

Does it work fo Pokeys pin?
Pokeys1 Pin Dig IN(1);
Pokeys1.Pin Dig OUT(9);

>>6. Mach3 has a very powerful tool - screens .
I have no problem with Auggie Editor of Panel and Screen. It is really very powerfull and easy to use Editor. Video gives all needed information. It is more powerful than in Mach3. I have placed wrong question.

The question is: How to change user interfase (like Program run, MDI, Settings, ets.) during Auggie works? Is it possible to set Hot Keys to load different screens or panels?

>>Mach3 has around 100,000 users...
  It is a very beautiful result!

Best regards,
Anatolii.
ArtF
Global Moderator
Global Moderator
Posts: 4556
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: Script+Pokeys

Post by ArtF »


>>4. How Get/Set Label?
>>  Mylabel = Label("Main_LABE L_66");
>>  MyLabel.S etText("Yho");
>>return mistake
>>  Mylabel = Label("Main_LABE L_66");
>> Mylabel.S etBkgndCo lor(0x444400);
>>return mistake

  I just tried ..

Mylabel = Label("JogPanel_LABEL_0");
Mylabel.SetText("fgh");
Mylabel.SetBkgndColor(0xfff,0x0f0);

  Sorry about the color, you need 2 numbers, one for on segments, one for off.. other than that the above works fine here.



>>5. Help please with Block.
>>...you wouldnt waste cpu time polling a button, allow the button to call you instead.
>>By making a function equal to the variable name, that function will be called automatic ally when the item changes.

Does it work fo Pokeys pin?
Pokeys1 Pin Dig IN(1);
Pokeys1.P in Dig OUT(9);

  No. You need to have a screen interface object to deal with, its the object that calls
the script. So it must be a button or a dro..or even a label.. probably not good for monitoring a pin..

To do it with blocking, just add something like this to a library file..

global  MonitorPin9 = function()
{
  while(1)
  {
    block( "MotionPiin9");  //or you cold use IOPin9
  //
  //  when you reach here, its because pin9 has changed..
    pinstate = MyMotion.GetPinDig(9); 
    if( pinstate == 1 )
    {
        //do what you need to do. Take not that if you change pin9, youll get called again..
        //so make sure you dont get into a loop where your change makes this gets called which then changes it..etc...
    }
  }

};
MonitorPin9();


  In the library, the function will get declared, and then start runnign immediatley as you call it right after declaring it..



>>6. Mach3 has a very ...... I have placed wrong question.
>>The question is: How to change user interfase (like Program run, MDI, Settings, ets.) during Auggie works? Is it possible to set Hot Keys to load different screens or panels?

  Ahh. You cannot as yet. I havent adding a call for a screen swap, though I plan to. I just havent had to as yet.

Thx
Art

satco
Site Admin
Posts: 28
Joined: Tue Jan 19, 2016 4:23 pm

Re: Script+Pokeys

Post by satco »

Hi Art,
I test following:

pinstate = Pokeys1.GetPinDig(9);
if( pinstate == 1 )
    {
  print("pinstate"+1);
    }
else
{
print("pinstate"+0);
}

It works good. Then I test:

global  MonitorPin9 = function()
{
  while(1)
  {
    block( "MotionPin9");
    pinstate = Pokeys1.GetPinDig(9);
    if( pinstate == 1 )
    {
  print(" pinstate");
    }
  }
};
MonitorPin9();

I have no reaction on Pin9 changes. Where is error? The same result with "IOPin9".

Best regards,
Anatolii.
ArtF
Global Moderator
Global Moderator
Posts: 4556
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: Script+Pokeys

Post by ArtF »

Anatolii:

Hmm, I just tried this in the script window as a test..

block("MotionPin1");
print("Done");


  Run that script and the script light should stay flashing. Its waiting on the block.
When I jumper pin1 to ground, the word done is printed in the log and the light stops flashing.

Can you try that test for me? Seems to work here, the block gets released if I go from 1 to 0 or 0 to 1..

Thx
Art
satco
Site Admin
Posts: 28
Joined: Tue Jan 19, 2016 4:23 pm

Re: Script+Pokeys

Post by satco »

Hi Art,

I set "NO" button among Pin1 and GND. In NO condition Pin1 hase 3.7V. In NC Pin1 hase 0V.

I have tested:
block("MotionPin1");
print("Done"+Pokeys1.GetPinDig(11));


I push Button to NC and wait in this condition. The word "Done0" is printed in the log and the light stops flashing.
So the block gets released if I go from 1 to 0.

My mistake is I try to set blok to Pin9. Pin9 in my Hard is DigOut :)

Best regards,
Anatolii.
ArtF
Global Moderator
Global Moderator
Posts: 4556
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: Script+Pokeys

Post by ArtF »

Anatolii:

lol, makes sense. I do such things as well. Glad to hear it works. You can also block on multiple options if you like.. for example...


myblock = block( "MotionPin9" , "IOPin9", "MotionPin11");

if( myblock == "MotionPin9" ) { .......do whateer" };

etc..

  Just so you ( and anyone else working with blocks.. ) knows.

  This makes it possible to write one script that monitors and deals efficiently with multiple pins.
This can save a lot of scripting in multiple scripts. Its unknown how many you can run simultaneously..
Ive run up to 50 scripts at once while Gcode runs as a test, but Im assuming this depends on CPU
power and your system. Not many people run Auggie , so it will take awhile for limitations to be
figured out fully. All I know is it runs my laser pretty good. :)

Art

satco
Site Admin
Posts: 28
Joined: Tue Jan 19, 2016 4:23 pm

Re: Script+Pokeys

Post by satco »

Hi Art,

Auggie like a sleeping Dragon. I will be very glad to help you wake him up. If I can to test or make  anything else, let me know please.

Is it possible to block an Analog Input. If input signal change - start script? It will be a very powerful tool to work with analog signals.

Best regards,
Anatolii.
Post Reply