Hi Michael,
You could use 6 KMotionCNC User buttons to select the Axis and MPG Rate. Unfortunately there wouldn't be any indication of what axis was selected.
Again please check that the encoder AB signals are toggling on the Digial IO Screen.
This section of the MPG Program selects the axis that the MPG moves. If none of these are set then no axis will move (which is probably why there is no motion):
if (ReadBit(28)) // is x selected?
ch0->Dest += Change1 * Factor;
else if (ReadBit(29)) // is y selected?
ch1->Dest += Change1 * Factor;
else if (ReadBit(30)) // is z selected?
ch2->Dest += Change1 * Factor;
Let's change these to Virtual IO bits 48,49,50 (instead of real inputs 28,29,30).
Then use the Digital IO screen in KMotion.exe to set one of the Virtual Bits High and see if that axis indeed moves.
If that all works you could create User buttons to set one of 3 bits. ie:
SetBit(48);
ClearBit(49);
ClearBit(50);
Regards
TK
| Group: DynoMotion |
Message: 4551 |
From: Michael Rosenfield |
Date: 4/12/2012 |
| Subject: Re: KMotionCNC questions |
TK, What would it take to use the radio buttons for step size already on the KMotionCNC screen for the MDI step size as well? Thanks, Michael
| Group: DynoMotion |
Message: 4552 |
From: Tom Kerekes |
Date: 4/12/2012 |
| Subject: Re: KMotionCNC questions |
Hi Michael,
You should look through the code and see if you can understand things. Open the BuildExample solution to see if you can re-build the code and set breakpoints. To be able to debug you will need to open the BuildAllLibs solution and build the debug versions of all the libraries. This just involves opening the solutions and select build solution.
Here are the event functions in KMotionCNC that are called when the user makes step size selections
void CKMotionCNCDlg::OnStep0()
{
UpdateData();
}
void CKMotionCNCDlg::OnStep1()
{
UpdateData();
}
void CKMotionCNCDlg::OnStep2()
{
UpdateData();
}
void CKMotionCNCDlg::OnStep3()
{
UpdateData();
}
void CKMotionCNCDlg::OnStep4()
{
UpdateData();
}
void CKMotionCNCDlg::OnStep5()
{
UpdateData();
}
Currently all that happens is all the screen control data is updated into member variables which includes
DDX_Radio(pDX, IDC_Step0, m_StepSize);
You might then insert calls to do something like set a persist variable in KFLOP with
TheFrame->KMotionDLL->WriteLine( "SetPersistDec 20 4");
Your KFLOP MPG program could then check the persist variable to use the appropriate step size
Good luck
TK
| | | |