GetISO15765Status Method - intrepidcs API
C/C++ declare - VB declare - VB.NET declare - C# declareParameters - Return Values - Remarks - C/C++ example - VB example - VB.NET example - C# example

This method gets and optionally clears the current status of the CAN ISO15765-2 network layer receive.

C/C++ Declare

void _stdcall icsneoGetISO15765Status(int hObject, int iNetwork, int iReserved1, int iClearRxStatus, int * iReserved2int * iRxStatus);

Visual Basic Declare

Public Declare Sub icsneoGetISO15765Status Lib "icsneo40.dll" (ByVal hObject As Long, _
              ByVal lNetwork As Long, ByVal lReserved1 As Long, _
              ByVal lClearRxStatus As Long, ByRef lReseverd2 As Long, ByRef lRxStatus As Long)

Visual Basic .NET Declare

Public Declare Sub icsneoGetISO15765Status Lib "icsneo40.dll" _
    (
ByVal hObject As Integer, ByVal iNetwork As Integer, _
    
ByVal
lReserved1 As Integer, ByVal iClearRxStatus As Integer, _
   
    ByRef lReserved2 As Integer, ByRef lRxStatus As Integer)

C# Declare

[DllImport("icsneo40.dll")]
public static extern void icsneoGetISO15765Status(int hObject, int iNetwork, int lReserved1, int iClearRxStatus, ref int lReserved2, ref int lRxStatus);


Parameters

hObject
    [in] Handle which specifies the driver object created with the OpenPort method. 

lNetwork
    [in] Specifies which CAN network the status is requested for. Can be one of the following values: NETID_HSCAN = 1, NETID_MSCAN = 2, NETID_SWCAN = 3, and NETID_LSFTCAN = 4.

lReserved1
    [in] Set to zero.

lClearRxStatus
    [in] If set to one this will clear the receive status and reset the receive state machine. If zero the status is not affected.

Reserved2
    [out] A reserved bitfield.

lRxStatus
    [out] A bitfield describing the progress of a receive operation. See Table 1 below for a definition of this bitfield.

Return Values

None. 

Remarks

None. 

 

Table 1 - lRxStatus Bitfield Definition

Flag Description
INTREPIDCS_15765_RX_ERR_GLOBAL  At least one error occurred during the last reception
INTREPIDCS_15765_RX_ERR_CFRX_EXP_FF  A consecutive frame was received while the a first frame or single frame was expected
INTREPIDCS_15765_RX_ERR_FCRX_EXP_FF  A flow control frame was received while a first frame or single frame was expected.
INTREPIDCS_15765_RX_ERR_SFRX_EXP_CF  A single frame was received when a consecutive frame was expected. The rx operation is cancelled.
INTREPIDCS_15765_RX_ERR_FFRX_EXP_CF  A first frame was received when a consecutive frame was expected. The rx operation is cancelled.
INTREPIDCS_15765_RX_ERR_FCRX_EXP_CF  A flow control frame was received when a consecutive frame was expected. The rx operation is cancelled.
INTREPIDCS_15765_RX_ERR_CF_TIME_OUT  The lCFTimeOutMs Timeout parameter was exceeded while waiting for consecutive frames. The rx operation is cancelled if detected by a call to read messages or GetISO15765Status. If a consecutive frame is received and the timeout is detected it will continue the long message but will set this flag. 
INTREPIDCS_15765_RX_COMPLETE  The rx operation received enough messages to contain all data as indicated in the first frame DL (data length) parameter. The rx operation is ready for next operation.
INTREPIDCS_15765_RX_IN_PROGRESS  There currently is a rx operation in progress.
INTREPIDCS_15765_RX_ERR_SEQ_ERR_CF This indicates that a Consecutive frame had an improper sequence count.

 


Examples

Visual Basic Example

    Dim lTxStatus As Long
    Dim lRxStatus As Long

    Call icsneoGetISO15765Status(m_hObject, NETID_HSCAN, 0, 0, lTxStatus, lRxStatus)

    lstStatusItems.Clear

    If (lRxStatus And icsspy15765RxErrGlobal) > 0 Then
        lstStatusItems.AddItem "Problem In Rx Status"
    End If

    If (lRxStatus And icsspy15765RxErrCFRX_EXP_FF) > 0 Then
        lstStatusItems.AddItem "Received a Consecutive Frame when expecting first frame"
    End If

    If (lRxStatus And icsspy15765RxErrFCRX_EXP_FF) > 0 Then
        lstStatusItems.AddItem "Received a Flow Control Frame when expecting first frame"
    End If

    If (lRxStatus And icsspy15765RxErrSFRX_EXP_CF) > 0 Then
        lstStatusItems.AddItem "Received a Single Frame when expecting Consecutive frame"
    End If

    If (lRxStatus And icsspy15765RxErrFFRX_EXP_CF) > 0 Then
        lstStatusItems.AddItem "Received a First Frame when expecting Consecutive frame"
    End If

    If (lRxStatus And icsspy15765RxErrFCRX_EXP_CF) > 0 Then
        lstStatusItems.AddItem "Received a Flow Control Frame when expecting Consecutive frame"
    End If

    If (lRxStatus And icsspy15765RxErrCF_TIME_OUT) > 0 Then
        lstStatusItems.AddItem "Consecutive Timeout"
    End If

    If (lRxStatus And icsspy15765RxComplete) > 0 Then
        lstStatusItems.AddItem "Last Messaging Successful"
    End If

    If (lRxStatus And icsspy15765RxInProgress) > 0 Then
        lstStatusItems.AddItem "Rx In Progress"
    End If

    If (lRxStatus And icsspy15765RxErrSeqCntInCF) > 0 Then
        lstStatusItems.AddItem "Incorrect Sequence Count in Consecutive Frames"
    End If


