Hello Guest it is April 29, 2024, 10:21:26 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.


Messages - sunmix

Pages: « 1 2 3 4
31
hey hi everyone, i've tried it in my mach, for example the code for Macro M3 is like this:

settimer(0)

Code "G0 x2"
Code "G0 x0"
Code "G4 P" & (getUserDRO(1001))

While IsMoving()
Wend
 
ActivateSignal(Output1)
x=GetTimer(0)

SetUserDRO(1002,x)

DRO 1001 is the time that i've set for it to count : for example 10 seconds.
DRO 1002 is the elapsed time that it would show after the action is completed.

When i type M3 on my MDI, it triggers the macro,
and during this process, it should be running for about 16-20seconds.
instead the DR0 1002 shows out 1.6164. what have I went wrong?

32
Hi everyone, i'm facing this problem now,this is my 1st time writing a wizard and I've no idea what i'm lacking of. Don't know where to trace the mistake, as it really makes me confusing. This VB wizard does the profiling of a circle, with a arc lead-in function, for a plasma cutting system. I've done the lead-in, and plan to do the lead-out after i've solved this problem. Can someone help me out?

there are 3 inputs, a lead in arc radius, the circle diameter, and a kerf nozzle width.

Dim LeadInArcRad, XLeadInCenter, YLeadInCenter, StartArcAngle, IncArcAngle, EndArcAngle, CircleDiameter, XStartPoint, YStartPoint, XCircleCenter, YCircleCenter, CircleRad, KerfNoz, KerfTool, KerfExtraCompensation

DoOEM Button (169)
PI = 3.1415926535898

Rem Lead-In Arc Circle 90 Degree Variable Radius
LeadInArcRad = Abs(GetOEMDRO (1050))
XLeadInCenter = -1 * (LeadInArcRad + KerfTool + KerfExtraCompensation)
YLeadInCenter = CircleRad
StartArcAngle = (PI / 180) * 0
IncArcAngle = (PI / 180) * 90
EndArcAngle = StartArcAngle + IncArcAngle

Rem Circle 360 Degree Variable Diameter
CircleDiameter=GetOEMDRO (1051)
XStartPoint = -1 * (KerfTool + KerfExtraCompensation)
YStartPoint = CircleRad
XCircleCentre = LeadInArcRad + KerfTool + KerfExtraCompensation
YCircleCentre = 0
CircleRad = CircleDiameter / 2

Rem Nozzle Kerf Compensation
KerfNoz=GetOEMDRO (1052)
KerfTool= KerfNoz / 2
KerfExtraCompensation= 0.05

If LeadInArcRad = 0 Then
setTicker 20, "How big do you want the lead-in radius arc to be?"
Exit Sub
End If

If CircleDiameter = 0 Then
setTicker 20, "I think you have forgotten to fill in the Circle Diameter!"
Exit Sub
End If

If KerfNoz = 0 Then
setTicker 20, "Hmm, what's the kerf nozzle width?"
Exit Sub
End If

Rem ******************End of If Here And If  There******************

StartX =  Round ((LeadInArcRad + KerfTool)*(Cos (StartArcAngle)) , 4)
StartY =  Round ((LeadInArcRad + KerfTool)*(Sin (StartArcAngle)) , 4)
EndX =  Round ((LeadInArcRad + KerfTool)*(Cos (EndArcAngle)) , 4)
EndY =  Round ((LeadInArcRad + KerfTool)*(Sin (EndArcAngle)) , 4)
If IncArcAngle > 0 Then
 G2_3 = "G3"
Else
 G2_3 = "G2"
End If

If GetIJMode() Then
ArcLeadInXCenterPOS= XLeadInCenter - (XLeadInCenter + StartX)
ArcLeadInYCenterPOS = YLeadInCenter - (YLeadInCenter + StartY)
Else
ArcLeadInXCenterPOS= XLeadInCenter
ArcLeadInYCenterPOS = YLeadInCenter
End If


OpenTeachFile "CutArc.tap"

If GetUserLED(1003) Then
Code "G20 (Inch)"
Else
Code "G21 (mm)"
End If
Code " G53 G90 G40 F3000 M04 "
Code " F25 "

Nc = 1

Counter = 1
Do
     
     CODE "M03"
     CODE " X" & XLeadInCenter + StartX & " Y" & YLeadInCenter + StartY
     CODE g2_3 & " X" & XLeadInCenter + EndX & " Y" & YLeadInCenter + EndY & " I" & ArcLeadInXCenterPOS  & " J" & ArcLeadInYCenterPOS
     CODE g2_3 & " X" & XStartPoint & " Y" & YStartPoint & " I" & XCircleCenter  & " J" & YCircleCenter
          Nc=Nc+1

Code "M05"
Code "G00 Z20"
Code "G00 X0.0000 Y0.0000"
Code "M30"

CloseTeachFile
Call LoadTeachFile()



33
VB and the development of wizards / VB and RS232
« on: November 14, 2006, 09:19:14 PM »
Hi, is there any websites that can explain how to link Rs-232 and VB together? There's an instrument that feedback signals from 0- 200 and I need the VB to detect it so that I can do program what I want to control.

34
VB and the development of wizards / Re: Macro Controlling Multiple Outputs
« on: November 11, 2006, 09:24:51 AM »
Whoa! Thanks!!!! I've been waiting for this moment for a long, long time! Thanks!!!

What's the difference between WEnd, Sub End, and End?

35
VB and the development of wizards / Macro Controlling Multiple Outputs
« on: November 11, 2006, 04:16:10 AM »
Hi, I'm new to this forum, but I have been a Mach user for 2 years, just that I didn't really  play with macros. I'm setting up a oxy control, which control valves of oxy. and acet., to suit the traditional cutting style. As you can see, there are ignition delay, preheat delay and pierce delay, and 3 of them are controlled by 3 different outputs. The problem i'm facing is everytime i trigger this macro script, all the outputs triggers at the same time. I cant get it to delay before triggering another output. Can someone kindly help to neaten up the script? Thanks!

rem  M3 Macro
Dim IgnitionDelay, PreheatDelay, PierceDelay
IgnitionDelay = getUserDRO (1001)
PreheatDelay = getUserDRO (1002)
PierceDelay = getUserDRO (1003)

ActivateSignal(Output1)
code "G4 P" & (IgnitionDelay)

ActivateSignal(Output2)
code "G4 P" & (PreheatDelay)

ActivateSignal(Output3)
code "G4 P" & (PierceDelay)
End

Pages: « 1 2 3 4