Active-x and VB

The place where software developers meet

Moderator: marcus

Active-x and VB

Postby MasaV2 » Thu 15. Oct 2009, 18:36

Hello,

I try to lear VB & IRtrans ethernet device.
Some questions:


C:\Program Files\IRTrans\Sourcecode\VBClient
and file: IR.vbp

How can I tell program where pioneer.rem (sample of file at the bottom of this message) file is?
What is right location of those files?
(C:\Program Files\IRTrans\remotes ? )

(I cannot use none of my .rem files with VB)

ReadRemote App.Path & "\" & "Remote.irm", cmdMode(Index).tag

What is App.Path?

In remote.irm file I put:
[MAIN]
[FRMPIX]400,300
[SEP]0,45 [END]500,45

[MOD]10,20 [SIZE]40,25[PANEL]pioneer

[END]

[pioneer]
[FRMPIX]460,280
[LBL]10,250 [SIZE]300,30[TEXT]Pioneer
[SLED]15


[POS]10,50 [SIZE]100,30[TEXT]Vol - [REMOTE]pioneer [COMMAND]vol-
[POS]120,50 [SIZE]100,30[TEXT]Vol + [REMOTE]pioneer [COMMAND]vol+


and next lesson:

C:\Program Files\IRTrans\APIs\Active-X\Sample
and file: OCXDemo.vbp

in OCXDemo.vbp there is IRTrans1_RemoteList

what I must put here?

Private Sub IRTrans1_RemoteList(count As Integer)


End Sub


Is this OK?
Private Sub cmdVolUp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub

DoSend "pioneer", "vol+"
End Sub



And one more:
In C:\Program Files\IRTrans\Sourcecode\VBClient there is form: frmSendFree.frm.
and one place:
Public Sub FillRemoteCombo()
Dim i As Integer
txtRemote.Clear
For i = 0 To RemoteCount - 1
txtRemote.AddItem (Trim(RemoteDB(i).name))
Next i
End Sub

Where is this Remote database? (RemoteDB)
How can I move/convert my .rem files to database?







pioneer.rem file:
[REMOTE]
[NAME]pioneer

[TIMING]
[0][N]3[1]8520 4176[2]608 440[3]608 1520[RC]131[RP]89[FREQ]38[SB][RS]
[1][N]6[1]528 472[2]632 424[3]608 1496[4]584 1592[5]8528 4176[6]600 25176[RC]1[RP]0[FREQ]38
[2][N]5[1]552 448[2]504 1624[3]600 1552[4]8512 4192[5]600 25176[RC]1[RP]0[FREQ]38
[3][N]4[1]560 448[2]608 1568[3]8520 4176[4]640 25136[RC]131[RP]178[FREQ]38
[4][N]5[1]520 456[2]616 440[3]576 1544[4]8528 4176[5]584 25144[RC]1[RP]0[FREQ]38

[COMMANDS]
[on][T]0[D]S101001010101101001011000101001110
[off][T]0[D]S101001010101101011011000001001110
[vol+][T]0[D]S101001010101101001010000101011110
[vol-][T]0[D]S101001010101101011010000001011110
[ps3-audio][T]1[D]430300203030330300003111223302330543030020303032030000300033330333054303003030303303000030003333033300
[digibox-audio][T]2[D]320200202020220202020000202022220432020020202022020202000020202222043202002020202202020200002020222100
[loudnes][T]0[D]S101001010101101000100010110111010
[systemsetup][T]3[D]21010010101011010110110010010011032101001010101101001101011100101000
[arrow-up][T]0[D]S101001010101101000000001111111100
[arrow-down][T]0[D]S101001010101101010000001011111100
[arrow-left][T]0[D]S101001010101101011000001001111100
[arrow-right][T]0[D]S101001010101101001000001101111100
[enter][T]0[D]S101001010101101000100001110111100
[mute][T]0[D]S101001010101101001001000101101110
[dimmer][T]3[D]21010010101011010011010101001010132101001010101101001100000100111110
.......


Thanks for your response
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Re: Active-x and VB

Postby IRTrans » Thu 15. Oct 2009, 19:49

Some general tips:

- IRTrans uses a client server architecture. That means you will never directly access the .rem files or the IRTrans devices. You will only "talk" to the irserver. That means you do not need to look for any path or search any files - everything else is handled by the irserver.

- It does not make sense to analyze the irclient programm - it is a very complicated and large programm and we cannot give any support for the internals of this programm - it is simply to complicated.

- To start you should have a look at the OCX Test programm. I will attach it to this post. This OCX Test programm uses everything you might need (Learning and Sending of IR Codes, Listing remotes and commands). The version of the Active-X inside this test programm might be older but the programms show everything.

IRTrans
Attachments
IRTransOCX.zip
(30.7 KiB) Downloaded 2005 times
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Active-x and VB

Postby MasaV2 » Thu 15. Oct 2009, 20:28

Ok, thanks.


In manual:
Programming the IR Database
(Only for modules with optional IR Database)
Using Mode – Device database the integrated IR
Database can be configured using the IRTrans GUI
client.


