ScriptStopFBlock Method - intrepidcs API
C/C++ declare -
VB declare - VB.NET declare
- C# declare - Parameters - Return
Values - Remarks - C/C++ example
- VB example - VB.NET
example - C# example
This method stops the execution of a specified function block within a script on a neoVI device.
C/C++ Declare
int
_stdcall
icsneoScriptStopFBlock(int hObject,
unsigned int iFunctionBlockIndex);
Visual Basic Declare
Public
Declare Function icsneoScriptStopFBlock Lib "icsneo40.dll" (ByVal hObject As Long, ByVal fb_index As Long) As LongVisual Basic .NET Declare
Public
Declare
Function
icsneoScriptStopFBlock Lib
"icsneo40.dll" (ByVal
hObject As Int32,
ByVal fb_index
As UInt32)
As
Int32
C# Declare
[DllImport("icsneo40.dll")]
public
static
extern
Int32 icsneoScriptStopFBlock(Int32 hObject,UInt32 fb_index);
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
iFunctionBlockIndex
[in] The index value of the function
block to stop
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE
= 75
NEOVI_ERROR_DLL_SCRIPT_INVALID_FUNCBLOCK_INDEX = 219
NEOVI_ERROR_DLL_SCRIPT_NO_SCRIPT_RUNNING = 226
The script containing the specified function block must have been successfully downloaded to the neoVI using LoadScript. Execution of the script must have been started by StartScript. Execution of the function block must have been started using StartFBlock. The valid index values for function blocks within a script can be found in the cmvspy.vs3cmb.h file (Produced by Vehicle Spy. Please see Vehicle Spy documentation).
Examples
Visual Basic Example
Dim
iResult As
Long
'//Stop Function Block in CoreMini
iResult = icsneoScriptStopFBlock(m_hObject,
cboFBToChange.ListIndex)
If iResult = 0
Then
lblFBStatus.Caption =
"Function Block failed to Stop"
Else
lblFBStatus.Caption =
"Function Block Stopped"
End
If
C/C++ Example:
int iRetVal;
unsigned
long lLastErrNum;
iRetVal = icsneoScriptStopFBlock(hObject, Function_Block_1);
if(iRetVal == 0)
{
printf("\nFailed to
stop the function block.);
}
else
{
printf("\nSuccessfully
stopped the function block");
}
C# Example:
Int32 iResult;
//Stop Function Block in CoreMini
iResult = icsNeoDll.icsneoScriptStopFBlock(m_hObject,
Convert.ToUInt32(cboFBToChange.SelectedIndex));
if(iResult == 0)
{
lblFBStatus.Text = "Function Block failed to Stop";
}
else
{
lblFBStatus.Text = "Function Block Stopped";
}
Visual Basic .NET Example:
Dim iResult As
Int32
'//Stop Function Block
in CoreMini
iResult =
icsneoScriptStopFBlock(m_hObject, Convert.ToUInt32(cboFBToChange.SelectedIndex))
If
iResult = 0
Then
lblFBStatus.Text = "Function Block failed to Stop"
Else
lblFBStatus.Text =
"Function Block Stopped"
End
If
| intrepidcs API Documentation - (C) Copyright 2000-2012 Intrepid Control Systems, Inc. (www.intrepidcs.com) |
Last Updated : Tuesday, December 30, 2008