Home AMX User Forum AMX Technical Discussion

Dynamic IR

Is there any way to send a discrete hex IR command directly out an IR port? Ideally I'd love to just be able to go something along the lines of SEND_COMMAND dvIR, 'IR hex here'. Alternatively, has anyone looked into a way of have the code load IR files to the port from say an FTP server or local flash?

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    PhreaK wrote: »
    $68,$65,$78,$20,$62,$64,$64,$69,$63,$74
    I can?t help you with your questions but do I get extra credit points for spotting a ?misspelling? in your tagline? The $62 should be a $61.
  • PhreaKPhreaK Posts: 966
    Joe Hebert wrote: »
    I can?t help you with your questions but do I get extra credit points for spotting a ?misspelling? in your tagline? The $62 should be a $61.

    Whoops, cheers for that. Must be coffee o'clock.
  • PhreaKPhreaK Posts: 966
    Sooooo... I'm sure others have poked around the file structure of various masters in the past. Whenever you load an IR file there is a file created in doc:/user/ named irfile03 or whatever port it is loaded to. Now, if you grab that from the master and have a look inside it's still somewhat resembles the structure of the AMX IR file you loaded to the part, but has been garbled and lost a couple of kb of data. Any ideas as to a) the purpose of that file being placed there and b) if anyone has had any luck turning that back into a valid IR file, or ultimately, being able to place an IR file either externally or via internal code with any success?
  • jjamesjjames Posts: 2,908
    PhreaK wrote: »
    Sooooo... I'm sure others have poked around the file structure of various masters in the past. Whenever you load an IR file there is a file created in doc:/user/ named irfile03 or whatever port it is loaded to. Now, if you grab that from the master and have a look inside it's still somewhat resembles the structure of the AMX IR file you loaded to the part, but has been garbled and lost a couple of kb of data. Any ideas as to a) the purpose of that file being placed there and b) if anyone has had any luck turning that back into a valid IR file, or ultimately, being able to place an IR file either externally or via internal code with any success?

    First, the IRL files do not contain straight HEX as I'm sure you well know; it gets converted when you paste it in through IREdit to something.

    Now, I did at one point make a C# program that converted IRL files into Pronto HEX, but never completely finished it. Going backwards from HEX to IRL would be a pain in .NET, let alone trying to do it in Java and probably impossible doing it in NetLinx.

    I would ASSUME that the naming of the commands in an IRL file is stripped, condensed, or possibly encrypted when loaded onto a master. I'll need to play around with those files. Would you mind posting one? I don't have access to a master off hand right now. Then post the corresponding IRL file as well would be a big help as well.
  • PhreaKPhreaK Posts: 966
    Hi James,

    Thanks for the quick reply and your help. I've attached a zip containing the original irl file loaded to the master and the file I pulled from doc:/user/ (originally names irfile03). Cheers.
  • AuserAuser Posts: 506
    PhreaK wrote: »
    Whenever you load an IR file there is a file created in doc:/user/ named irfile03 or whatever port it is loaded to.

    OK, I haven't had a chance to wade into this until now but I've thought about this a little myself. Assuming that your intent is to control a dynamically selected device, there are a couple of ways I can think of achieving what you're after. The two methods which require the least engineering in your case are probably:

    1) Have a library of files stored on the flash of the control system and copy the ones you need to the appropriate filenames,

    or if you have too many IR files...

    2) Write an ftp client into your NetLinx source which grabs the required files from a server on the network or have a PC app living on a server which ftp's the required IR file to the necessary file name on request from the control system.

    With either method, the IR file has to be used as an intermediate step. You wouldn't want to write the IR file every time you wanted to issue an IR command as (a) it slows the command being issued and (b) you'll burn out the flash.

    That also assumes that the files are read every time an IR command is sent (unlikely). You'll probably need to reboot the control system after writing the file(s).
    PhreaK wrote: »
    Any ideas as to a) the purpose of that file being placed there
    The content of these files (or signal timing component thereof) is probably sent to the IR port hardware when the control system boots or a new IR file is sent by NS/IREdit/FT. It is likely the control system's main processor offloads the generation of IR signals to one or more additional dedicated controllers.
    PhreaK wrote: »
    b) if anyone has had any luck turning that back into a valid IR file, or ultimately, being able to place an IR file either externally or via internal code with any success?
    On a cursory inspection, I think I can basically see what's done to the original IR file when it's sent to the control system (funnily, it's very similar to another control system manufacturer's native IR file format). There's enough information in the file to create a valid IRL file from it, but you'll need to do a fair amount of work to determine how to do so.

    Looks like plonking a previously created irfile## in place *should* work, but I haven't tried it.

    If you have a definite requirement to use dynamic hex strings to control IR devices, you'll probably need to augment the NetLinx with a Global Cache device or similar.
  • PhreaKPhreaK Posts: 966
    Auser wrote: »
    1) Have a library of files stored on the flash of the control system and copy the ones you need to the appropriate filenames,

    or if you have too many IR files...

    2) Write an ftp client into your NetLinx source which grabs the required files from a server on the network or have a PC app living on a server which ftp's the required IR file to the necessary file name on request from the control system.
    If this could work I'd only be updating the file under 2 circumstances - 1) if the device was changed in RMS, or 2) if an ir file version variable in RMS didn't match the one of the master.
    Auser wrote: »
    Looks like plonking a previously created irfile## in place *should* work, but I haven't tried it.
    If you nuke the IR file from that port, then place the irfile## back in place you don't have any success. It'd be nice if it worked that way as whenever I created a new irfile I could just dump it onto my testbench NI-700 then grab the irfile## file it created and whack that on the FTP server - unfortnately life isn't so simple.
Sign In or Register to comment.