Thanks for both your answers.
Here the READ Procedure
Dim nav2bcdString As String = nav2bcd.Value.ToString("X")
nav2bcdString = "1" & nav2bcdString.Substring(0, 2) & "." & nav2bcdString.Substring(2, 2)
Me.txtNav2Activ.Text = nav2bcdString
Here the WRITE Procedure
Private Sub Nav2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nav2.Click
Dim txtInputVal As Short = Val(Me.txtNav1Input.Text)
' MAKING A TEST - Add "0" in Front as TextField value returning "950" not "0950"
If txtInputVal < 1000 Then
Me.txtNav1Input.Text = ("0" + txtInputVal.ToString())
End If
If Me.txtNav1Input.Text > "" Then
Try
FSUIPCConnection.Process()
nav2bcd.Value = Short.Parse(txtNav1Input.Text, Globalization.NumberStyles.AllowHexSpecifier)
Catch ex As Exception
MessageBox.Show(ex.Message, NavError, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
Me.txtNav1Input.Text = "" 'clear Input Field
End Sub
1) Meanwhile
This change is working ' MAKING A TEST - Add "0" in Front as TextField value returning "950" not "0950"
In fact when using the Button the new Value 109.50 is shown on the Cockpit-Radio
BUT
2) The READ-PROCEDURE cannot return a VALID string into the separate Txt-Field 'Me.txtNav2Activ.Text' that is showing the Value
when Reading (f.e. 110.50).
This is happening only for this king of values.
NOTA: the inputfield is different from the txtNAV-Fields that are only showing the values.
In Sintesi:
[ Input Field ]
[ Sub Nav2_Click Button] >>InputValue>> in [ Nav2 TextField ] (readonly)
[ FSUIPC Read Proc ] >>Return Value>> in [ Nav2 TextField ]
(here is the error)
Input Field = 1050 - Result in Nav2 TextField = 110.50 when reading offset
Input Field = 0950 - Result in Nav2 TextField = "" when reading offset - BUT Freq 109.50 can be copied to the Radio Freq
Many thanks for your assistance
Raimund
.