Script+Pokeys

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Script+Pokeys

Re: Script+Pokeys

by satco » Tue Aug 09, 2016 5:10 pm

Hi Art,

Ok, I test block and waiting fall.

Best regards,
Anatolii.

Re: Script+Pokeys

by ArtF » Tue Aug 09, 2016 2:50 pm

Hi A:

  It isnt really possible to block on an analogue because I havent set any way to set a range.
Ask me about this in the fall, if I add a couple calls to set a blocking range, it owuld be possible
to block on signal change of more than a set tolerance.Analogues tend to swing, so I was worried abotu too many block calls.

Thx

Art

Re: Script+Pokeys

by satco » Tue Aug 09, 2016 2:11 pm

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.

Re: Script+Pokeys

by ArtF » Tue Aug 09, 2016 11:28 am

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

Re: Script+Pokeys

by satco » Tue Aug 09, 2016 6:27 am

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.

Re: Script+Pokeys

by ArtF » Mon Aug 08, 2016 2:52 pm

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

Re: Script+Pokeys

by satco » Mon Aug 08, 2016 1:29 pm

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.

Re: Script+Pokeys

by ArtF » Sun Jul 31, 2016 4:33 pm


>>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

Re: Script+Pokeys

by satco » Sun Jul 31, 2016 10:22 am

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.

Re: Script+Pokeys

by DanL » Sun Jul 31, 2016 5:35 am

you can see what it is

Top