Hello Guest it is March 28, 2024, 10:20:57 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 - zach3

Pages: 1
1
Thanks for the reference, though page 34 is GetOEMDRO and page 78 is MinX. I do set GetOEMDRO on page 33 and SetTimer on page 115. I found a list of OEM LED #'s - seems like LED 116 might be the "Run" light?

I still don't see SetTimer as being capable of millisecond accuracy. It appears to only resolve to seconds. Has anyone accually used SetTimer & GetTimer to track MILLISECONDS?? Thanks!

2
Thanks much for your responses. I'm still a bit confused, though. I have the Mach3 VB programming guide, but don't see anything about SetTimer() & GetTimer or about LED states. It would be very helpful if someone could answer the following 2 questions and provide a brief code example:

1. How do I use SetTimer() so that it continues running throughout the cycling of the macropump, without resetting the timer each time the macropump loops (I need the total elapsed time of given Mach3 session)? Maybe that time already operates this way by default?

2. Ideally, I'd like to have a loop within the macropump that only fires if a Gcode file is running. This way, the macropump would of course always be running while Mach3 is open, but my code would only run while my machine is moving. Can maybe do this by listening for LED states to trigger an IF statement? Or would this be done another way?

Thanks!


3
I'm aware that the macropump runs continuously and will be appending the file the whole time - that should be fine :-)  What confuses me is how to set a timer once and not have it reset each time the macropump runs. Is there a way to section off a chunk of the macropump to only run the first time in a session? Also, I haven't found any documentation for GetTimer() and SetTimer(). Are these automatically formatted to milliseconds, or do I need to set them that way? Thanks!

4
Yes, I'm after an absolute time value. That said, getting an absolute start time and then incrementing from there would be fine, as long as the increments were representative of real-time measurements.

5
I'm running a Mach3 MacroPump script that gets the current time and positions for the x and y axis, and then appends this info to a text file. I need the time resolution to be in milliseconds, but can't find a way to get anything better than seconds with the Cypress Enable functions. Does anyone know a way to do this? It seems like Visual Basic has millisecond formatting for its time fetching functions, but I can't get any of these functions to work in the MacroPump, and Cypress Enable's Time(Now) function that I am currently using doesn't seem to accept any millisecond formatting parameters. Here is my current code for reference:

  Dim t As String                            
  Dim x As Double
  Dim y As Double
  Open "C:\Mach3\macros\Dual_Axis_Test_Stand\timePositionLog.txt" For Append As #1
    t = Time(Now)
    x = GetDRO(0)
    y = GetDRO(1)
    Print #1, t
    Print #1, x
    Print #1, y
  Close #1

Pages: 1