Remarks
If
Where == 0
, and the Action is already at the top of the execution list (
Idx == 0
), then the function
returns an error. Similarly, if
Where == 1
and the Action is at the bottom of the list, then an error is returned.
SetActionById ( ActionId, Name, Type, Delay, DutyCycle, StopAfter,
Port, Output )
Modifies an Action specified by its Action ID.
Syntax
HRESULT SetActionById(
[in] long ActionId,
[in] BSTR Name,
[in] long Type,
[in] double Delay,
[in] double DutyCycle,
[in] long StopAfter,
[in] BSTR Port,
[in] BSTR Output,
[out, retval] VARIANT_BOOL* Success
);
Parameters
Action ID
[in] ID for the specified Action.
Name
[in] Name to assign to the specified Action.
Type
[in] Type of Action, e.g. Serial, Variable, etc.
Delay
[in] Number of seconds to delay before sending
Output
to
Port.
This is a real number,
and non-integer values are allowed.
DutyCycle
[in] Number of seconds to delay between each successive execution of the Action. This is a
real number, and non-integer values are allowed.
StopAfter
[in] Number of times to repeat the Action. Set to
-1
to repeat infinitely.
Port
[in] Location where the output is sent.
Output
[in] Data that should be sent.
Success
[out, retval] TRUE if specified Action settings were updated, FALSE if updating the Action
failed.
Remarks
Action types that the WACI supports, depend on the device’s hardware capabilities (see GetActionType
( ActionId ), page
for valid type values).
The value of
Port
represents where the Action is going to send its output (see GetActionPort ( ActionId ),
for details on valid port values).
The value for
Output
depends on the value of
Type
(see GetActionOutput ( ActionId ), page
for more
information on valid values for
Output
).
15