Hi,
We are using datatables in V570.
Trying to write to the first column in the first table in V570, address 0 – which is a Integer column.
I’m not able to write to it, I Just get an UserInputException (Invalid write values).
I’m able to read the same column, using the same addressing.
What’s wrong with my code?
Public Function WriteTableFeedPlan(ByVal FeedPlanId As Integer)
Dim rw() As ReadWriteRequest = New ReadWriteRequest(0) {}
Dim StartAddress As UInteger = 0
Dim NumberOfBytesToWriteInRow As UShort = 2
Dim NumberOfRowsToWrite As UShort = 1
Dim RowSizeInBytes As UShort = 2
Dim ValueList As New List(Of Byte)
Dim byte1 As Byte = 4
Dim byte2 As Byte = 5
ValueList.Add(byte1)
ValueList.Add(byte2)
rw(0) = New WriteDataTables(StartAddress, NumberOfBytesToWriteInRow, NumberOfBytesToWriteInRow, RowSizeInBytes, ValueList)
Try
plc.ReadWrite(rw)
ethernet.Disconnect()
Catch
ethernet.Disconnect()
Return False
End Try
Return True
End Function