reading Pokeys pins

C Scripting questions and answers
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Just an update I was able to get the m8 working right with cambam now...

But one problem, still having the m6 called twice on first run...

if I run stop and run the g code again its fine, seems only when the code is first loaded then run to runs the first m6 t twice..

Do you think the buffer underrun I get when running the freeaxis's will be a problem?..

told you I'd have more questions..

do you want a new copy of the g code its not much different other than m8 is where it should be and m3 now has the S in the g code..

Also I don't think I ever mentioned this but 98% of the time when I shut auggie down it close's them reboots it's self..

Gary
Last edited by gburk on Thu Jul 11, 2019 10:11 pm, edited 1 time in total.
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

>>if I run stop and run the g code again its fine, seems only when the code is first loaded then run to runs the first m6 t twice..

  Ill continue to try to find that one, I have seen it occur, just not repeatable for me for
some reason.

>>Do you think the buffer underrun I get when running the freeaxis's will be a problem?..

  Hard to say. Buffer Underrun means for some reason the system ran out of data
from a planner. OR it may feel its out of position, so let me know if you see
ill effects, as your doing mill work your stressing the program more than most
of us with lasers.

>>Also I don't think I ever mentioned this but 98% of the time when I shut auggie down it close's them reboots it's self..

  Sign of an internal memory fault as it shuts down, Some windows will restart the
program in such an event, others wont. I suspect the scripting has some dangling
memory at times, and as it trys to delete it at shutdown it creates a memory
fault. Doesn't matter at that point really, but windows see's it as an error and
restarts if the group policy tells it to.

Art




gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

I don't think there is much going on when I run freeaxis all other motion had stopped.., so far I haven't seen any problem with the buffer underrun message..

I have a pokeys board question don't know if you will have an answer...

I ended up putting 2 more relays in so if I wanted to switch from pokeys control to manual,  so the switch and relays turn on the spindle and forward relays but of course there still connected to the plugs in the pokeys relays.. so if there is no power going to the pokeys and I turn on the manual relays it seems to power up the pokeys I assume it is feeding back somehow though the pokeys relays and powering the pokeys board do you think it should back feed power to the pokeys and the pokeys power up like normal..  I know weird question if its there or not I will make it happen..

Gary
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Have a question about reading and writing to files,
How can that be handled with a script, I tried a few ways I have done it in c++ and c but not having any luck getting it to work..

Thanks gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Script commands do exist for several file interface commands
in script. What kind of file are we talking... text, binary, data, gcode?


Art
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  As a general guide, if you look in the scripters command list
youll see many file functions. To access them you use this syntax..

myfile = system.File();
myfile.Open("*"); //using a * will open a search dialog. A name will open that file.

you may then use the other file primitives on the myfile object.

Art
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Here is a sample script using the file system for spirals.
It is written by YaNvrNo awhile back during development.

Art
You do not have the required permissions to view the files attached to this post.
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

OK thanks ART

at the moment I just wanted to save text file or read text files..

I am attaching another g code file its pretty busy has pocketing peck drilling and engraving, I did a dry run in auggie and it seemed to run fine but still calls the first m6 twice, maybe you can see something in this one you couldn't see in the other g code file I sent you..

Thanks gary
You do not have the required permissions to view the files attached to this post.
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Is this a good way to read a file or do you suggest a different approach ?

global next_line = table();

myfile = system.File();
myfile.Open("*");
line = 0;
next_line[line] = myfile.ReadLine();
while (next_line[line] != EOF)
  {
    line = line + 1;
    next_line[line] = myfile.ReadLine();
    if (next_line[line] == null)
    {
      exit();
    }
    print(next_line[line]);
  };

Gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Looks as efficient as any script ID write. Good job.

Art
Post Reply