First of all, let me thank you for this awesome software package. I am a newbie, so there is probably an easy answer to this, I just don't know it. If I've done something wrong in posting this question, just let me know and I'll know not to do it again. - Thanks
With this code I can change my IP address to whatever I want, and it works fine.[size=78%] [/size]
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
ModbusTCPCom1.IPAddress = TextBox2.Text
End Sub
----------------------------------------------------------------------
But if I read the IP address in from a .txt file, it does not work.
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim search As String
Dim fileReader As String
search = TextBox1.Text
If TextBox1.Text = "" Then
Else
fileName = search
End If
Try
fileReader = My.Computer.FileSystem.ReadAllText("C:\folder\" & fileName & ".txt")
TextBox2.Text = fileReader
[/size]ModbusTCPCom1.IPAddress = TextBox2.Text
Catch
MsgBox("Entry Not Valid")
End Try
End Sub
-------------------------------------------------------------------------------------------------
If I use
PilotLight1.Text = ModbusTCPCom1.IPAddress
it flashes the correct IP address, but also flashes "Com Error -999. No Values Returned from Driver"
Any idea what I'm doing wrong?