Hello Guest it is April 13, 2021, 09:48:48 PM

Author Topic: PMC logic help please  (Read 194 times)

0 Members and 1 Guest are viewing this topic.

PMC logic help please
« on: August 16, 2020, 07:25:17 PM »
Hello all

I have been using the PMC to get a control panel working on my mill - mostly successfully, I just need help with one item to get it 100% please.

I have a variable dial to set my spindle speed override, I read that with a Pokeys 56u and I can get it to work OK.

My trouble is that it works too good and it continually updates the spindle speed override dro every 10 milliseconds which is swamping the GUI and it locks up the screen especially if it is busy with other things going on. I have run a log to see what was causing the lock up and it just spins with the spindle speed override updates.

So I would like some help with the logic required to only update the spindle speed override if it changes by a 1/2 percent or so.

What I have so far:
- I read the register with the Pokeys info in it.
- Perform the maths required to to get that to output a value between 50% and 150%
- Write that to the Mach4 register for the Spindle Speed Override.

What I need please is how to:
- Read the Pokeys register and see if it has changed from the last cycle by more or less than 0.5 percent (both ways up and down) and only if it has changed carry on to the rest of the process and update the Mach4 register.

I am hoping by doing that the screen won't get swamped with updates.

Could some one please explain how to do this - which options to use in the PMC to perform the required logic to filter the changes in the Pokeys register - so if I don't move the dial it doesn't progress past that point to update the Mach4 register.

Thanks in advance
Re: PMC logic help please
« Reply #1 on: August 17, 2020, 03:56:10 PM »
Hi Guys

I have had more thought about this and I guess all I really need to know is if you can do an "OR" function in the PMC?

So if I have one statement that is true it would progress "OR" if another statement was true it would progress but if both were both were not true then it would not progress.

Like if data 1 is less than 10 "OR" data 2 is more then 11 then do task 3 but don't do anything if it's between 10 and 11.

Can I do that? I'm sure I did something like that in Mach3 Brains.

Re: PMC logic help please
« Reply #2 on: August 23, 2020, 01:35:38 AM »
For those that maybe looking for this in the future I have attached a PDF on how to use the contact to get the logic you may want.