This method is used to set the value of an application signal in a script running on a neoVI device.
int _stdcall icsneoScriptWriteAppSignal(void* hObject,unsignedint iIndex,double dValue);
Public Declare Function icsneoScriptWriteAppSignal Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iIndex As UInt32, ByRef dValue As Double) As Int32
[in] Specifies the driver object created by OpenNeoDevice.
iIndex
[in] The index value of the application signal.
dValue
[in] The new value of the application signal.
Return Values
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_APPSIG_INDEX = 225
Remarks
The script containing the specified application signal must have been successfully downloaded to the neoVI using ScriptLoad. The script must also have been started using ScriptStart. This function will fail if ScriptStop has been called. The valid index values for application signals within a script can be found in the cmvspy.vs3cmb.h file that is produced by Vehicle Spy. Please see Vehicle Spy documentation.
Examples
int iRetVal;unsignedlong lLastErrNum;double dValue;dValue =999;iRetVal =icsneoScriptWriteAppSignal(hObject, App_Signal_1, dValue);if(iRetVal ==0){printf("\nFailed to write the application signal. API Error = %d", lLastErrNum);}else{printf("\nApplication signal write succeeded\r\n");}
Int32 iResult;Double ValueToSet;//Set value to sendValueToSet =Convert.ToDouble(txtAppSigVal.Text);//Set App SignaliResult =icsNeoDll.icsneoScriptWriteAppSignal(m_hObject,Convert.ToUInt32(cboAppSig.SelectedIndex), ValueToSet);if(iResult ==0){txtAppSigVal.Text="Problem!";}else{txtAppSigVal.Text="Set!";}
Dim iResult As Int32
Dim ValueToSet As Double
'//Set value to send
ValueToSet = Val(txtAppSigVal.Text)
'//Set App Signal
iResult = icsneoScriptWriteAppSignal(m_hObject, Convert.ToUInt32(cboAppSig.SelectedIndex), ValueToSet)
If iResult = 0 Then
txtAppSigVal.Text = "Problem!"
Else
txtAppSigVal.Text = "Set!"
End If