C/C++ Example

    int iTxStatus, iRxStatus;

    icsneoGetISO15765Status(hObject, NETID_HSCAN, 0, 0, &iTxStatus, &iRxStatus);

    // Output the rx status

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_GLOBAL)
   
     OutputDebugString(TEXT("Problem In Rx Status\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_CFRX_EXP_FF)
   
     OutputDebugString(TEXT("Received a Consecutive Frame when expecting first frame\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_FCRX_EXP_FF)
   
     OutputDebugString(TEXT("Received a Flow Control Frame when expecting first frame\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_SFRX_EXP_CF)
   
     OutputDebugString(TEXT("Received a Single Frame when expecting Consecutive frame\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_FFRX_EXP_CF)
   
     OutputDebugString(TEXT("Received a First Frame when expecting Consecutive frame\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_FCRX_EXP_CF)
   
     OutputDebugString(TEXT("Received a Flow Control Frame when expecting Consecutive frame\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_CF_TIME_OUT)
   
     OutputDebugString(TEXT("Consecutive Timeout\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_COMPLETE)
   
     OutputDebugString(TEXT("Last Messaging Successful\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_IN_PROGRESS)
        OutputDebugString(TEXT("Rx In Progress\n"));

    if (iRxStatus & INTREPIDCS_15765_RX_ERR_SEQ_ERR_CF)
   
     OutputDebugString(TEXT("Incorrect Sequence Count in Consecutive Frames\n"));


C# Example

int
lTxStatus = 0;
int
lRxStatus = 0;

//Acquire the ISO 15765 Paramerts
icsNeoDll.icsneoGetISO15765Status(m_hObject, 1, 0, 0,
ref lTxStatus,ref
lRxStatus);

//Check for Problems in ISO 15765 Rx status
if
((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrGlobal)) > 0)
lstStatusItems.Items.Add("Problem In Rx Status")

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrCFRX_EXP_FF)) > 0 )
lstStatusItems.Items.Add("Received a Consecutive Frame when expecting first frame");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrFCRX_EXP_FF)) > 0 )
lstStatusItems.Items.Add("Received a Flow Control Frame when expecting first frame");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrSFRX_EXP_CF)) > 0 )
lstStatusItems.Items.Add("Received a Single Frame when expecting Consecutive frame");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrFFRX_EXP_CF)) > 0 )
lstStatusItems.Items.Add("Received a First Frame when expecting Consecutive frame");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrFCRX_EXP_CF)) > 0 )
lstStatusItems.Items.Add("Received a Flow Control Frame when expecting Consecutive frame");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrCF_TIME_OUT)) > 0 )
lstStatusItems.Items.Add("Consecutive Timeout");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxComplete)) > 0 )
lstStatusItems.Items.Add("Last Messaging Successful");

if
((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxInProgress)) > 0 )
lstStatusItems.Items.Add("Rx In Progress");

if ((lRxStatus & Convert.ToInt32(icsspy15765RxBitfield.icsspy15765RxErrSeqCntInCF)) > 0 )
lstStatusItems.Items.Add("Incorrect Sequence Count in Consecutive Frames");

Visual Basic .NET Example

Dim lTxStatus As Long
Dim
lRxStatus As Long


'//Acquire the ISO 15765 Paramerts
Call icsneoGetISO15765Status(m_hObject, NETID_HSCAN, 0, 0, lTxStatus, lRxStatus)

'//Check for Problems in ISO 15765 Rx status
If (lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrGlobal) > 0 Then
    lstStatusItems.Items.Add("Problem In Rx Status")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrCFRX_EXP_FF) > 0 Then
    lstStatusItems.Items.Add("Received a Consecutive Frame when expecting first frame")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrFCRX_EXP_FF) > 0 Then
    lstStatusItems.Items.Add("Received a Flow Control Frame when expecting first frame"
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrSFRX_EXP_CF) > 0 Then
    lstStatusItems.Items.Add("Received a Single Frame when expecting Consecutive frame")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrFFRX_EXP_CF) > 0 Then
    lstStatusItems.Items.Add("Received a First Frame when expecting Consecutive frame")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrFCRX_EXP_CF) > 0 Then
    lstStatusItems.Items.Add("Received a Flow Control Frame when expecting Consecutive frame")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrCF_TIME_OUT) > 0 Then
    lstStatusItems.Items.Add("Consecutive Timeout")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxComplete) > 0 Then
    lstStatusItems.Items.Add("Last Messaging Successful")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxInProgress) > 0 Then
    lstStatusItems.Items.Add("Rx In Progress")
End If

If
(lRxStatus And icsspy15765RxBitfield.icsspy15765RxErrSeqCntInCF) > 0 Then
    lstStatusItems.Items.Add("Incorrect Sequence Count in Consecutive Frames")
End If

intrepidcs API Documentation - (C) Copyright 2000-2012 Intrepid Control Systems, Inc.  (www.intrepidcs.com)

Last Updated : Thursday, September 11, 2008