Dynamic IR
PhreaK
Posts: 966
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?
0
Comments
Whoops, cheers for that. Must be coffee o'clock.
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.
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.
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).
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.
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.
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.