Hi all, I am using Q series PLC, connected to PC with MxComponent software.It is connecting successfully when we open the application and after 50 to 60 minutes and it does not reconnect again...
To connect again we need to close the application and reopen. Please help on this, I am also giving the code here to connect.Please help on this. Thanks in advance.
Code Here
private bool PGetIntValue(int lptxt_SourceOfIntValue, out int iGottenIntValue){iGottenIntValue = 0;//Get the value as 32bit integer from a TextBoxtry{iGottenIntValue = Convert.ToInt32(lptxt_SourceOfIntValue);}
//When the value is nothing or out of the range, the exception is processed.catch (Exception exExcepion){MessageBox.Show(exExcepion.Message,Text, MessageBoxButtons.OK, MessageBoxIcon.Error);return false;}
//Normal Endreturn true;}
private void PLCconnect(){int iReturnCode;int iLogicalStationNumber;if (PGetIntValue(1, out iLogicalStationNumber) != true){return;}axActUtlType1.ActLogicalStationNumber = iLogicalStationNumber;// axActUtlType1.ActPassword = txt_Password.TextiReturnCode = axActUtlType1.Open();if (iReturnCode == 0){//ConnectedlblStatus.Text = "Connected";lblStatus.ForeColor = Color.Green;}else{//Not ConnectedlblStatus.Text = "Not Connected";lblStatus.ForeColor = Color.Red;}}