Menu

NetworkViewer:Developers

Go back to [NetworkViewer] section.

API Documentation

XML Configuration Files

According to the Project ID field, the adequate configuration file containing all the variables and the corresponding memory offsets is automatically loaded by the NetworkViewer. The following section details the configuration file.

Supported data types in the NetworkViewer :

  • uint[8,16,32] (1,2,4 bytes)
  • sint[8,16,32] (1,2,4 bytes)
  • float (4 bytes)
  • double (8 bytes)

Let's suppose we have a project which answers the ALIVE_REQUEST with project_id = 1 with the following data structure :

typedef union 
{ 
    struct project_1_values
    {
       uint8 var1;  //offset 0
       uint16 var2; //offset 1
       uint32 var3; //offset 3
       sint8 var4;  //offset 7
       sint16 var5; //offset 8
       sint32 var6; //offset 10
       float var7;  //offset 14
       double var8; //offset 18
    }

    unsigned char data_flow_table[26];
} AllData;

Here is the NetworkViewer configuration file for the variables :

<ModuleConfiguration moduleState="-1" deviceID="-1" projectID="1" codeVersion="-1" processorID="-1" tableVersion="-1" >
     <ModuleVariable offset="0"  description="Description" type="uint8"  value="" name="Var1" />
     <ModuleVariable offset="1"  description="Description" type="uint16" value="" name="Var2" />
     <ModuleVariable offset="3"  description="Description" type="uint32" value="" name="Var3" />
     <ModuleVariable offset="7"  description="Description" type="sint8"  value="" name="Var4" /> 
     <ModuleVariable offset="8"  description="Description" type="sint16" value="" name="Var5" />
     <ModuleVariable offset="10" description="Description" type="sint32" value="" name="Var6" />
     <ModuleVariable offset="14" description="Description" type="float"  value="" name="Var7" />
     <ModuleVariable offset="18" description="Description" type="double" value="" name="Var8" />
</ModuleConfiguration>

Building NetworkViewer From Sources

Random Development Ideas

  • Configuration editor
  • Support more scripting languages
    • Python
    • Matlab / Octave
  • Distributed NetworkViewers
    • Client / Server architecture
    • Remote probing
  • Data Analysis
  • Android Port with necessitas Qt for Android

NetworkViewer Data Structures

  • **NetworkModule">NetworkModule**. A NetworkModule is a physical entity on the CAN bus that have its own address (destination field in the IntRoLab frame). Each module have its configuration that is stored in the ModuleConfiguration data structure. Each module have the following variables :
    • ModuleConfiguration m_configuration;. The module configuration.
    • bool m_active; TRUE if the module is detected on the bus, FALSE otherwise
  • **ModuleConfiguration">ModuleConfiguration**. ModuleConfiguration contains the following elements :
    • int m_projectID; Project number.
    • int m_codeVersion; Code version.
    • int m_processorID; The identification number of the CPU/Microcontroller.
    • int m_moduleState; State of the module  : NORMAL, IDLE, PROGRAMMING used for the bootloader.
    • int m_tableVersion; Protocol version, we are at protocol version = 2.
    • int m_deviceID; Address on the bus.
    • QList<ModuleVariable*> m_variables; Variables contained in the module.
  • **ModuleVariable">ModuleVariable**. Each variable contains the following elements :
    • VARIABLE_TYPE m_type; Variable type : {DOUBLE, FLOAT, SINT32, UINT32, SINT16, UINT16, SINT8, UINT8, INVALID}.
    • VARIABLE_MEMORY_TYPE m_memType; Memory type : {RAM_VARIABLE,EEPROM_VARIABLE, SCRIPT_VARIABLE}. RAM, EEPROM -> on the module, SCRIPT->Scripting variable from the NetworkViewer GUI.
    • QString m_name; Variable name.
    • unsigned int m_offset; Variable offset. -1 if invalid.
    • QString m_description; Variable description.
    • QVariant m_value; Value of the variable. Will be updated automatically by the NetworkScheduler.
    • unsigned long m_version; Internal counter to track variable update time.
    • int m_deviceID; Address of the variable.
    • bool m_activated; TRUE if the NetworkScheduler is updating this variable.

NetworkScheduler

Automatic scheduling of variables is done with the NetworkScheduler. It acts as a "round-robin" scheduler by scheduling "activated" variables one at the time at every millisecond (ms). Here is the automatique request sent over the CAN bus :

TABLE 3 : IntRoLab CAN Frame - Request a variable on the bus

PRIORITY (3 bits) TYPE (8 bits) BOOT (2 bits) COMMAND (8 bits) DESTINATION (8 bits) RTR (1 bit) DATA LENGTH (4 bits) DATA (0-64 bits)

CAN 29 bits ARBITRATION FIELD, EXTENDED ID (EID)
ADDITIONAL FRAME INFORMATION (STANDARD)

0 = max

  • CAN_TYPE_REQUEST_DATA=0x20

  • BIT0 = READ(0), BIT1 = RAM(O) ou EEPROM(1) depending on memory type.

  • CMD = memory offset (0,255), bytes

  • Module address

  • 1 = Remote transmission request

  • Variable size in bytes, maximum = 8

  • Empty, RTR=1
    The destination module will answer with :

TABLE 4  : IntRoLab CAN Frame - Answer For Variable Request

PRIORITY (3 bits) TYPE (8 bits) BOOT (2 bits) COMMAND (8 bits) DESTINATION (8 bits) RTR (1 bit) DATA LENGTH (4 bits) DATA (0-64 bits)

CAN 29 bits ARBITRATION FIELD, EXTENDED ID (EID)
ADDITIONAL FRAME INFORMATION (STANDARD)

0 = max

  • CAN_TYPE_REQUEST_DATA=0x20

  • BIT0 = READ(0), BIT1 = RAM(O) ou EEPROM(1) Depending on memory type.

  • CMD = memory offset (0,255)

  • Module address

  • 0 = Normal

  • Variable size, maximum 8 bytes

  • DATA[0] = LSB, DATA[data_length -1] = MSB.


Related

OpenECoSys-Wiki: NetworkViewer

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.