Dim iReturnCode As Integer 'Return code
Dim szDeviceName As String = "" 'List data for 'DeviceName'
Dim iNumberOfDeviceName As Integer = 0 'Data for 'DeviceSize'
Dim sharrDeviceValue() As Short 'Data for 'DeviceValue'
'软元件名
szDeviceName = String.Join(vbLf, txt_DeviceNameRandom.Lines)
'写入点数
If GetIntValue(txt_DeviceSizeRandom, iNumberOfDeviceName) = False Then
'If failed, this process is end.
Exit Sub
End If
'写入的软元件值
ReDim sharrDeviceValue(iNumberOfDeviceName - 1)
If GetShortArray(txt_DeviceDataRandom, sharrDeviceValue) = False Then
'If failed, this process is end.
Exit Sub
End If
'软元件的随机写入
iReturnCode = AxActUtlType1.WriteDeviceRandom2(szDeviceName, iNumberOfDeviceName, sharrDeviceValue(0))