When I try to use IRTrans GUI Client it tells:
IR error
Result:[40-1] This operation is only supported using the irserver

What I made wrong?
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Re: Active-x and VB

Postby IRTrans » Thu 15. Oct 2009, 23:37

Well, the error message says it all: When you want to programm the database you need to connect to the irserver.

That means you will need to start the GUI client without any parameter while the irserver is running on the same PC - and not irremote <ip of irtrans>.

Afterwards you can connect directly to the IRTrans to send IR codes.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Active-x and VB

Postby MasaV2 » Fri 16. Oct 2009, 15:37

IRTrans wrote:Well, the error message says it all: When you want to programm the database you need to connect to the irserver.
That means you will need to start the GUI client without any parameter while the irserver is running on the same PC - and not irremote <ip of irtrans>.


Thanks again, now it works!

So if I start with option:
"C:\Program Files\IRTrans\IRServer.exe" 192.168.xxx.xxx
or
"C:\Program Files\IRTrans\irtranstray.exe" lan

and
C:\Program Files\IRTrans\Sourcecode\VBClient\IR.vbp
or
C:\Program Files\IRTrans\IRRemote.exe

Now when irserver is running, I see my .rem files in combo box and I can use them.

First I understand that I can use only IRRemote.exe (or VBClient\IR.vbp) program without irserver.

continue...
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Re: Active-x and VB

Postby MasaV2 » Mon 19. Oct 2009, 15:03

I also download db to irtrans device and it works now without irserver in pc.

I try to send many ircommands in one command_click command.

ie:
LCD tv: on
PIONEER amp: on
PIONEER amp: input1
LCD tv: hdmi1
....

It says that this is only possible with irserver.
I made more buttons with one command, and when I manually push each button one by one it works ok, not with my "macro".
Same happends if IRTranstray is running

Could you say what I made wrong?
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Re: Active-x and VB

Postby IRTrans » Mon 19. Oct 2009, 16:09

It is possible to send Macros, however there are two restrictions:

1. All Commands need to be in one Remote control
2. The max. length of the command string is 20 chars

To send more than one command all commands need to separated by a Semicolon (";") (Like 1;2;3).
If you are using the UDP ASCII API the limit for the command string is 120 chars, however they still need to be in one remote control.

You could easily learn all the needed commands into one remote control file and upload that. If you use short names for the commands (1 or 2 chars)
you will be able to have macros with 6-10 IR codes.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Active-x and VB

Postby MasaV2 » Mon 19. Oct 2009, 19:53

You could easily learn all the needed commands into one remote control file

Or with copy&paste method?
(I have already learn commands and my wife watching tv now)

Remotes:

Digibox:

[TIMING]
[0][N]5[1]9008 4488[2]592 544[3]592 1680[4]8952 2296[5]592 39272[RC]1[RP]0[FREQ]38[SB]
[1][N]6[1]9000 4464[2]600 528[3]624 1576[4]584 1672[5]9016 2216[6]648 40152[RC]1[RP]0[FREQ]38[SB]
[2][N]5[1]9024 4448[2]624 504[3]624 1608[4]9048 2240[5]624 40168[RC]1[RP]0[FREQ]38[SB]
[3][N]6[1]9048 4440[2]624 504[3]600 1632[4]696 1528[5]9024 2184[6]592 40208[RC]1[RP]0[FREQ]38[SB]

[menu][T]0[D]S00001100111100111011000001001111320
[powertoggle][T]1[D]S00002200222200220202200020200212430
...


LCD:
[TIMING]
[0][N]0[RC]130[RP]114[FREQ]36[RC5]
[1][N]0[RC]130[RP]105[FREQ]36[RC6]

[hdmi1][T]0[D]11000011111001
[hdmi2][T]0[D]10000011111011
[powertoggle][T]1[D]S1000000000000000001100
...



Macro remote:
[REMOTE]
[NAME]Together

[TIMING]
[0][N]0[RC]130[RP]114[FREQ]36[RC5]
[1][N]0[RC]130[RP]105[FREQ]36[RC6]
[2][N]6[1]9000 4464[2]600 528[3]624 1576[4]584 1672[5]9016 2216[6]648 40152[RC]1[RP]0[FREQ]38[SB]

[COMMANDS]
[hdmi1][T]0[D]11000011111001
[hdmi2][T]0[D]10000011111011
[pow1][T]1[D]S1000000000000000001100
[pow2][T]2[D]S00002200222200220202200020200212430
...




Final result:

... remote: Together command: pow1;pow2;hdmi1

Is this way to put different timings together in one remote OK?
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Re: Active-x and VB

Postby IRTrans » Tue 20. Oct 2009, 00:01

Yes, that is correct.

You always need to make sure that the commands and timings match.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Active-x and VB

Postby MasaV2 » Fri 23. Oct 2009, 13:43

Little fix.
Is is possible to put delay between two commands?
... remote: Together command: pow1;pow2;hdmi1


I need about 1-2 sec before hdmi1 command.
(LCD boot so slowly)
MasaV2
 
Posts: 9
Joined: Thu 15. Oct 2009, 16:55

Next

Return to APIs

Who is online

Users browsing this forum: No registered users and 6 guests