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

This method configures a receive message using ISO15765-2 on a CAN network.  icsneoISO15765_EnableNetwroks must be called before using icsneoISO15765_ReceiveMessage.  PCI bytes and Flow control decoding is taken care of by the dll for the transaction.

C/C++ Declare

void _stdcall icsneoISO15765_ReceiveMessage(void * hObject, unsigned long ulIndex,stCM_ISO157652_RxMessage *pMsg);
 

Visual Basic .NET Declare

Public Declare Function icsneoISO15765_ReceiveMessage Lib "icsneo40.dll" (ByVal hObject As IntPtr, ByVal ulIndex As Integer, ByRef pMsg As stCM_ISO157652_RxMessage) As Int32

C# Declare

[DllImport("icsneo40.dll")]
public static extern Int32 icsneoISO15765_ReceiveMessage(IntPtr hObject,Int32 ulIndex,ref stCM_ISO157652_RxMessage pMsg);



Parameters

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

ulIndex
    [in] Specifies the Index to configure, 10 elements 0-9.

stCM_ISO157652_RxMessage
    [in] This is the address of the stCM_ISO15765_RxMessage structure. The structure contains the properties for the multi frame message transaction. 

Return Values

None. 

Remarks

None. 


Examples

C/C++ Example

int lResult;
stCM_ISO157652_RxMessage flow_cntrl_msg;

memset(&flow_cntrl_msg,0,
sizeof(flow_cntrl_msg));
lResult = icsneoISO15765_EnableNetworks(m_hObject, NETID_HSCAN);

//Build structure for message
flow_cntrl_msg.vs_netid = NETID_HSCAN;
flow_cntrl_msg.padding = 0xAA;
//Set Padding Byte
flow_cntrl_msg.id = 0x7E0; //ArbID of the message
flow_cntrl_msg.id_mask = 0xFFF; //The flow control arb filter mask (response id from receiver)
flow_cntrl_msg.fc_id = 0x7E8; //ArbID for the flow control Frame
flow_cntrl_msg.blockSize = 100;
flow_cntrl_msg.stMin = 100;
flow_cntrl_msg.cf_timeout = 1000;

//Set flags for Padding and ID information.
flow_cntrl_msg.paddingEnable = true;
flow_cntrl_msg.id_29_bit_enable =
false;
flow_cntrl_msg.fc_id_29_bit_enable =
false;
flow_cntrl_msg.ext_address_enable =
false;
flow_cntrl_msg.fc_ext_address_enable =
false;
flow_cntrl_msg.overrideSTmin = false;
flow_cntrl_msg.overrideBlockSize = false;

lResult = icsneoISO15765_ReceiveMessage(m_hObject, 0, &flow_cntrl_msg);


C# Example

int lResult;
String sTempNetwork;
stCM_ISO157652_RxMessage flow_cntrl_msg = new stCM_ISO157652_RxMessage();

lResult =
icsNeoDll.icsneoISO15765_EnableNetworks(m_hObject, Convert.ToInt32(eNETWORK_ID.NETID_HSCAN));

//Build structure for message
flow_cntrl_msg.vs_netid = Convert.ToInt16(eNETWORK_ID.NETID_HSCAN);
flow_cntrl_msg.padding = 0xAA;
//Set Padding Byte
flow_cntrl_msg.id = 0x7E0 //ArbID of the message
flow_cntrl_msg.id_mask = 0xFFF; //The flow control arb filter mask (response id from receiver)
flow_cntrl_msg.fc_id = 0x7E8; //ArbID for the flow control Frame
flow_cntrl_msg.blockSize = 100;
flow_cntrl_msg.stMin = 100;
flow_cntrl_msg.cf_timeout = 1000;

//Set flags for Padding and ID information.
flow_cntrl_msg.flags = 0;
int iFlags = Convert.ToInt32(stCM_ISO157652_RxMessage_Flags.enableFlowControlTransmission);
iFlags = (iFlags | Convert.ToInt32(CSnet.stCM_ISO157652_TxMessage_Flags.paddingEnable));
flow_cntrl_msg.flags =
Convert.ToUInt16(iFlags);

lResult =
icsNeoDll.icsneoISO15765_ReceiveMessage(m_hObject, 0, ref flow_cntrl_msg);
  

Visual Basic .NET Example

Dim
lResult As Integer
Dim
flow_cntrl_msg As stCM_ISO157652_RxMessage

lResult = icsneoISO15765_EnableNetworks(m_hObject, NETID_HSCAN)

'//Build structure for message
flow_cntrl_msg.vs_netid = NETID_HSCAN
flow_cntrl_msg.padding = &HAA '//Set Padding Byte
flow_cntrl_msg.id = &H7E0 '//ArbID of the message
flow_cntrl_msg.id_mask = &HFFF '//The flow control arb filter mask (response id from receiver)
flow_cntrl_msg.fc_id = &H7E8 '//ArbID for the flow control Frame
flow_cntrl_msg.blockSize = 100
flow_cntrl_msg.stMin = 100
flow_cntrl_msg.cf_timeout = 1000

'//Set flags for Padding and ID information.
flow_cntrl_msg.flags = Convert.ToUInt32(stCM_ISO157652_RxMessage_Flags.enableFlowControlTransmission)
flow_cntrl_msg.flags =
CUShort(flow_cntrl_msg.flags Or stCM_ISO157652_TxMessage_Flags.paddingEnable)

lResult = icsneoISO15765_ReceiveMessage(m_hObject, 0, flow_cntrl_msg)

  

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

Last Updated : Monday, November 29, 2021