Hello Guest it is April 26, 2024, 01:30:47 PM

Author Topic: USB plugin don't fill Trajectories array  (Read 22299 times)

0 Members and 1 Guest are viewing this topic.

USB plugin don't fill Trajectories array
« on: September 21, 2011, 04:59:16 AM »
Hi, sorry for my english!
I develop a plugin for an italian company that use Mach3.
I try to connect Mach3 with USB... before this I try to print in a console data inside Engine->Trajectories array after load a gcode, with this simple code:
Code: [Select]
void USBPlugin::update (void)
{
    if (Engine->TrajHead == Engine->TrajIndex)
    {
        PluginConsole::getInstance()->printMessage("Same positions...");
        return;
    }
    else
    {
        Engine->TrajIndex++;
        PluginConsole::getInstance()->printMessage("New positions...");
    }
}
this function is called by myUpdate().

When I run the application and stop with breakpoint the trajectory elements are all empty.

Can you hel me?

best regards
Marco Giammarini
Re: USB plugin don't fill Trajectories array
« Reply #1 on: September 21, 2011, 06:45:45 AM »
Check my virtual plugin - it does work :-)

http://www.machsupport.com/forum/index.php/topic,17612.0.html
Re: USB plugin don't fill Trajectories array
« Reply #2 on: September 21, 2011, 06:58:25 AM »
Check my virtual plugin - it does work :-)

http://www.machsupport.com/forum/index.php/topic,17612.0.html

thanks for the reply!

i have just see your plugin and i have added this lines to myInitControl function:

Code: [Select]
/* For 1ms timed waypoints... */
MainPlanner->ExTime = .001;
/* For variable ms timing... */
MainPlanner->ExternalType = EX_VMS;
/* Setup external pulse rate */
for( int x = 0; x < 7; x++ )
{
MainPlanner->ExternalPulseRates[x] = 1000000;
}

in this case the data exist in the trajectories array... but the appliccation don't work very well.
This is my step:
1) load gcode example with Mach3Mill profile.
2) press reset button
3) press cycle start...
4) the gcode stop at the third line where the gcode is
Code: [Select]
G90
G49
M3 S15000
G0 X52.000 Y27.663 Z7.472
G1   Z-0.500 F200
G1 X52.000 Y27.663 Z-0.500 F1200
X33.344 Y20.577
X33.197 Y20.535
X33.033 Y20.520
X32.858 Y20.537
...
5) press stop
6) press reset
7) and press another time cycle start
8) after this step i found data in array but in mach3 application the table display don't move and the disply for the axis don't move.

why?

if i disable the plugin, all works well!!

can you help me?

Re: USB plugin don't fill Trajectories array
« Reply #3 on: September 21, 2011, 08:16:54 AM »
Does it work if you run the code in my virtual plugin ?
Re: USB plugin don't fill Trajectories array
« Reply #4 on: September 21, 2011, 08:32:51 AM »
I have VS2003 and I can not compile your plugin.  :(
Re: USB plugin don't fill Trajectories array
« Reply #5 on: September 21, 2011, 08:38:45 AM »
You can download Visual Express 2010 and try. Not sure if 2003 is supported for Mach plugins.
Re: USB plugin don't fill Trajectories array
« Reply #6 on: September 21, 2011, 08:46:13 AM »
One more thing - you may have to install Mach plugin wizzard as well - I think my project refereces some files from there ( instead of SDK)
Re: USB plugin don't fill Trajectories array
« Reply #7 on: September 21, 2011, 08:59:48 AM »
You can download Visual Express 2010 and try. Not sure if 2003 is supported for Mach plugins.

I start to download VS2010 express.... VS2003 is supported, indeed the video tutorial is on VS2003.
Re: USB plugin don't fill Trajectories array
« Reply #8 on: September 21, 2011, 10:07:52 AM »
Re: USB plugin don't fill Trajectories array
« Reply #9 on: September 21, 2011, 05:01:48 PM »
I have run your GCode. As far as I can tell your problem comes from lack of Dwelling support.