Hello, I am having some trouble changing the comport from a child form in a mdi.
"mainform" - mdiparent
|_"oppsettForm" - Setup
|_"husForm" - the page that is displaying the components. (modbus rtu driver is on this form)
I have made a function on "husForm" that when called updates the settings for the driver.
Public Sub ReceiveValue(ByVal BaudRate As String, ByVal cbComport As String, ByVal tbBaud As String, ByVal tbDataBits As String, ByVal Parity As String, ByVal tbPollrate As
String, ByVal tbAddresse As String, ByVal StopBits As String)
Me.ModbusRTUCom1.BaudRate = BaudRate
Me.ModbusRTUCom1.PortName = cbComport
Me.ModbusRTUCom1.BaudRate = tbBaud
Me.ModbusRTUCom1.DataBits = tbDataBits
Me.ModbusRTUCom1.Parity = Parity
Me.ModbusRTUCom1.PollRateOverride = tbPollrate
Me.ModbusRTUCom1.StationAddress = tbAddresse
Me.ModbusRTUCom1.StopBits = StopBits
' MsgBox(cbComport) '''''This is just to see if i can display the value sendt to the function. (It does show the value i pass to the function)
End Sub
On the setup page i call the function.
husForm.ReceiveValue(tbBaud.Text, cbComport.Text, tbBaud.Text, tbDataBits.Text, Parity, tbPollrate.Text, tbAddresse.Text, StopBits)
However it does not update the comport. It updates the baud rate and other stuff.
I tried to make a button that gets the values from ModbusRTUCom1.(baud,parity and so on), but the text does not update when i update the driver. It only list up the default values that i set in Visual Studio.
Tried to set modifiers ModbusRTUCom1 to Public, still no luck.
Any help would be appreciated.