Hello Guest it is January 20, 2021, 09:08:03 PM

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.


Messages - ggagnon

Pages: 1 2 3 4
1
Thank you Bob and Craig, with your help I finally begin to see the light at the end of the tunnel  :)
Gaston

2
Hi Craig,
If my understanding is correct, there is a register automatically associated with each dro that I added to my panel with the screen editor.  And when I write to that register, the content of the dro changes accordingly. Is this correct?

Then how do I know the number of the register that was automatically associated with my DROs ?
Gaston

3
Hi,

With Mach4 screen editor I create a button that I called setCamOffset and two dros called droCamX and droCamY.

When I click the button I want the actual XY coordinates of the tool to be copied to my dros like:

droCurrentX --> droCamX

droCurrentY ==> droCamY

I wrote the following script for the button (without the line numbering):

1. local inst = mc.mcGetInstance()
2. local Xcoords = scr.GetProperty("droCurrentX","Value")
3. local Ycoords = scr.GetProperty("droCurrentX","Value")
4. scr.SetProperty(inst,"droCamX",tostring(Xcoords))
5. scr.SetProperty("droCamY",tostring(Ycoords))

Problem:  Nothing is being written to my dros .

What is wrong with this script? Do I even use the right functions for the job?

Thanks for your time,
Gaston

--

http://public.fotki.com/Gaston-Gagnon/

4
Yes, I am using DazTheGas's XBox controller example as the basis for getting acquainted with mach4 programming. Thanks DazTheGas for you very useful video on this.

Steve, you code snippet is promising. I think get the idea .

At this time I can write the script and incorporate it in the screen.  But I have some errors and I need to run in debug mode with the xbox connected.

I could certainly appreciate some pointers on how to do this as I did not have much success so far.

Thanks for you help,
Gaston
 

 
 

5
Is this is what you mean?
   Yval=GetXin("LTH_Y_Val")

   if  Yval > 25  or Yval < -25  then
      if Yval >25 then
         mcJogVelocityStart(mInst,mc.Y_AXIS,MC_JOG_POS)
      else
         mcJogVelocityStart(mInst,mc.Y_AXIS,MC_JOG_NEG)
      end   
   else
      mcJogVelocityStart(mInst,mc.Y_AXIS,MC_JOG_STOP)
   end

Something must be missing, nothing moves.

6
Thanks Craig, let see if this makes more sens.
I am writing a script to control Mach4 with a Xbox360 device. If that matter, the screen set used is Wx4. The Xbox360 plugin is written by DasTheGas.
https://www.machsupport.com/forum/index.php?topic=33121.50

My goal is to use the jogging screen as it is but actuate the jogging buttons: x+,x-,y+,y-,z+,z- with the controls of the xbox360.
I have not found a function to simply press and release a screen button like X+

Any thought on how this can be done or simply a function mc.mc??? or a snippet of code to achieve this?

Thanks for your help,
Gaston

7
Same message, just made the object a bit more significant if that can help.

8
Mach4 General Discussion / how to press a button within a script
« on: May 15, 2019, 08:53:08 PM »
Newbie to mach4 coding here, sorry :-\

What function can I use to actuate one of the jogging buttons: x+,x-,y+,y-,z+,z- as if I was using the mouse but from within a script?
Thanks,
Gaston
 
 

9
Bingo, that does it.
I had forgotten that a macro could be executed when mach3 starts.
Thanks,
Gaston

10
Thanks Klaus,
That will solve my problem,
Two questions:
 How to assure the led is off when Mach3 starts?
 Is there a way to prevent Machscreen's editor from inserting tabs automatically?

Gaston

Pages: 1 2 3 4