InfraRed control with LogicMachine
Example: InfraRed control with LogicMachine
Task
How to control your AV with Global Cache IR control channel equipment, from KNX and LogicMachine visualization?
IR command transmit
IR controller from GC-100 or iTach family from Global Cache can be used for transmission.
LogicMachine is interconnected with IR controller over Ethernet or RS-232 serial port.
Below you can find a script code for LogicMachine Event-based script to transmit a command:
- local socket = require("socket")
- local tcp = assert(socket.tcp())
-
- tcp:connect(IP_adress, port); -- IP_adress: IP address
- -- of GlobalCache controller
- -- port: port number
- -- of GlobalCache controller
- -- default: 4998
- tcp:send(GC_Command); -- GC_Command: transmit string
- -- to controller GlobalCache
- tcp:receive()
- tcp:close()
GC_Command string’s format (without spaces):
Command,Modul:NumDev,Id,freq,Repeat,Оffset,P0,..,Pn^
- Command: Command for execution by controller of Global Cache. To transmit IR command Command=sendir. See full list in GLobal Cache manual.
- Modul: The module containing the appropriate IR port (e.g. for iTach=1
- NumDev: Number of port in the module starting with 1.
- Id: Id number of the command in range 0 – 65535
- Freq: IR channel frequency in Hz, from 20000 – 500000
- Repeat: on 0 – repeat the command up to 65535 times or while the command transmit is terminated
- Offset: Time period to repeat the telegram in the next transmissions (Repeat<>1), 1 – 255
- P0,…,Pn: String sequence defining impulse sequence in IR telegram
- ^: Symbol defining the end of command string, OD (Hex)
Example
- DevIR05CmdH="sendir,1:1,1,37650,1,1,"; -- неизменная часть простой IR команды
-
- tcp:send(DevIR05CmdH ..
- "341,171,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,64,21,64,21,64,21,64,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,64,21,64,21,1520,342,85,21,3765\r");
- -- "\r" this is "0D" (Hex) in LogicMachine.
IR command definition
Sequence of P0,…,Pn can be received:
- from Global Cachedatabase of IR commands
- by scanning IR commands
For scanning you will need:
- Scanner of IR commands, e.g., Global Cache iTach IP IP2IR
- Scanning application Global Cache iLearn
- PC with communication possibility with iLearn and scanner
iLearn
After receiving a telegram from IR remote in the “Edit View” window the string will appear defining the command to use with IR control channel from LogicMachine.