PULSE ?
thepainter
Posts: 69
Newbie self taught with lots of help. NI-3000 sending IR to a WDTV LIVE my code is
PUSH[TP_LOFT,67]
SEND_COMMAND WDTV,"'SP',POWER_TOGGLE"
This command actually turns it ON then OFF, when I test it using 'Diagnostics' in NS and use Control Device the same thing happens when pulsing channel '9' with the pulse set at 3/10. When I change the pulse to 1/10 and do the PULSE it works. Am I missing something in the code or is this something that I missed in the IR transfer. Sorry for what probably is a simple fix, but this is how I learn.
Thanks,
Paul
PUSH[TP_LOFT,67]
SEND_COMMAND WDTV,"'SP',POWER_TOGGLE"
This command actually turns it ON then OFF, when I test it using 'Diagnostics' in NS and use Control Device the same thing happens when pulsing channel '9' with the pulse set at 3/10. When I change the pulse to 1/10 and do the PULSE it works. Am I missing something in the code or is this something that I missed in the IR transfer. Sorry for what probably is a simple fix, but this is how I learn.
Thanks,
Paul
0
Comments
Are these learned commands? If so you may learned a double command and the shorter pulse cuts off transmisison of the 2nd command but you should able to do the same using SP by adjusting the CTON/OFF values.
IR devices are stupid. What an AMX box (and any control system/universal remote) does when you're controlling an IR device is attempt to mimic what the remote the manufacturer built does. In an ideal world there might be some more 'concrete' standards as far as protocols and timings go, but that would take all the fun out of it.
Generally, what tends to happen is when you press a button on an IR remote you are sitting in front of the device. What this means is as soon as it does what you are asking it to do, you see/hear that and lift your finger. This doesn't quite work so well when its a computer pressing that button because it can't see anything changing (unless you have some form of sensor in the signal chain). Because of this, the time to hold down that button on the remote must be predefined, and if that's not done correctly you end up with accidentally repeated commands - in your case the the power command.
With the IR device inside the AMX masters you've got a few differnt of ways of interacting with it. It entirely possible to treat it purely as a channel based device:
- You can use PULSE which will turn a channel on and then turn it off again after the time defined by SET_PULSE_TIME (0.5s by default)
- If it's been triggered by a button event (or another channel) TO can be used to emmit the command as long as the button is held or the channel remains on
- MIN_TO can be used in the situation above but if the button is released quickly it will keep emitting for at least the time defined by SET_PULSE_TIME
- ON and OFF can be use to discreetly start and stop emmitting
Check the NetLinx help file for more info on these.The other way you can approach it is to communicate via commands to the device, similar to what you were initially trying to do. What the SP commond does is say "hi there mr IR device, when you're done doing what your doing can you please emmit the command in this slot, please" (it's a buffer). To make that play nice with all IR devices there are also some other commands for setting timings etc CTON/CTOF. Using this allows you to set up different command timings for each device rather than relying on a global timing setup. All the info you need for this can be found in AMX-PI under 'NI Device Controller for NI-xxxx.
As Usual the Forum comes through once again.
I personally consider it mandatory to set up pulse timing by device. There is too much variation these days; some things like the shortest pulses properly, some like them nice and long. Mix both kinds in the same job, and the tracking is miserable to maintain.