PSF的获取
前言
主要利用buf语句进行传递,在worksheet中有收藏。
一、主要代码
Sub OnRunPSF()
Dim session As CVCommand
Set session = CreateObject("CodeV.Command.102")
session.SetStartingDirectory ("c:/cvuser")
session.StartCodeV
result = session.Command("res cv_lens:singlet")
'MsgBox (result)
Dim dArray(0 To 127, 0 To 127) As Double
'buf进行传输,1先删除buf 2 视场 2 ° 3 psf执行 4 Write receiver data to buffer 5 执行
result = session.Command("buf del ba; yan 2; psf; wbf b1; go")
'MsgBox (result)
result = session.BufferToArray(11, 138, 1, 128, 1, dArray)
Worksheets("Sheet1").Select
i = 0
j = 0
Do While j < 128
i = 0
Do While i < 128
Range("$A$1").Cells(i + 1, j + 1).Value = dArray(i, j)
i = i + 1
Loop
j = j + 1
Loop
session.StopCodeV
End Sub
总结
输出对照结果如图: