Message Structures - neoVI API
C/C++ declare - Remarks

These structures are used to represent messages both received and transmitted by the neoVI device. 

C/C++ Declare

typedef struct // matching C structure
{
    unsigned long StatusBitField; 
    unsigned long StatusBitField2; 
    unsigned long TimeHardware; 
    unsigned long TimeHardware2; 
    unsigned long TimeSystem; 
    unsigned long TimeSystem2; 
    unsigned char TimeStampHardwareID; 
    unsigned char TimeStampSystemID;
    unsigned char NetworkID; 
    unsigned char NodeID;
    unsigned char Protocol;
    unsigned char MessagePieceID; 
    unsigned char ColorID; 
    unsigned char NumberBytesHeader;
    unsigned char NumberBytesData; 
    short DescriptionID; 
    long ArbIDOrHeader; 
    unsigned char Data[8]; 
    unsigned char AckBytes[8]; 
    float Value;
    unsigned char MiscData;
} icsSpyMessage;

typedef struct // matching C structure
{
    unsigned long StatusBitField; 
    unsigned long StatusBitField2; 
    unsigned long TimeHardware; 
    unsigned long TimeHardware2; 
    unsigned long TimeSystem; 
    unsigned long TimeSystem2; 
    unsigned char TimeStampHardwareID; 
    unsigned char TimeStampSystemID; 
    unsigned char NetworkID; 
    unsigned char NodeID; 
    unsigned char Protocol; 
    unsigned char MessagePieceID; 
    unsigned char ColorID; 
    unsigned char NumberBytesHeader;
    unsigned char NumberBytesData; 
    short DescriptionID; 
    unsigned char Header[4]; 
    unsigned char Data[8];
    unsigned char AckBytes[8]; 
    float Value;
    unsigned char MiscData;
} icsSpyMessageJ1850;

Remarks

There are two structures here. Both are equivalent. The only difference is how they represent message bytes. The icsspyMessageJ1850 provides a more convenient representation for J1850 or ISO messages with a header array holding the first three bytes of the message.

These structures can be use interchangeably in C by casting one type to the other. In Visual Basic, you can copy one structure to the other using the LSet method.

Table 1 below lists the members of the structure and specific remarks about their use.

Table 1 - Message Structure Elements

Item Description
StatusBitField 
StatusBitField2 
Bitfields which describe the message. These are described in a separate topic.
TimeHardware
TimeHardware2
This is the hardware time stamp. The TimeStamp is reset to zero every time the OpenPort method is called.

For the neoVI hardware, TimeHardware2 is more significant than TimeHardware. The resolution of TimeHardware is 1.6µs and and TimeHardware2 is 104.8576 ms. To calculate the time of the message in seconds use the following formula: "Timestamp (sec) = TimeHardware2* 0.1048576 + TimeHardware2 * 0.0000016". 

For the neoVI PRO or ValueCAN hardware, TimeHardware2 is more significant than TimeHardware. The resolution of TimeHardware is 1.0µs and and TimeHardware2 is 65.536 ms. To calculate the time of the message in seconds use the following formula: "Timestamp (sec) = TimeHardware2* 0.065536 + TimeHardware2 * 0.000001". 

 

TimeSystem 
TimeSystem2   
This is the system time stamp. TimeSystem is loaded with the value received from the timeGetTime call in the WIN32 multimedia API. The timeGetTime accuracy is up to 1 millisecond. See the WIN32 API documentation for more information. This timestamp is useful for time comparing with other system events or data which is not synced with the neoVI timestamp. Currently, TimeSystem2 is not used.
TimeStampHardwareID This is an identifier  of what type of hardware timestamp is used. Since neoVI's timestamp is always the same, this doesn't change.
TimeStampSystemID This is an identifier  of what type of system timestamp is used. Since WIN32 neoVI's timestamp is always the same, from the timeGetTime API, this doesn't change.
NetworkID This is the NetworkID as assigned in the OpenNeoDevice method. This value is used to identify which network this message was received on.
NodeID Not Used in the neoVI API.
Protocol This is the type of protocol which the message belongs to. Valid values are SPY_PROTOCOL_CAN, SPY_PROTOCOL_J1850VPW, and SPY_PROTOCOL_ISO9141.
MessagePieceID Not Used in the neoVI API.
ColorID Not Used in the neoVI API.
NumberBytesHeader Used for J1850/ISO messages. It indicates how many bytes are stored in the Header(1 to 4) array.
NumberBytesData Holds the number of bytes in the Data(1 to 8) array or the number of bytes in a CAN remote frame (The DLC).
DescriptionID Not Used in the neoVI API.
Header(1 To 4) or ArbIDOrHeader  Holds up to 3 byte 1850 header (bytes 1 through 3) or a 29 bit CAN header.
Data(1 To 8)  Holds the 8 data bytes in CAN messages or bytes 4 through 11 in J1850/ISO messages.
AckBytes(1 To 8) Not Used in the neoVI API.
Value     Not Used in the neoVI API.
MiscData Not Used in the neoVI API.

 

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

Last Updated : Tuesday, January 19, 2010