Hello Guest it is April 24, 2024, 12:31:46 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - iceblu3710

Pages: 1
1
Im trying to integrate my keyboard hook program into a form in my mach 3 plugin.

I have included my project (created as 'CustomPlugin' and compiles and works great) as well as my stand alone KeyboardHook project that also works by itself

Here are my questions:
1) To use my keyboard hook it should be as simple as adding the Kennedy.ManagedHooks.dll to the references and then initilize the component as:
Code: [Select]
private Kennedy.ManagedHooks.KeyboardHook keyboardHook = null;
keyboardHook = new Kennedy.ManagedHooks.KeyboardHook();
keyboardHook.KeyboardEvent += new Kennedy.ManagedHooks.KeyboardHook.KeyboardEventHandler(Hook_KeyboardEvent);

then call install in a button:
Code: [Select]
void CPluginTestDlg::OnBnClickedHookInstall()
{
//  Install Keyboard Hook
DbgMsg(("keyboardHook Installed"));

//keyboardHook.InstallHook();
}

void CPluginTestDlg::OnBnClickedHookRemove()
{
//  Remove Keyboard Hook
DbgMsg(("keyboardHook Removed"));

//keyboardHook.UninstallHook();
//keyboardHook = NULL;
}

But I have no idea where to initialize my object! I have tried it in my CustomPluginInit.cpp's header, in myPostInitControl() and all no luck compiler throws errors. Where should I initialize this object?

2) General issue I don't understand. If I use project wizard and make a blank document then add a forum I can add things like textboxes. In my plugin project I cannot add test boxes.

3) General issue is that for some reason in all my other project having variable = null; is correct, 'null' is blued as normal but in my plugin project compuler says 'null' is not defined but I can use 'NULL' and the error clears but NULL does not blue.

Anyone know if I have some random setting messed up that is causing my issues?

Thanks!

2
Mach SDK plugin questions and answers. / Plugin Function Polling Speed
« on: December 27, 2009, 12:38:33 AM »
I have been trying to write a controller app for my keyboard encoder project and am considering move it into a plugin as the Cypress Enable language is to limited for my needs and using Visual Basic in an outside app works but provided stuttered movement. So I am going to test out the plugins capabilities and see where this takes me. My question is:

I saw in the code and videos that the Update() routine is called ~10 times a second and Art's explanation on setting the engine dir/vel/accel parameters and then jog = true was very helpfull but alot of movement can happen in a 100ms period I would think.

Is this internal 10Hz call cycle the fastest any given plugin will ever be able to run? I inquire as if I spin my encoder any faster that that It will loose steps and it causes many issues for me. (eg 100 ppr encoder, quadrature decoded is 400 ppr, 1 second rotation I want my jog function to be updated every 2.5ms)

What am I missing here?

EDIT:

Also I want to load up the JoyStickPlugIn from the SDK examples download but I get errors about wrong defs and need ; before things that are obviously right. How do you guys recommend setting up my environment and placing my projects so its easiest to code?

I copied the JoyStickPlugIn folder to C:\Mach3\PlugIns and setup in the linker ../JoyPlugin.dll and in debugger run C:\Mach3\Mach3.exe in the runtime folder C:\Mach3\ just as in arts video. Do I need to setup includes to wherever mach has its includes hidden? I have installed Mach3Wizard and its default projects will build without error.

3
VB and the development of wizards / Detecting Button Presses
« on: December 21, 2009, 12:34:39 AM »
I want to write a script or brain that detects keyboard button states.

Specificly I have an encoder wired to my keyboard so that it produces quadrature of:
Down A, Down B, Up A, Up B and I would like to map this to mach so that I can use my keyboard encoder rig to jog.

Anybody have an idea how to even start this? I did not see any keyboard button abilities in the cypress pdf.

Thanks!

4
General Mach Discussion / Mapping Mach Functions To My Keyboard
« on: December 13, 2009, 10:21:41 PM »
I am having some trouble mapping my everyday functions to my keyboard. I currently have buttons hidden in my screen set with my hotkeys setup but these few I dont know how to make work correctly:

