Hello,
I have a problem with my project.
I am trying to send/read data from a plc true a certain protocol (modbus for those that want to know). This i can get to work but the actual problem is that my computer gets slow and lags alot when i send/recieve data to the plc.
Someone told me that threading would be usefull to implement so that the project keeps responding.
How can i implement threading?
I have a sub that checks wich item is selected in a combobox (read or write) which is in an infinitive loop. With an if statement i check which of the 2posibillities is selected and then i jump to the corresponding sub.
Do i create 2threads like threadRead and threadWrite or how can i best do this?
thx
I have a problem with my project.
I am trying to send/read data from a plc true a certain protocol (modbus for those that want to know). This i can get to work but the actual problem is that my computer gets slow and lags alot when i send/recieve data to the plc.
Someone told me that threading would be usefull to implement so that the project keeps responding.
How can i implement threading?
I have a sub that checks wich item is selected in a combobox (read or write) which is in an infinitive loop. With an if statement i check which of the 2posibillities is selected and then i jump to the corresponding sub.
VB.NET:
Private Sub cmbkeuze_SelectedIndexChanged
do
If cmbkeuze.SelectedIndex = "0" Then
writeshort()
End If
If cmbkeuze.SelectedIndex = "1" Then
ReadShort()
End If
loop
End Sub
Do i create 2threads like threadRead and threadWrite or how can i best do this?
thx
Last edited by a moderator: