MPISynqNetInfo

Definition

typedef struct MPISynqNetInfo {
    MPINetworkType          networkType;
    int32_t                    nodeCount;
    int32_t                    nodeOffset;
    MPISynqNetCableLength   cableLength[MPISynqNetCableHOP_COUNT];
/* measured length */ } MPISynqNetInfo;

Description

MPISynqNetInfo contains static data that is determined during network initialization. It identifies the network type, number of nodes on the network, starting number (offset) of the first node, and an rough estimate of measured cable lengths.

networkType contains currently discovered network topology type.
nodeCount Contains the number of nodes currently discovered on the network.
nodeOffset Starting node number for nodes on this network. Nodes are currently numbered sequentially across all networks on a controller.
cableLength An array of measured network cable lengths. These values are estimated values. At network discovery, where network topology has not been saved to flash, the controller will send network packets to measure each cable length and automatically fill out these values for each cable found. These values are estimated values and are the values used in the network scheduling calculations.

Sample Code

/*  Get the number of nodes on the SynqNet network
   Returns -1 if there is an error
*/
int NumberOfNodes(MPISynqNet synqNet)
{
    MPISynqNetInfo info;
    int32_t returnValue;
    int numNodes = -1;

    returnValue = mpiSynqNetInfo(synqNet, &info);
    
    if(returnValue == MPIMessageOK) {
        numNodes = info.nodeCount;
    }
    return numNodes;
}

See Also

mpiSynqNetInfo | MPISynqNetConfig