8230 Optical Power Meter Operation Manual
4.7.2 Program Example 2
4-26
'Reads the measurement data: Up to 50 char-
acters
If ret = OK Then 'If the command is received correctly
rstr = Left$(rstr, siz - 1) 'Deletes the terminator LF.
Cells(6, 1) = "OPM2"
Cells(6, 2) = rstr 'Writes the measurement data into the spec-
ified cell.
Else 'If the command is received incorrectly
MsgBox "MYID 2 receiving error", vbExclamation
End If
err_exit:
ret = ausb_close(OPM1) 'Closes the device.
If ret <> OK Then 'If the device is closed incorrectly
MsgBox "MYID 1 CLOSE error", vbExclamation
End If
ret = ausb_close(OPM2) 'Closes the device.
If ret <> OK Then 'If the device is closed incorrectly
MsgBox "MYID 2 CLOSE error", vbExclamation
End If
ret = ausb_end() 'USB terminates.
If ret <> OK Then 'If the USB connection terminates incor-
rectly
MsgBox "USB end error", vbExclamation
End If
End Sub