I'm currently working on sending data from our database to a TMC420 controller using VB.NET and Telesis Extended Protocol ActiveX. I'm able to poll the controller for info, send data to its pattern and change its pattern. The problem is when I send the data in a for loop -
For i As Integer = 0 To DataRow.Cells.Count - 1
Me.AxExtendedProtocol1.Send("V", "0" & (i + 1) & DataRow.Cells(i).Value)
It gives an error -
An unexpected response has been recieved from the controller.
Although the data was succesfully sent to the controller (it displays on the screen). Once I put a message box in the for loop the error goes away. I tried using Thread.Sleep() but using this produces the error aswell. I suspect Send() is able to respond without being interupted by the next Send() operation when a message box displays (doe's the message box halt the program allowing previous executions to continue?). While Sleep() suspends it and is unable to recieve a proper response from the controller, does anybody agree with my theory?
Could somebody please help me to get rid of this anoying error message and avoid using a message box for each loop?