Attribute VB_Name = "modElettronica"
Public ProbeStatus As Integer '0 = Down, 1 = Up
Public FlagIlluminazione As Boolean
Public VisionRefPt As String

Public lngDeltaLaserProbeAX As Long
Public lngDeltaLaserProbeAY As Long
Public lngDeltaLaserProbeBX As Long
Public lngDeltaLaserProbeBY As Long

Public lngDeltaStepX As Long
Public lngDeltaStepY As Long
Public lngX1StepX As Long
Public lngY1StepY As Long
Public lngX2StepX As Long
Public lngY2StepY As Long
Public intNumStepX As Integer
Public intNumStepY As Integer
Public intContatoreTotale As Integer
Public intContatoreRiga As Integer
Public intContatoreColonna As Integer
Public intContatoreRigaRitorno As Integer
Public lngTlasRefX As Long
Public lngTlasRefY As Long
Public lngTProbe1RefX As Long
Public lngTProbe1RefY As Long
Public lngTProbe2RefX As Long
Public lngTProbe2RefY As Long


'''AutoFocus'''
Public Ref1FocusX As Long
Public Ref1FocusY As Long
Public Ref1Ang As Single
Public Ref2FocusX As Long
Public Ref2FocusY As Long
Public Ref2Ang As Single
Public Ref3FocusX As Long
Public Ref3FocusY As Long
Public Ref3Ang As Single
Public Ref4FocusX As Long
Public Ref4FocusY As Long
Public Ref4Ang As Single

Public RRef1FocusX As String
Public RRef1FocusY As String
Public RRef1Ang As String
Public RRef2FocusX As String
Public RRef2FocusY As String
Public RRef2Ang As String
Public RRef3FocusX As String
Public RRef3FocusY As String
Public RRef3Ang As String
Public RRef4FocusX As String
Public RRef4FocusY As String
Public RRef4Ang As String

Public TmpLetturaA As Single
Public TmpLetturaPos As Long

Public CalFocusPos As Long
Public CalFocusANG As Single
Public RCalFocusPos As String
Public RCalFocusANG As String

Public DxM As Single
Public DyM As Single
Public DwXL As Single
Public DwYL As Single

Public DwFocus As Single
Public AdjWFocus As Single
Public AdjWFocusPP As Long
Public StartCutXPP As Long
Public StartCutYPP As Long
Public VarWXmm As Single
Public VarWYmm As Single

Public Ref1FocusXmm As Single
Public Ref1FocusYmm As Single

Public StepFocus As Long
Public AutoFocusType As Integer
Public AutoFEnable As Integer
Public OffSetFocusX As Long
Public OffSetFocusY As Long

Public FocusPos As String

Public PositionTableIn As Long
Public PositionTableOut As Long
Public FlagTavolaInOut As Integer
Public FlagVuoto As Integer

Public FlagRipFiltri As Integer

Public OffSetPuntaliX As Long
Public OffSetPuntaliY As Long

Public OldRefX As Long
Public OldRefY As Long
Public OldRefAX As Long
Public OldRefAY As Long
Public OldRefBX As Long
Public OldRefBY As Long

Public OffSetVisManX As Long
Public OffSetVisManY As Long
Public WaitVisioneManuale As Integer
Public EditMode As Integer

Public PowerTrim As Single
Public PsiTLasReferenceX As String
Public PsiTLasReferenceY As String
Public DelayAfterTrim As Single


Public Sub ProbeUp(Optional UpStatus As Integer, Optional intPuntaleDaAlzare As Integer)
    Static UpStartTime As Long
    Static UpStopTime As Long
    
    
    Call resetoutput(0, d0.O_Puntali_Contattazione)
    UpStatus = 1
    ProbeStatus = 1
    Call Delay(300)
    Exit Sub
    
    If UpStatus = 1 Then Exit Sub
    UpStatus = 1
    Call readdevice(0, 0, 5)
    If (d0.I_Puntali_Alti_Probe1 = 0 Or d0.I_Puntali_Alti_Probe2 = 0) Then ProbeStatus = 0
    If ProbeStatus = 1 Then Exit Sub
    UpStatus = 0
    UpStartTime = timeGetTime
    Select Case intPuntaleDaAlzare
    Case 0
        Call resetoutput(0, d0.O_AbbProbe_1)
        Call resetoutput(0, d0.O_AbbProbe_2)
    Case 1
        Call resetoutput(0, d0.O_AbbProbe_1)
    Case 2
        Call resetoutput(0, d0.O_AbbProbe_2)
    End Select
    
    Call readdevice(0, 0, 5)
    Select Case intPuntaleDaAlzare
    Case 0
        Do While Not (d0.I_Puntali_Alti_Probe1 = 1 And d0.I_Puntali_Alti_Probe2 = 1)
            Call readdevice(0, 0, 5)
            DoEvents
            UpStopTime = timeGetTime
            If UpStopTime - UpStartTime >= 2000 Then
                Call MsgBox("Impossibile Alzare I Probe", vbExclamation)
                ProbeStatus = 0
                UpStatus = 0
                Exit Do
            End If
        Loop
    Case 1
        Do While Not (d0.I_Puntali_Alti_Probe1 = 1)
            Call readdevice(0, 0, 5)
            DoEvents
            UpStopTime = timeGetTime
            If UpStopTime - UpStartTime >= 2000 Then
                Call MsgBox("Impossibile Alzare I Probe", vbExclamation)
                ProbeStatus = 0
                UpStatus = 0
                Exit Do
            End If
        Loop
    Case 2
        Do While Not (d0.I_Puntali_Alti_Probe2 = 1)
            Call readdevice(0, 0, 5)
            DoEvents
            UpStopTime = timeGetTime
            If UpStopTime - UpStartTime >= 2000 Then
                Call MsgBox("Impossibile Alzare I Probe", vbExclamation)
                ProbeStatus = 0
                UpStatus = 0
                Exit Do
            End If
        Loop
    End Select
    
    ProbeStatus = 1
    UpStatus = 1
End Sub

Public Sub ProbeDown(Optional DownStatus As Integer, Optional intPuntaleDaAbbassare As Integer)
    Static DownStartTime As Long
    Static DownStopTime As Long
    Static ErrProbe As Integer
    
    
    Call setoutput(0, d0.O_Puntali_Contattazione)
    DownStatus = 1
    ProbeStatus = 0
    Call Delay(300)
    Exit Sub
    
    
    'If DownStatus = 1 Then Exit Sub
    'ErrProbe = 0
    'DownStatus = 1
    'Call readdevice(0, 0, 5)
    'If (d0.I_Puntali_Alti_Probe1 = 1 Or d0.I_Puntali_Alti_Probe2 = 1) Then ProbeStatus = 1
    'If ProbeStatus = 0 Then Exit Sub
    'DownStatus = 0
    'DownStartTime = timeGetTime
    Select Case intPuntaleDaAbbassare
    Case 0
       Call setoutput(0, d0.O_AbbProbe_1)
       Call setoutput(0, d0.O_AbbProbe_2)
    Case 1
       Call setoutput(0, d0.O_AbbProbe_1)
    Case 2
       Call setoutput(0, d0.O_AbbProbe_2)
    End Select
    Call readdevice(0, 0, 5)
    Select Case intPuntaleDaAbbassare
    Case 0
        Do While Not (d0.I_Puntali_Alti_Probe1 = 0 And d0.I_Puntali_Alti_Probe2 = 0)
            Call readdevice(0, 0, 5)
            DoEvents
            DownStopTime = timeGetTime
            If DownStopTime - DownStartTime >= 2000 Then
                Call MsgBox("Impossibile Abbassare I Probe", vbExclamation)
                ProbeStatus = 1
                DownStatus = 0
                ErrProbe = 1
                Exit Do
            End If
        Loop
    Case 1
        Do While Not (d0.I_Puntali_Alti_Probe1 = 0)
            Call readdevice(0, 0, 5)
            DoEvents
            DownStopTime = timeGetTime
            If DownStopTime - DownStartTime >= 2000 Then
                Call MsgBox("Impossibile Abbassare I Probe", vbExclamation)
                ProbeStatus = 1
                DownStatus = 0
                ErrProbe = 1
                Exit Do
            End If
        Loop
    Case 2
        Do While Not (d0.I_Puntali_Alti_Probe2 = 0)
            Call readdevice(0, 0, 5)
            DoEvents
            DownStopTime = timeGetTime
            If DownStopTime - DownStartTime >= 2000 Then
                Call MsgBox("Impossibile Abbassare I Probe", vbExclamation)
                ProbeStatus = 1
                DownStatus = 0
                ErrProbe = 1
                Exit Do
            End If
        Loop
    End Select
    If ErrProbe = 0 Then Call Delay(200)
    ProbeStatus = 0
    DownStatus = 1
End Sub

Public Sub ProbeUpDown()
    If ProbeStatus = 0 Then
        Call ProbeUp
    Else
        Call ProbeDown
    End If
End Sub

Public Sub SetFilter(SFilter1 As Integer, SFilter2 As Integer, SFilter3 As Integer, SFilter4 As Integer)
    If SFilter1 = 0 Then
        Call resetoutput(0, d0.O_Filtro_1)
    Else
        Call setoutput(0, d0.O_Filtro_1)
    End If
    
    If SFilter2 = 0 Then
        Call resetoutput(0, d0.O_Filtro_2)
    Else
        Call setoutput(0, d0.O_Filtro_2)
    End If
    
    If SFilter3 = 0 Then
        Call resetoutput(0, d0.O_Filtro_3)
    Else
        Call setoutput(0, d0.O_Filtro_3)
    End If
    
    If SFilter4 = 0 Then
        Call resetoutput(0, d0.O_Filtro_4)
    Else
        Call setoutput(0, d0.O_Filtro_4)
    End If
    Call Delay(200)
End Sub

Public Function AdjFocusPos()
    If (AutoFocusType = 2) Or (AutoFocusType = 0) Then Exit Function
        
    'Acquisizione Valori del Fuoco
    Call gotoposxy(Str(Ref1FocusX), Str(Ref1FocusY))
    Do While Not moving% = 0
        DoEvents
    Loop
    Call Delay(100)
    Ref1Ang = CalFocusANG - ReadMetro
    
    Call gotoposxy(Str(Ref2FocusX), Str(Ref2FocusY))
    Do While Not moving% = 0
        DoEvents
    Loop
    Call Delay(100)
    Ref2Ang = CalFocusANG - ReadMetro
    
    Call gotoposxy(Str(Ref3FocusX), Str(Ref3FocusY))
    Do While Not moving% = 0
        DoEvents
    Loop
    Call Delay(100)
    Ref3Ang = CalFocusANG - ReadMetro
    
    'Procedura di calcolo fuoco
    DxM = Ref2FocusX - Ref1FocusX
    DyM = Ref3FocusY - Ref1FocusY
    
    DxM = step2mm(CLng(DxM), stepxy!) 'Conversione Passi in mm
    DyM = step2mm(CLng(DyM), stepxy!)
    
    DwXL = Ref2Ang - Ref1Ang 'In mm
    DwYL = Ref3Ang - Ref1Ang
    
    VarWXmm = DwXL / DxM
    VarWYmm = DwYL / DyM
    
    DwFocus = Ref1Ang - CalFocusANG
    
    Ref1FocusXmm = step2mm(Ref1FocusX, stepxy!)
    Ref1FocusYmm = step2mm(Ref1FocusY, stepxy!)
    
    End Function

Public Function ReadMetro() As Single
    Dim MetroIdx As Integer
    Dim MetroNLett As Integer
    Dim TmpLetturaMetro As Integer
    Dim TmpMediaMetro As Long
    Dim TmpReadMetro As Single
    Dim StartTempo As Long
    Dim StopTempo As Long
    Dim StatusTimer As Integer
    Dim StringTmpReadMetro As String
    
    If FrmEuro.tmrMetro.Enabled = True Then
        StatusTimer = 1
    Else
        StatusTimer = 0
    End If
    
    If StatusTimer = 1 Then FrmEuro.tmrMetro.Enabled = False
    MetroIdx = 1
    MetroNLett = 500
    TmpMediaMetro = 0
    TmpLetturaMetro = 0
    
    StartTempo = timeGetTime
    For MetroIdx = 1 To MetroNLett
        ch% = -1
        Do While Not ch% = 3
            DoEvents
            Call ReadAD(1, ch%, TmpLetturaMetro)
        Loop
        If ch% = 3 Then
            TmpMediaMetro = TmpMediaMetro + TmpLetturaMetro
        End If
    Next MetroIdx
    StopTempo = timeGetTime - StartTempo
    
    If ch% = 3 Then
        TmpMediaMetro = TmpMediaMetro / MetroNLett
        FrmEuro.lblMetro.Caption = Str(TmpMediaMetro) + " : "
        If TmpMediaMetro < 2048 Then
            TmpReadMetro = ((5 / 2048) * (2048 - TmpMediaMetro)) * -1
            ReadMetro = Round(((10 * TmpReadMetro) / 5), 3)
        End If
        If TmpMediaMetro > 2048 Then
            TmpReadMetro = (5 / 2048) * (TmpMediaMetro - 2048)
            ReadMetro = Round((10 * TmpReadMetro) / 5, 3)
        End If
        StringTmpReadMetro = Str(ReadMetro) 'Format(Trim(Str(ReadMetro)), "##0.00")
        FrmEuro.lblMetro.Caption = FrmEuro.lblMetro.Caption + StringTmpReadMetro + " : " + Str(StopTempo)
        If TmpMediaMetro = 2048 Then ReadMetro = 0
    End If
    If StatusTimer = 1 Then FrmEuro.tmrMetro.Enabled = True
End Function


Sub updDst(DstMsg As String)
    With FrmEuro
        If Len(.txtDst.Text) > 30000 Then .txtDst = ""
        .txtDst.SelStart = 65535
        .txtDst.SelText = " " + Date$ + ">" + Time$ + Chr$(13) + Chr$(10) + ">   " + DstMsg + Chr$(13) + Chr$(10)
        .txtDst.SelStart = 65535
    End With
End Sub


Function mm2stepS(themmS As Single, thestep!) As Long
    'converte i mm in passi
    mm2stepS = CLng(themmS * thestep!)
End Function
Public Function AdjRefVis() As Integer
    Static RispostaMsgBox As Integer
    Static MessaggioMsgBox As String
    
    AdjRefVis = 0
    'qui va messo il correttore di visione, se abilitato
    Call MoveProbe("1", "1", "145000", "145000", 1, 1)
    Call gotoposxy(TLasReferenceX$, TLasReferenceY$)
    Do
        DoEvents
    Loop While moving% > 0
    gapstepx& = 0
    gapstepy& = 0
    visionfilename$ = thepath1$ + "reference" + lastfile$ + ".vis"
    exf$ = Dir$(visionfilename$)
    If exf$ <> "" And Val(VisionRefPt) = 1 Then 'And gapstepx& = -1000 And gapstepy& = -1000 Then
        'il file di visione esiste
        Call loadvision(visionfilename$)
        thedimim& = 768& * 576&
        ReDim myimage(1 To thedimim&) As Byte
        FrmEuro.Digitizer.Halt
        FrmEuro.Digitizer.Grab
        FrmEuro.Buffer.Get myimage
        FrmEuro.Digitizer.GrabContinuous
        thedimim& = Len(copystring$)
        ReDim mytemplate(1 To thedimim&) As Byte
        CopyMemory2 mytemplate(1), copystring$, thedimim&
        Call findvision(found%, foundx&, foundy&)
        If found% = 1 Then
            AdjRefVis = 1
            vgapx& = (foundx& - TempLeft)
            vgapy& = (foundy& - TempTop)
            gapstepx& = vgapx& * steppixelx!
            gapstepy& = vgapy& * steppixely!
            'visualizza rettangolo verde di found
            FrmEuro.Picfx1.Left = foundx& * Screen.TwipsPerPixelX
            FrmEuro.Picfx1.Top = foundy& * Screen.TwipsPerPixelY
            FrmEuro.Picfx1.Width = (TempRight - TempLeft) * Screen.TwipsPerPixelX
            FrmEuro.Picfy1.Left = FrmEuro.Picfx1.Left
            FrmEuro.Picfy1.Top = FrmEuro.Picfx1.Top
            FrmEuro.Picfy1.Height = (TempBottom - TempTop) * Screen.TwipsPerPixelY
            FrmEuro.Picfx2.Left = FrmEuro.Picfx1.Left
            FrmEuro.Picfx2.Width = FrmEuro.Picfx1.Width
            FrmEuro.Picfx2.Top = FrmEuro.Picfx1.Top + FrmEuro.Picfy1.Height
            FrmEuro.Picfy2.Top = FrmEuro.Picfy1.Top
            FrmEuro.Picfy2.Height = FrmEuro.Picfy1.Height
            FrmEuro.Picfy2.Left = FrmEuro.Picfy1.Left + FrmEuro.Picfx1.Width
            FrmEuro.Picfx1.Visible = True
            FrmEuro.Picfx2.Visible = True
            FrmEuro.Picfy1.Visible = True
            FrmEuro.Picfy2.Visible = True
            dddttt& = timeGetTime&
            Do
                DoEvents
                If timeGetTime& - dddttt& < 0 Then Exit Do
            Loop While (timeGetTime& - dddttt&) < 200
        Else
            MessaggioMsgBox = "Fiducial Non TROVATO" + Chr(10) + Chr(13) + "Posizionare MANUALMENTE ?"
            RispostaMsgBox = MsgBox(MessaggioMsgBox, vbYesNo)
            If RispostaMsgBox = 6 Then
                GoSub VisMan
                Erase myimage
                Erase mytemplate
                Exit Function
            Else
                'errore visione
                cuterr% = 6
                Erase myimage
                Erase mytemplate
                copystring$ = ""
                gapstepx& = 0
                gapstepy& = 0
            End If
        End If
        Erase myimage
        Erase mytemplate
        copystring$ = ""
        'FrmEuro.Digitizer.GrabContinuous
        'DoEvents
        FrmEuro.Picfx1.Visible = False
        FrmEuro.Picfx2.Visible = False
        FrmEuro.Picfy1.Visible = False
        FrmEuro.Picfy2.Visible = False
    End If
    If gapstepx& = -1000 And gapstepy& = -1000 Then gapstepx& = 0: gapstepy& = 0
    If gapstepx& <> 0 Or gapstepy& <> 0 Then
        'correzione spostamento
        TLasReferenceX$ = Str(Val(TLasReferenceX$) + gapstepx&)
        TLasReferenceY$ = Str(Val(TLasReferenceY$) - gapstepy&)
        RefX& = Val(TLasReferenceX$)
        RefY& = Val(TLasReferenceY$)
        Frmedit.txtRefX.Tag = TLasReferenceX$
        Frmedit.txtRefX = formatter$(step2mm#(Val(TLasReferenceX$), stepxy!), 3, 2)
        Frmedit.txtRefY.Tag = TLasReferenceY$
        Frmedit.txtRefY = formatter$(step2mm#(Val(TLasReferenceY$), stepxy!), 3, 2)
        
        '''mario''' Correzzione Puntali
        MasterRefXProbeA = MasterRefXProbeA + gapstepx&
        Frmedit.TxtRefXProbeA.Tag = Str(MasterRefXProbeA)
        Frmedit.TxtRefXProbeA.TabIndex = formatter(step2mm(MasterRefXProbeA, stepxy!), 3, 2)
        
        MasterRefYProbeA = MasterRefYProbeA - gapstepy&
        Frmedit.TxtRefYProbeA.Tag = Str(MasterRefYProbeA)
        Frmedit.TxtRefYProbeA.TabIndex = formatter(step2mm(MasterRefYProbeA, stepxy!), 3, 2)
        
        MasterRefXProbeB = MasterRefXProbeB - gapstepx&
        Frmedit.TxtRefXProbeB.Tag = Str(MasterRefXProbeB)
        Frmedit.TxtRefXProbeB.TabIndex = formatter(step2mm(MasterRefXProbeB, stepxy!), 3, 2)
        
        MasterRefYProbeB = MasterRefYProbeB + gapstepy&
        Frmedit.TxtRefYProbeB.Tag = Str(MasterRefYProbeB)
        Frmedit.TxtRefYProbeB.TabIndex = formatter(step2mm(MasterRefYProbeB, stepxy!), 3, 2)
        
        Hasdone% = 0
        Call gotoposxy(TLasReferenceX$, TLasReferenceY$)
        Do
            DoEvents
        Loop While moving% > 0
    End If
    Exit Function

VisMan:
    '''Visione Manualmente
    Call gotoposxy(TLasReferenceX$, TLasReferenceY$)
    Do
        DoEvents
    Loop While moving% > 0
    
    '''Attiva Jog X Visione Manuale
    OffSetVisManX = -100000
    OffSetVisManY = -100000
    WaitVisioneManuale = 0
    statjog% = 72
    jogging% = 1
    Call setjogpos
    Do
        DoEvents
    Loop While WaitVisioneManuale = 0
    If (OffSetVisManX <> -100000) And (OffSetVisManY <> -100000) Then
        'Laser
        TLasReferenceX$ = Str(Val(TLasReferenceX$) + OffSetVisManX)
        TLasReferenceY$ = Str(Val(TLasReferenceY$) + OffSetVisManY)
        RefX& = Val(TLasReferenceX$)
        RefY& = Val(TLasReferenceY$)
        Frmedit.txtRefX.Tag = TLasReferenceX$
        Frmedit.txtRefX = formatter$(step2mm#(Val(TLasReferenceX$), stepxy!), 3, 2)
        Frmedit.txtRefY.Tag = TLasReferenceY$
        Frmedit.txtRefY = formatter$(step2mm#(Val(TLasReferenceY$), stepxy!), 3, 2)
        
        'Probe A
        MasterRefXProbeA = MasterRefXProbeA + OffSetVisManX
        Frmedit.TxtRefXProbeA.Tag = Str(MasterRefXProbeA)
        Frmedit.TxtRefXProbeA.Text = formatter(step2mm(MasterRefXProbeA, stepxy!), 3, 2)
        
        MasterRefYProbeA = MasterRefYProbeA + OffSetVisManY
        Frmedit.TxtRefYProbeA.Tag = Str(MasterRefYProbeA)
        Frmedit.TxtRefYProbeA.Text = formatter(step2mm(MasterRefYProbeA, stepxy!), 3, 2)
        
        'Probe B
        MasterRefXProbeB = MasterRefXProbeB - OffSetVisManX
        Frmedit.TxtRefXProbeB.Tag = Str(MasterRefXProbeB)
        Frmedit.TxtRefXProbeB.Text = formatter(step2mm(MasterRefXProbeB, stepxy!), 3, 2)
        
        MasterRefYProbeB = MasterRefYProbeB - OffSetVisManY
        Frmedit.TxtRefYProbeB.Tag = Str(MasterRefYProbeB)
        Frmedit.TxtRefYProbeB.Text = formatter(step2mm(MasterRefYProbeB, stepxy!), 3, 2)
        
        Call gotoposxy(TLasReferenceX$, TLasReferenceY$)
        '''mario''' Call MoveProbe(Str(MasterRefXProbeA), Str(MasterRefYProbeA), Str(MasterRefXProbeB), Str(MasterRefYProbeB), 1)
        Do
            DoEvents
        Loop While moving% > 0
        AdjRefVis = 1
    End If
    Return
End Function


Public Sub TableInOut()
    If FlagTavolaInOut = 0 Then
        FrmEuro.Toolbar1.Buttons(10).value = tbrPressed
        Call gotoposz(Str(PositionTableIn))
        Do While Not moving% = 0
            DoEvents
        Loop
        FlagTavolaInOut = 1
    Else
        FrmEuro.Toolbar1.Buttons(10).value = tbrUnpressed
        Call gotoposz(Str(PositionTableOut))
        Do While Not moving% = 0
            DoEvents
        Loop
        FlagTavolaInOut = 0
    End If
End Sub

Sub InizializzaVariabiliPerTaratura()

Call AssegnaValoreVariabile("E10", 1) 'contatore totale
intContatoreTotale = 1
Call AssegnaValoreVariabile("E11", 1) 'contatore riga
intContatoreRiga = 1
Call AssegnaValoreVariabile("E12", 1) 'contatore colonna
intContatoreColonna = 1
Call AssegnaValoreVariabile("E13", intNumStepX + 1) 'contatore riga ritorno
intContatoreRigaRitorno = intNumStepX + 1
Call AssegnaValoreVariabile("E14", 0) 'flag fine taratura
Call AssegnaValoreVariabile("E15", CLng(intNumStepX * intNumStepY))

End Sub

Sub SalvaReference()

lngTlasRefX = Val(TLasReferenceX$)
lngTlasRefY = Val(TLasReferenceY$)
lngTProbe1RefX = Val(MasterRefXProbeA)
lngTProbe1RefY = Val(MasterRefYProbeA)
lngTProbe2RefX = Val(MasterRefXProbeB)
lngTProbe2RefY = Val(MasterRefYProbeB)

End Sub

Sub RipristinaReference()

TLasReferenceX$ = Str(lngTlasRefX)
TLasReferenceY$ = Str(lngTlasRefY)
MasterRefXProbeA = Str(lngTProbe1RefX)
MasterRefYProbeA = Str(lngTProbe1RefY)
MasterRefXProbeB = Str(lngTProbe2RefX)
MasterRefYProbeB = Str(lngTProbe2RefY)

End Sub
