|
JP1 Remotes
|
View previous topic :: View next topic |
Author |
Message |
Mr Mod
Joined: 27 Oct 2004 Posts: 19
|
Posted: Tue Jul 06, 2010 8:03 pm Post subject: Excel and DecodeIR.dll |
|
|
I am looking at using the DecodeIR dll with excel, has anyone had any experience of using these 2 together to decode a pronto long hex code in a cell and giving the result into another cell.
I know there will most likely be some VBA code to do this.
And help would be appreciated. |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21234 Location: Chicago, IL |
Posted: Tue Jul 06, 2010 8:45 pm Post subject: |
|
|
I don't know how to link the two together, but if all you want to do is decode some pronto hex, you can use IR.exe to do that now. You can also use IRTool as well. _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
Mr Mod
Joined: 27 Oct 2004 Posts: 19
|
Posted: Tue Jul 06, 2010 9:23 pm Post subject: |
|
|
What i am trying to achieve is to update the master list of Sony codes to include the Sony PC programmable remote codes and their CIS controller codes.
If i can get the result from decode IR it would be an easy way to create them in the right format.
This was a thought i had last night, if it cant be done then its not a real problem.
The master list of Sony codes appears on remote central but has not been updated in years, and with the codes that are on this site i wanted to create just a single place with all the conversions all ready done. |
|
Back to top |
|
|
vickyg2003 Site Admin
Joined: 20 Mar 2004 Posts: 7073 Location: Florida |
Posted: Tue Jul 06, 2010 9:42 pm Post subject: |
|
|
Mr Mod wrote: | What i am trying to achieve is to update the master list of Sony codes to include the Sony PC programmable remote codes and their CIS controller codes.
If i can get the result from decode IR it would be an easy way to create them in the right format.
This was a thought i had last night, if it cant be done then its not a real problem.
The master list of Sony codes appears on remote central but has not been updated in years, and with the codes that are on this site i wanted to create just a single place with all the conversions all ready done. |
I don't really understand what you are trying to do here. However, before Graham did added all those wonderful features to IRSCope, ElizabethD and I were both working on ways to call decodeIR from our own apps. Elizabeth was calling it from Excel, so hopefully she'll see this post and chime in.
You might want to look at some of the other tools we have here too. _________________ Remember to provide feedback to let us know how the problem was solved and share your upgrades.
Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
|
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4501
|
Posted: Tue Jul 06, 2010 9:49 pm Post subject: |
|
|
Are you aware of THIS list of sony codes hosted right here? I don't know if it has the codes you need or not. |
|
Back to top |
|
|
Mr Mod
Joined: 27 Oct 2004 Posts: 19
|
Posted: Tue Jul 06, 2010 9:56 pm Post subject: |
|
|
I am aware of those codes, i have been over the past few years been keeping "the Keeper" with regular updates to them. I have another heap of them to send to Rob at the moment.
This is just something i had been meaning to look at for some time never having time.
I have been past few weeks trying to learn VBA and VB6 as i have plenty of time on my hands at the moment to learn some things. |
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4501
|
Posted: Tue Jul 06, 2010 10:32 pm Post subject: |
|
|
I'm not having any luck adding DecodeIR as a reference in VBA. Anybody know if it's even possible? |
|
Back to top |
|
|
3FG Expert
Joined: 19 May 2009 Posts: 3367
|
Posted: Tue Jul 06, 2010 11:20 pm Post subject: |
|
|
DLLs which are written in C or C++ push arguments onto the stack in a different order than VBA expects, and cleans up the stack after the call differently. I was able to use jp12serial.dll with Excel by writing a wrapper dll in C/C++ and explicitly set the wrapper function calls to use the Pascal calling convention.
If Mr. Mod hasn't found a solution in the next couple of days, I'll endeavor to write a wrapper for DecodeIR.dll
Edited to Add:
But don't you really want ExchangeIR.dll? I don't think DecodeIR.dll does anything with Pronto Hex without preprocessing it into burst pairs. |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4523 Location: Cambridge, UK |
Posted: Wed Jul 07, 2010 3:28 am Post subject: |
|
|
3FG wrote: | But don't you really want ExchangeIR.dll? I don't think DecodeIR.dll does anything with Pronto Hex without preprocessing it into burst pairs. |
You are right. He needs both. ExchangeIR can convert the Pronto to burst pairs that can then serve as input to DecodeIR. If he also needs a DLL wrapper to change the calling convention, it would make sense to have that wrapper combine ExchangeIR.dll and DecodeIR.dll calls to give the functionality he needs. _________________ Graham |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21234 Location: Chicago, IL |
Posted: Wed Jul 07, 2010 7:44 am Post subject: |
|
|
Mr Mod wrote: | What i am trying to achieve is to update the master list of Sony codes to include the Sony PC programmable remote codes and their CIS controller codes.
If i can get the result from decode IR it would be an easy way to create them in the right format.
This was a thought i had last night, if it cant be done then its not a real problem.
The master list of Sony codes appears on remote central but has not been updated in years, and with the codes that are on this site i wanted to create just a single place with all the conversions all ready done. |
Could you post a link to the particular list of codes that you want to decode.
The Sony format is simple enough that it would be easier to do the decode in Excel itself rather than trying to call Exchange.dll from Excel. _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21234 Location: Chicago, IL |
|
Back to top |
|
|
ElizabethD Advanced Member
Joined: 09 Feb 2004 Posts: 2348
|
Posted: Wed Jul 07, 2010 12:04 pm Post subject: |
|
|
mdavej wrote: | I'm not having any luck adding DecodeIR as a reference in VBA. Anybody know if it's even possible? |
Yes it is, or it was long ago. For burst-pair inputs (not pronto) from decodeIR to excel.
Vicky PMd me to take a look here, so I did.
I dusted off some old Excel work I did using DecodeIR data and translating it. I don't understand ANY of it any more.
Reference maker:
Quote: | Declare Function DecodeTT Lib "DecodeIR" Alias "DecodeIR" (ByRef paiContext As Long, ByRef paiBursts As Long _
, ByVal iFreq As Long, ByVal iSingleBurstCount As Long, ByVal iRepeatBurstCount As Long _
, ByRef psProtocol As Long, ByRef piDevice As Long, ByRef piSubDevice As Long _
, ByRef piOBC As Long, ByRef paiHex As Long _
, ByRef psMisc As Long, ByRef psError As Long) As Long
Declare Function VarPtrArray Lib "MSVBVM60.DLL" Alias "VarPtr" (ByRef numArray() As Any) As Long 'VarPtr,StrPtr,ObjPtr are built in
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal bytes As Long)
'
Public tya As clsTypeArrays |
Other than few notes in plain English I wrote into VBA, such as the need to declare a TYPE which I then played with in a Class module.
Quote: | 'Type is essential for pointers to work, they were flaky since many are pointers to pointers...
'Using class module is NOT essential, but a good thing to learn to use
'durations will be redimensioned based on #values in a signal
'ARRAYS must be in TYPEs, SINGLE VALUES do not have to be in TYPE
'bStrings are three arrays for Protocol, Misc, Error. They have to be byte packed, not Unicode
Private Type typArrays
context(1) As Long
durations() As Long
Hex(3) As Long
bProt(255) As Byte
bMisc(255) As Byte
bError(255) As Byte
End Type
'
Private tya As typArrays |
and then setting a zillion type properties for the arrays - few examples:
Quote: | 'Public Property Get GetProtPtr() As Long
GetProtPtr = VarPtr(tya.bProt(0))
End Property
Public Property Get GetProtValue() As String
Dim v As String
v = StrConv(tya.bProt(), vbUnicode)
GetProtValue = Left(v, InStr(1, v, Chr(0)) - 1)
End Property
Public Property Get GetMiscPtr() As Long
GetMiscPtr = VarPtr(tya.bMisc(0))
End Property
... etc etc etc
|
Problem is I then incorporated it all into a big set of macros and at this point can't make much sense of it. _________________ Liz
Tweeking 8910, HTPro/9811, C7-7800, 6131o, 6131n, AtlasOCAP-1056B01, RCA-RCRP05B and enjoying the ride |
|
Back to top |
|
|
vickyg2003 Site Admin
Joined: 20 Mar 2004 Posts: 7073 Location: Florida |
Posted: Wed Jul 07, 2010 1:00 pm Post subject: |
|
|
Elizabeth, Just to jog your memory a little bit on this, I was calling decodeIR.dll from VFP and I gave you the declares VBA, but you figured out how to determine how many times to call decode, because when I did it from within VFP, if I over called it, my computer would crash, hard.
On 3/19/2008 you sent me an email called SUCCESS. Then on 4/16/2008, I had something from you talking about the loop, but the email with the code is gone. By the time I had the time to work on this, Graham had made it so I don't need it anymore, with his changes to IRScope. _________________ Remember to provide feedback to let us know how the problem was solved and share your upgrades.
Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
|
|
Back to top |
|
|
ElizabethD Advanced Member
Joined: 09 Feb 2004 Posts: 2348
|
Posted: Wed Jul 07, 2010 4:29 pm Post subject: |
|
|
Vicky, Good question, you just jogged my brain.
Yes, not know ing when to stop was an issue.
There is defiinitely a Protocol=blank which ends things.
But that didn't always work for me. So, since I usually selected some range, I was also counting and enforcing the end that way.
Therefore looping forever was not an issue anymore and most stuff I tried worked fine.
Few scattered notes here and there tell me so.
Also I used it primarily for the timing from IRSA, where I needed to do few replacements for things like "END".
Bottom line, no longer used, no longer needed, abandoned code. _________________ Liz
Tweeking 8910, HTPro/9811, C7-7800, 6131o, 6131n, AtlasOCAP-1056B01, RCA-RCRP05B and enjoying the ride |
|
Back to top |
|
|
Mr Mod
Joined: 27 Oct 2004 Posts: 19
|
Posted: Wed Jul 07, 2010 5:33 pm Post subject: |
|
|
Thank you all for your replies,
I should have been a bit clearer as to what i am trying to do, i want to be able to take and manufacturers code and translate them not just Sony ones. I knew DecodeIR can do it but was not aware of ExchangeIR.
Although i admit i have 1 JP1 remote, i mostly use the Sony PC programmable ones such as the RM-AX1400 and NX7000 remotes. I get quite a fair few requests to provide codes for devices that people can use at remotecentral for these remotes.
So if i could do something in Excell that can do all the translations it would benefit others.
This site seems to have more people with knowledge on the 2 DLL's hence why i came here.
The Sony master list i was refering to was this one, which i have started to update to include the codes at this site.
http://www.remotecentral.com/cgi-bin/files/rcfiles.cgi?area=pronto&db=other&br=utilities&dv=userwrittendocumentation&md=sonyircodecollectionxls&kw=&st=&ar=&dt=&so=&pg=2&file=manuals/sony-ir-collection.zip |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|