API Scope.AddOp: Difference between revisions
Appearance
XML import |
XML import |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<sidebar>API | <sidebar>API Contents</sidebar> | ||
Adds an operation to act on the inputs of the stream | Adds an operation to act on the inputs of the stream | ||
<div style="width:25%; float:right" class="toc"> | <div style="width:25%; float:right" class="toc"> | ||
===Class hierarchy===[[API Scope|Scope]] | ====Class hierarchy==== | ||
[[API Scope|Scope]] | |||
:[[API Scope|AddOp]] | :[[API Scope|AddOp]] | ||
</div> | </div> | ||
| Line 9: | Line 10: | ||
==Parameters== | ==Parameters== | ||
[[Variable Types|HANDLE]] ''StreamH'' | |||
:A handle to a previously created datascope stream | :A handle to a previously created datascope stream | ||
[[Variable Types|ULONG]] ''FuncOp'' | |||
:An operation to perform on the input | :An operation to perform on the input | ||
''Typical values for this parameter:'' | :''Typical values for this parameter:'' | ||
{| class="wikitable" | ::{| class="wikitable" width="65%" | ||
|- | |- | ||
|- | ! width="30%" |Name | ||
|- | ! width="55%" |Description | ||
|- | |- | ||
|- | |Op_Bound | ||
|- | |Bound the current value to the expected range of the input | ||
|- | |- | ||
|- | |Op_Scale | ||
|- | |Divide the current value to the expected range of the input | ||
|- | |- | ||
|- | |Op_Xor | ||
|- | |Exclusive-or with the provided integer argument | ||
|- | |- | ||
|- | |Op_AndNot | ||
|- | |Clear the bits in the provided integer argument | ||
|- | |- | ||
|- | |Op_And | ||
|- | |Isolate only the bits in the provided integer argument | ||
|- | |- | ||
|- | |Op_Orr | ||
|Set the bits in the provided integer argument | |||
|- | |||
|Op_Not | |||
|Invert (ones-compliment) the current input | |||
|- | |||
|Op_Add | |||
|Add the argument to the current input | |||
|- | |||
|Op_Sub | |||
|Subtract the argument from the current input | |||
|- | |||
|Op_Mul | |||
|Multiply the argument by the current input | |||
|- | |||
|Op_Div | |||
|Divide the current input by the argument | |||
|- | |||
|Op_Pow | |||
|Raise the input to the power of the argument | |||
|- | |||
|Op_Neg | |||
|Negate (twos compliment) the current input | |||
|- | |||
|Op_Recip | |||
|Perform the reciprocal on the current input | |||
|- | |||
|Op_Sqrt | |||
|Perform a square root on the current input | |||
|- | |||
|Op_Ln | |||
|Perform a natural logarithm on the current input | |||
|- | |||
|Op_Ln2 | |||
|Perform a base-2 logarithm on the current input | |||
|- | |||
|Op_Cos | |||
|Convert the input to its cosine value (input is in radians) | |||
|- | |||
|Op_Sin | |||
|Convert the input to its sine value (input is in radians) | |||
|- | |||
|Op_Tan | |||
|Convert the input to its tangent value (input is in radians) | |||
|- | |||
|Op_Int | |||
|Convert the input from a float to an integer (using the floor function) | |||
|} | |} | ||
[[Variable Types|FLOAT]] ''Arg'' | |||
:An optional argument that may be used by the FuncOp | :An optional argument that may be used by the FuncOp | ||
:''The default value for this parameter is: '''''0''' | :''The default value for this parameter is: '''''0''' | ||
==Return value== | ==Return value== | ||
[[Variable | [[Variable Types|BOOL]] | ||
Returns true if the operation is a success, else false | |||
==Detailed description== | ==Detailed description== | ||
''No additional information'' | ''<span style="color:red;">No additional information</span>'' | ||
==Examples== | ==Examples== | ||
| Line 54: | Line 104: | ||
* Declare a variable 'result' of type BOOL | * Declare a variable 'result' of type BOOL | ||
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Scope.AddOp(streamh, ::Scope.Op_Bound, arg)</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Scope.AddOp(streamh, ::Scope.Op_Bound, arg)</pre> | ||
''<span style="color:red;">No additional examples</span>'' | |||
Latest revision as of 15:57, 16 January 2014
<sidebar>API Contents</sidebar> Adds an operation to act on the inputs of the stream
Parameters
HANDLE StreamH
- A handle to a previously created datascope stream
ULONG FuncOp
- An operation to perform on the input
- Typical values for this parameter:
Name Description Op_Bound Bound the current value to the expected range of the input Op_Scale Divide the current value to the expected range of the input Op_Xor Exclusive-or with the provided integer argument Op_AndNot Clear the bits in the provided integer argument Op_And Isolate only the bits in the provided integer argument Op_Orr Set the bits in the provided integer argument Op_Not Invert (ones-compliment) the current input Op_Add Add the argument to the current input Op_Sub Subtract the argument from the current input Op_Mul Multiply the argument by the current input Op_Div Divide the current input by the argument Op_Pow Raise the input to the power of the argument Op_Neg Negate (twos compliment) the current input Op_Recip Perform the reciprocal on the current input Op_Sqrt Perform a square root on the current input Op_Ln Perform a natural logarithm on the current input Op_Ln2 Perform a base-2 logarithm on the current input Op_Cos Convert the input to its cosine value (input is in radians) Op_Sin Convert the input to its sine value (input is in radians) Op_Tan Convert the input to its tangent value (input is in radians) Op_Int Convert the input from a float to an integer (using the floor function)
FLOAT Arg
- An optional argument that may be used by the FuncOp
- The default value for this parameter is: 0
Return value
Returns true if the operation is a success, else false
Detailed description
No additional information
Examples
Calling in a calculation
- Declare a variable 'result' of type BOOL
- Add to a calculation icon:
result = ::Scope.AddOp(streamh, ::Scope.Op_Bound, arg)
No additional examples