1) Spindle Stop, is it OEM Code 182 (??? Toggle Spindle Actual)
2) Flood/Mist I want to have a coolant off button but I see no OEM code for that, Only way I can think of it is to use 'G-Code Function' and call a macro that does OEM Codes 225 & 227. OR use the VB Script button but im not sure how to tie a script to that button.
3) I want a Retract Z in my job control for easy checking of things such as surface finish or clearing out chips/islands do I need to write a macro for this as well or is their a code already?
4) The big daddy question, I want to have jog control setup as my picture says but I dont know how to select what axis the mpg effects.

Cycle axis controlled by MPG 1   175      cycles with one button while
Select encoder jog on axis X     259      should allow me a button for each axis

but neither of these buttons are doing anything....

5) what other shortcut buttons do you guys find very handy when running jobs? I think I have everything I usually use but usually don't remember things until i'm in the middle of working.
6) I want to write a VB script that takes a sequence of keyboard strikes in and translates it to mpg pulse and mpg direction (Im going to wire a digikey encoder to two unused keys and replace the scroll wheel with a mini mpg) I have experience with c for microcontrollers but have no idea how to get keyboard input from mach's vb scripts. Anyone know a good post with some examples?

5
Brains Development / My Binary Parallel Port Expander
« on: May 13, 2009, 03:44:41 AM »
Hi all, Ive got a brain problem:

I have attached my brain files as their an pain in the ass to make click at a time but in the files LPT_BCD_6-10 and LPT_BCD_16-20 the lines that handle Output #10 and Output #20 the and logic blocks are on be defualt all the time for me. Its the exact same process I made the other 18 and yet its only out 10 and 20 that are always on. Are these outputs used by Mach3 already or something?

If they are I can get a max of 16 on BCD and use the last port as E-Stop as adding it to the BCD will only add one anyways.

My 2nd question is I believe the data on the parallel port is polled ever what 40us? if thats so then running Mach at 35kHz is ~3us pulse train so your motors have a chance to run ~14 extra steps before reacting to an input. Is that all right? If so I will need to find a 4:16 or 5:32 BCD chip that operates >= 25kHz

I will post my entire project ones Ive got it mostly working for those who are interested, thanks!

NOTE: I found a way around the max 50 rungs and the inputs get stuck highlighted, just select two, add, and choose FORMULA. after you click cancel you can deselect anything you want!

6
Feature Requests / Easy G-Code Scaling
« on: April 25, 2009, 11:13:08 PM »
Hello all,

I am a new user but am loving every day learning new things, so If this feature exists please let me know so I can do it right!

My idea is not so useful to those out there that manufacture parts but for all of the engravers out there I know I'm not the only one who would like to see this feature added. So my idea is an easy way to scale your code. eg:

I make up some code to engrave an image and text on a brass plate and make a test piece but it just doesn't look as good as it could if it was 10% larger, so I open up my motor tuning screen and write down how many steps/rev say 2000 and I want it 10% larger so I put in 2200 and now what was 1" is now 1.1"!

I know I could have just loaded my cam program and scaled it there but this way its 100x quicker and easy to do, I imagine it shouldn't be hard to make a scaling wizard that stores original steps/rev, scales it to your new dimensions and then inputs the original again when the program is complete.

Does Mach3 already have this feature and I look like an idiot or am I onto something here?

7
VB and the development of wizards / Pause milling on G0
« on: April 24, 2009, 10:45:51 PM »
I have a positioning stage under mach3 control and a manual z and desperately require a script that on any G0 the gcode will pause (for say 10seconds or wait for button press) so I can lift the tool when complete the G0 command and wait for me to re-lower the tool.

Can anybody hook me up as I have NO idea where to even start.

In case your wondering im doing engraving and my z has a floating head, the only reason its not under motion control yet is Ive yet to make all the necessary components and need a screw still.

EDIT:

Ok so i re-watched all the videos, I hate visual basic and don't know any syntax but I think i know what sequence of operations im going for now at least. Something like this:

if G0 then
do button 1001 (feed hold)
while input 15 is not on wait
do button 1004 (single step, do the G0 rapid)
while input 15 is not on wait
do button 1005 (resume)

and save the file as G0 so its called automatically on any G0 (I can do it with M's but haven't tried G's yet...) this way I can mount a simple push button on the feed handle of my spindle and easily sit there and go at the entire operation. If i cant use G's as macros then I could figure out how to get Mastercam to put a custom M code before and after a G0 for the same effect.

Pages: 1