Private Async Sub MaterialButton1_Click_1(sender As Object, e As EventArgs) Handles MaterialButton1.Click
Dim host As String = "192.168.0.104"
Dim port As Integer = 104
Dim useTls As Boolean = False
Dim callingAET As String = "SCU"
Dim calledAET As String = "SunNuclear_SCP"
Dim client As IDicomClient =
DicomClientFactory.Create(host, port, useTls, callingAET, calledAET)
Dim echoRequest As New DicomCEchoRequest()
echoRequest.OnResponseReceived = Sub(request As DicomCEchoRequest, response As DicomCEchoResponse)
If response.Status = DicomStatus.Success Then
Console.WriteLine("C-ECHO succeeded: " & response.Status.ToString())
MessageBox.Show("Success")
Else
Console.WriteLine("C-ECHO failed with status: " & response.Status.ToString())
End If
End Sub
Try
Await client.AddRequestAsync(echoRequest)
Await client.SendAsync()
Catch ex As Exception
Console.WriteLine("C-ECHO failed: " & ex.Message)
MessageBox.Show("C-ECHO failed: " & ex.Message)
End Try
End Sub
This code worked for me. I was using FO-Dicom 5.2.4 . To get this Echo response working, it was quite difficult even with all the AI available.