reading Pokeys pins

C Scripting questions and answers
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

xx = Engine.GetAxisPos(3); this seems to return a random number if the Z axis is set to 0.
if i set the Z to .5 it will return the correct value, just seems to return a bad number at or around 0.
the x (1) and y (2) are fine they will return a 0 correct number..

GlobalGet Axis3 works corrent returns a 0

Sorry figured it out had to convert ToInt now works...

Thanks gary
Last edited by gburk on Thu Nov 14, 2019 3:34 pm, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Sounds like things are working mostly well. Sorry Ive been only
intermittently. Im testing some code for clubfoot escapements, once Im
finished up Ill look in Auggies direction again as I have some things
Id like to flesh out.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

No problem thanks for you work and a lot of help..

I'm hoping that removing the latest print statements may help with not having to slow down feed rates for the smaller holes..

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Having some trouble with dowhile and while loops

maybe i 'm just confused go figure..

Anyway can you call a function from the while loop, and in the function you are call have a while loop also?
And if i call the function is there a way not to reset the variable's each time its called..
say i have a loop counter in the second function, i don't want to reset the counter every time i call that function, there may be 3 or 4 values i don't want to reset..

there is no way to a goto, or use a sub in a script right..

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

>>Anyway can you call a function from the while loop, and in the function you are call have a while loop also?

  yes. shouldn't be an issue.

>>And if i call the function is there a way not to reset the variable's each time its called..
say i have a loop counter in the second function, i don't want to reset the counter every time
i call that function, there may be 3 or 4 values i don't want to reset..

  Unless their global var's they will reset. You could use global vars and
have a reset routine as well, but there is no real support for static I dont think.

>>there is no way to a goto, or use a sub in a script right..

  No, other than conditional breaks , there isnt much for loop control. Best you can do is clever design of
scripts called that use globals with other scripts to set them to defaults.

Art


gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Thanks Art

I thought global's would be the only way but just in case i figure i'd ask..., if you don't ask no matter how dumb it may sound you will never know..

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Been working with the % bar.
Is there a way that every time the bar is moved, slide up down to call a function?

It has a var name, but if i create a function with that var name, its not called to that global function.
I know how to get the value from the slider i just wanted to do some stuff every time it's moved..

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Ill check. As I recall as long as a function is named it will be called when the slider changes,
but I may have turned that off for traffic control.. too many calls.. I'll check and see.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Thanks art

Was hoping i'd catch you before you made the change to enable Reading %bar, if you could remove the prints you added for the feed rates.
Wanted to see if that had any effect on having to use  slower feed rate's when probing smaller holes..

Gary 
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Ill do that as well..
Probably by end of weekend..

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Found a rather serious error in the messaging flow for the control scripts.
I think I have it fixed, still testing, be out this weekend I suspect.

Thx
Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Thanks when ever you get time, I'm trying to get my scripts a little more organized before i post them there all over the place. also hopefully a short video for each one i'm really not good at video's..


Gary 
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I think its working now. The slider should give a message at most 10 times a second when moving.
I will post it tomorrow. There was a serious error in its messaging queue. This may also affect buttons
and some other controls, but I cant see any effect as yet. So Ill put it out tomorrow and we'll see how
it works.

Thx
Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Will give it a run, if there's a problem I always seem to run into it.. and will let you know..

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  New version is online now. It should give proper calls to scripts when controls are changed.

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests