Attribute VB_Name = "Mod7002"
Global intAddress7002 As Integer
Global Status7002 As Integer
Global OpenList As String
Global CloseList As String


Public Sub Init7002()
    Call send(intAddress7002, "*RST", Status7002)
    Call send(intAddress7002, "*CLS", Status7002)
    Call InizializzaMemorie
End Sub

Public Sub ScanOpenAll7002()
    Call send(intAddress7002, ":ROUT:OPEN ALL", Status7002)
End Sub

Public Sub ScanOpen7002(openscan As String)
    Call send(intAddress7002, ":ROUTE:OPEN (@" + Trim(openscan) + ")", Status7002)
End Sub

Public Sub ScanCloseS7002(CloseSingle As String)
    Call send(intAddress7002, ":ROUTE:CLOSE (@" + Trim(CloseSingle) + ")", Status7002)
End Sub

Public Sub ScanCloseM7002(CloseList As String)
    Call send(intAddress7002, ":ROUTE:CLOSE (@" + Trim(CloseList) + ")", Status7002)
End Sub

Sub InizializzaMemorie()
'questa funzione ha il campito di inizializzare le memorie necessarie per il
'processo di taratura

'Memoria M1: misura della pressione
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@5!1!1,5!2!2),M1", Status7002)
'Memoria M2: alimentazione + misura V+
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,1!1!7,2!2!6),M2", Status7002)
'Memoria M3: alim. + misura V0+
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,1!1!6,2!2!6),M3", Status7002)
'Memoria M4: alim. + misura V0-
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,1!1!2,2!2!6),M4", Status7002)
'Memoria M5: alim. + VOFF DE
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,1!1!6,1!2!2),M5", Status7002)
'Memoria M6: alim. + VB
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,3!1!1,2!2!6),M6", Status7002)
'Memoria M7: alim. + VOUT
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9,2!1!10,2!2!6),M7", Status7002)
'Memoria M8: solo alim.
Call send(intAddress7002, ":ROUT:MEM:SAVE:LIST (@2!3!8,2!4!9),M8", Status7002)

End Sub

Sub RecallMem7002(intMemoria As Integer)
'permette di richiamare opportune memorie
Dim strTemp As String

'strTemp = "M" + Trim(Str(intMemoria))
Call send(intAddress7002, ":ROUT:MEM:RECALL " + "M" + Trim(Str(intMemoria)), Status7002)

End Sub
