ASCII Rules (LG TVs)

drvnbysound

Senior Member
I want to soon add my LG TVs RS232 connection to an XSP. Based on the documentation that I found on the LG ASCII protocol, you select the TV number [Set ID] from the TVs menu system allowing the connection of all TVs on a single RS232 connection (odd, I know). Their command structure is written to use the following syntax: [Command] [Set ID] [Data] [Cr]

Having said that, I haven't yet connected more than 1 TV to a single serial connection. I connected to a single TV about a year ago to ensure the command set/protocol I found was correct for the TV I had (then later found the same protocol in the instruction manual that was provided with the TV). Anyhow, I don't see any reason that the Set ID would be needed in the command if multiple sets were not able to be connected on a single cable (allowing messages to be addressed to individual TVs); otherwise, the message would be dependent on the individual connections to each TV.

So, my actual question... Assuming the above case is true, is there a 'good way' to enter ASCII commands that could be sudo-dynamic? I understand that I COULD simply enter every ASCII command into ELK along with the SET ID for each TV... but that's simply a LOT of commands when you get multiple TVs (e.g. Power On command for TV1, Power On command for TV2.... ). Do anyone know of a smart way to have this setup where I could have the message sent in 'parts'... example being to have the Command list entered as ASCII strings, a few Set IDs, as well as Data entries. Then, upon various rules, the message would be sent in proper 'parts', based on the event. Does it make sense to do it this way, or should I just enter all the commands I want for each TV separately with respective Set IDs?
 
Well for the M1, each command string needs to be custom text string. I'm not sure if you could concatenate them - so you have one string for each "set" and another for the command, so you'd send set+command... something to experiment with. The M1's handling of text strings just isn't all that sophisticated.

I'm not at a computer with ElkRP right now or I'd look more - but I'd start by seeing if you can send one serial command with another - that'd accomplish the Set separate from the Command.
 
Right... I've used some basic ASCII strings for my Kwikset locks, but wasn't sure if anyone had tried concatenated messages as I described above to try and keep from having so many redundant/similar strings (in my case, for each Set ID).

I believe the ^M in ElkRP is equivalent to a Cr (correct?). So, I would think (hope), based on the LG protocol, that as long as the final message would be the only one that had the ^M inserted, the message should concatenate and transfer properly... I guess we'll see ;)

At a basic level, all I really want to do (for now) is end up connecting a CCTV system to my TV(s) as well... and upon event (e.g. doorbell) switch to Input X. However, I would also add some logic to it as well... such as checking to see which, if any, TV is currently turned on.
 
Back
Top