19樓,你看一下這個是不是讀32位寄存器
Private Sub btn_Write32BitInteger_Click()
    Dim lReturnCode As Long                         'Return code
    Dim buffer32BitInteger  As udt32BitInteger      'User-defined type for '32bit Integer' data
    Dim bufferInteger As udtInteger                 'User-defined type for writing to the PLC
    
    'Error Handler
    On Error GoTo CatchError
    
    'Copy the TextBox data to the user-defined type for '32bit Integer'.
    buffer32BitInteger.l32BitInteger = CLng(txt_Write32BitInteger.Text)
    
    'Copy the 'buffer32BitInteger' to the user-defined type for writing to the PLC.
    LSet bufferInteger = buffer32BitInteger
    
    'The WriteDeviceBlock2 method is executed.(to D10-D11)
    lReturnCode = ActEasyIF1.WriteDeviceBlock2("D10",