Instead of passing the function to setTimeout, you are _executing_ the function with module.requestSource(). This is a common oversight. Here is the proper syntax:
> setTimeout(module.requestSource, 3000);
Notice the remove parenthesis. Tiny change makes a big difference :-)
Florent
On Jun 1, 2012, at 6:45 PM, brbaltes wrote:
> I am currently having problems with the setTimeout() command in a module. It executes when testing but there is no delay where the setTimeout() command is called. Any help would be greatly appreciated!
>
> module.setSource = function(source)
> {
> module.sendCommand('SOURCE ' + Epson8700UBTables.Sources.Commands[source]);
> setTimeout(module.requestSource(), 3000);
> };
>
> module.requestSource = function()
> {
> module.sendCommand('SOURCE?');
> };
>
> Bryant
>
> --
> You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/fnWWPaN4EP4J.
> To post to this group, send email to comman...@googlegroups.com.
> To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
Instead of passing the function to setTimeout, you are _executing_ the function with module.requestSource(). This is a common oversight. Here is the proper syntax:
> setTimeout(module.requestSource, 3000);
Notice the remove parenthesis. Tiny change makes a big difference :-)
Florent
On Jun 1, 2012, at 6:45 PM, brbaltes wrote:
> I am currently having problems with the setTimeout() command in a module. It executes when testing but there is no delay where the setTimeout() command is called. Any help would be greatly appreciated!
>
> module.setSource = function(source)
> {
> module.sendCommand('SOURCE ' + Epson8700UBTables.Sources.Commands[source]);
> setTimeout(module.requestSource(), 3000);
> };
>
> module.requestSource = function()
> {
> module.sendCommand('SOURCE?');
> };
>
> Bryant
>
> --
> You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/fnWWPaN4EP4J.
> To post to this group, send email to comman...@googlegroups.com.
> To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/aEGYX8V8bcMJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.