Our company purchased two IRTrans devices for testing and if everything is OK
purchase a greater amount to market in Argentina.
I have a device with Wi-fi IRTrans DB Ver 1.5.
At this time I am developing a small application in vb.net using IRTrans.ocx, But I have also tested an application with TCP / IP commands in ASCII and I got the same error
The code for ocx is as follows:
ublic Class Form1
Dim ConOK As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not ConOK Then
AxIRTrans1.ServerIP = "10.0.0.131"
AxIRTrans1.Connect()
End If
End Sub
Private Sub AxIRTrans1_Connected(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxIRTrans1.Connected
ConOK = True
MsgBox("Conexion OK")
End Sub
Private Sub AxIRTrans1_ConnectError(ByVal sender As Object, ByVal e As AxIRTransOCX.__IRTrans_ConnectErrorEvent) Handles AxIRTrans1.ConnectError
ConOK = False
MsgBox("Error Conexion: " & e.msg)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If ConOK Then
AxIRTrans1.SendIR(TextBox1.Text, TextBox2.Text)
End If
End Sub
Private Sub AxIRTrans1_CommandReady(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxIRTrans1.CommandReady
MsgBox("Comando Listo")
End Sub
Private Sub AxIRTrans1_Error(ByVal sender As Object, ByVal e As AxIRTransOCX.__IRTrans_ErrorEvent) Handles AxIRTrans1.Error
MsgBox("Error: " & e.msg)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If ConOK Then
AxIRTrans1.IRClose()
ConOK = False
End If
End Sub
End Class
As clarification:
When I click the connect button (button1) the connection is successful. Before configuring the IP team and defined this property in the ocx control.
But when I click on the Send button (button2) generates the following error: IR database not loaded.
Button3 is only for close.
The textbox is to enter the remote computer name and the command to send.
And the code for TCP/IP is as follows:
Imports System.Net.Sockets
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim Trama() As Byte
Dim TramaResp(50) As Byte
Dim client As New TcpClient
client.Connect("10.0.0.131", 21000)
Dim stream As NetworkStream = client.GetStream()
Dim sndRemote As String = "dream"
Dim sndCommand As String = "vol+"
Dim Command As String = "ASCI"
Dim FinLinea As String = ControlChars.CrLf
Dim strTramaResp As String
TextBox1.Text = ""
'SEND INITIALIZATION COMMAND
Trama = StrToByteArray(Command)
stream.Write(Trama, 0, Trama.Length)
'SEND ASCII STANDART COMMAND
Command = "Asnd"
Trama = StrToByteArray(Command & " " & sndRemote & "," & sndCommand & FinLinea)
stream.Write(Trama, 0, Trama.Length)
stream.Read(TramaResp, 0, TramaResp.Length)
strTramaResp = System.Text.Encoding.ASCII.GetString(TramaResp)
TextBox1.Text = strTramaResp
client.Close()
Catch Err As Exception
MsgBox(Err.Message)
End Try
End Sub
Public Shared Function StrToByteArray(ByVal str As String) As Byte()
Dim encoding As New System.Text.ASCIIEncoding()
Return encoding.GetBytes(str)
End Function
End Class
I'm sending commands DB's own standard. For example: Remote: dream and command: vol +
What is wrong?
Any ideas?
please help..
thank you very much