Hello Guest it is April 23, 2024, 09:00:35 AM

Author Topic: Screen Set Ideas  (Read 184933 times)

0 Members and 2 Guests are viewing this topic.

Re: Screen Set Ideas
« Reply #180 on: November 15, 2014, 01:39:12 PM »
Ooo, ooo, ooo!  Thanks, that's the kick starter!
Re: Screen Set Ideas
« Reply #181 on: November 15, 2014, 07:01:27 PM »
Just so you can see Darwin works with MPG, thou i have to admit I was rushing it a bit and was ahead of the speed set.

https://www.youtube.com/watch?v=l715pq7cis8
Re: Screen Set Ideas
« Reply #182 on: November 15, 2014, 07:18:46 PM »
The video brings us back to: How do you read the MPG outputs in Mach 4?
Re: Screen Set Ideas
« Reply #183 on: November 15, 2014, 08:44:23 PM »
Did you setup encoder 0 in Darwin for the MPG A & B (like pins 11 & 12) you have the MPG hooked to 5 volts and a ground?
make sure you test in Darwin to make sure you are getting the counts to read up and down as you turned the dial?
should see multiples of 4 counts up and back.

Once that's done you just use the functions I'd provided placed in a script under a toggle button.
0=encoderid from darwin
0=X axis in mach4
1=Y, 2=Z and so on
So when the button is down it accesses the axis and mpg you want and when up make sure you set the increments back to 0.

It's pretty simple, the hard part is setting up multiple dials and mapping, but really its just time consuming. Works sweet.
Re: Screen Set Ideas
« Reply #184 on: November 15, 2014, 10:51:24 PM »
Actually, I have three shaft encoders that I use in Mach 3 driving the DROs on the settings tab.  Works great as DROs when in manual mode.
I can configure them in Darwin and see the counts increment / decrement, multiples of one, not 4.  Not sure why you see multiples of 4.
Anyway, if I can get that test working, then I'll try to set them up to drive the mouse wheel routine in manual mode just as a software test, nothing practical.  If that works, I can try to set up the DROs I want to replicate the ones in Mach 3.

Should keep me busy past Thanksgiving.
Re: Screen Set Ideas
« Reply #185 on: November 16, 2014, 06:16:25 AM »
I set it to four because these are quadrature signals

http://www.ni.com/white-paper/4763/en/

and the functions I provided is for the MPG hand dial, has little to do with the mouse scroll wheel example, other than that was my lesson in the logic.
Re: Screen Set Ideas
« Reply #186 on: November 16, 2014, 11:53:13 AM »
Yes, I too have quadrature encoders as well as an index output for super accurate homing.  Quadrature with the 500 line pair wheel gives me 2000 counts per rev.  Darwin also shows 2000 counts per rev so everything is working right there.  In fact, I'm not sure where you can set the number of counts per pulse in Darwin  It seems to be just one.
I plan to mix your function calls with some of the stuff from the mouse wheel example for a proof of concept (and learning tool).  I should be able to get Mach 4's DROs to increment / decrement by turning my hand wheels (remember I'm in manual mode so no motor action).  Just substituting an encoder for the mouse wheel.  Not useful in itself but paves the way for other stuff.

Peter
Re: Screen Set Ideas
« Reply #187 on: November 18, 2014, 07:23:26 AM »
liked the feature so much I created a toggle button to turn it on and off and added the other motor count values
Add toggle button, I named it togCounts
Labeled the Text Up and Down condition
set the Button Color and Text Color in both the Up and Down states
Then put this code is at the bottom of the PLC script

Code: [Select]
local togcountButState = scr.GetProperty("togCounts","Button State", "Button State",'0');
if (togcountButState = '1') then
    counts0,rc = mc.mcMotorGetPos(inst, 0, 0);
    counts1,rc = mc.mcMotorGetPos(inst, 1, 0);
    counts2,rc = mc.mcMotorGetPos(inst, 2, 0);
    counts3,rc = mc.mcMotorGetPos(inst, 3, 0);
    counts4,rc = mc.mcMotorGetPos(inst, 4, 0);
    counts5,rc = mc.mcMotorGetPos(inst, 5, 0);

    if (oldcounts0 ~= counts0 or oldcounts1 ~= counts1 or oldcounts2 ~= counts2 or oldcounts3 ~= counts3 or oldcounts4 ~= counts4 or oldcounts5 ~= counts5) then
        mc.mcCntlSetLastError(inst, "Counts".." X = "  ..tostring(counts0).." Y = " ..tostring(counts1).." Z = "  ..tostring(counts2).." A = " ..tostring(counts3).." B = " ..tostring(counts4).." C = " ..tostring(counts5));
        oldcounts0 = counts0;
        oldcounts1 = counts1;
        oldcounts2 = counts2;
        oldcounts3 = counts3;
        oldcounts4 = counts4;
        oldcounts5 = counts5;
    end
end

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Screen Set Ideas
« Reply #188 on: November 21, 2014, 12:07:02 PM »
Craig I "LIKE" the Tool table idea. A couple of questions .Did you build the table or modify the stock table.

Could it be made to SORT a couple of the columns like Dia , Description , Tool Number ???

Can it be made AS a page not a popout window.

IF you ever used teh HAAS tool table you will be spoiled. Yours looks similar.

Good Job, Care to share ??

(;-) TP
Re: Screen Set Ideas
« Reply #189 on: November 21, 2014, 12:58:59 PM »
Thanks but well it was from the basic grid pattern and I developed my own layout
and yes it can be sorted and I suppose it could be a page
but 6 months ago I could not spell Lua

And as far as Haas kind of where i got some of the idea from so yep have used it.
no where ready for prime time yet.

But Thanks, nice to hear  :-*