Joined: 19 Nov 2004
|Posted: Sat Nov 19, 2005 2:26 pm Post subject: Repeating commands like Girder does?
|In Girder, when you open the USB-UIRT plugin dialog box by clicking the on "Settings" button from the "Plugins" tab, you see a field titled "Repeat". I assume this means how many times the IR command is sent to the USB UIRT, correct?
If this is true, how do I emulate the same behavior from my application? Which of the following approaches will repeat the command 4 times like Girder does?:
1) Making 4 separate transmit commands to the USB UIRT DLL. If this is the correct approach, should I add a "sleep" command before each repetitive call and if so, how many milliseconds?
2) Concatenate the IR codes string in the field labeled "Code 1". If this is the correct approach, then how do I do the concatenation? For example, if the IR code string is "R00008080", would I send the USB UIRT:
- "R00008080000080800000808000008080", only using the "R" prefix the first time and repeating only the numeric digits after that?
3) Another approach?
I ask this because I have noticed that for one particular command, Girder always gets the device to respond to the command, but when I send it from my app I sometimes have to repeat the command once or twice to get the device to respond (depending on the device's orientation to the USB UIRT).
If you have any additional timing tips on sending the command using repeats I'd appreciate it. My secondary worry is that if I do it wrong, I'll end up having the device interpret the repeated command as multiple commands instead of as a single command repeated multiple times. Since the command is a "toggle" command, if the device interprets the repeated commands as two separate commands instead of just one, they will "cancel out" and the device will do nothing. Note, when Girder sends the command with the Repeat field set to 4, the device successfully interprets it as a single command and quite reliably.
The device in this case is a Robopet.
RobotsRule Discussion Forum