.

General Purpose Motor I/O

There are up to 32 general purpose I/O signals associated with each drive/motor on a SynqNet node. However, many nodes do not support all 32 I/O signals. These I/O signals can either be an input, output or are sometimes software configurable as either an input/output.

Signals that can be outputs can either be controlled by the user, or the node may allow the output to be a motion specific function, such as a stepper output signal.

For example, Motor 1 on an RMB-10V2 node from MEI (using the C0FE0029 FPGA) supports the following general purpose I/O bits.

Bit
Description
Supported
Direction
Motor 0
External Pins
on J0_1
0
XCVR_A
Y
Selectable
15 & 49
1
XCVR_B
Y
Selectable
16 & 50
2
XCVR_C
Y
Selectable
17 & 51
3
 
N
   
4
 
N
   
5
 
N
   
6
USER_0_IN
Y
IN only
14 &48
7
USER_0_OUT
Y
OUT only
14 &48
8-31
 
N
 

Each of the general purpose I/O signals supported by a node has a structure similar to the following diagram.

The I/O signal can either be directly controlled from the output register or monitored with the input register. There are a maximum of 15 other sources that could drive an output pin, although most node types do not have this many internal sources available. The internal feature of the node that could drive each of these sources is dependant upon the node's design and loaded SynqNet FPGA version.

 

Getting Information about General Purpose I/O

The MEIMotorInfo structure returned from a call to the meiMotorInfo(...) function returns data about what general purpose I/O is supported and which configuration options are valid for each general purpose I/O signal.

 

typedef struct MEIMotorInfoGeneralIO {
    long               supported;
    char               *name;
    MEIMotorIoTypeMask validTypes;
} MEIMotorInfoGeneralIO;

struct MEIMotorInfo {
    ...
    MEIMotorInfoGeneralIO generalIO[MPIMotorGeneralIoLAST];
}

The name field gives the name of the node used for this I/O pin.
The validTypes field returns a bitmap where each true bit indicates that the source type is valid for this motor/node. The following enumerations can be used to decode the validTypes field.

 

typedef enum MEIMotorIoType {

    MEIMotorIoTypeOUTPUT,

    MEIMotorIoTypePULSE_A,
    MEIMotorIoTypePULSE_B,
    MEIMotorIoTypeCOMPARE_0,
    MEIMotorIoTypeCOMPARE_1,
    MEIMotorIoTypeSOURCE5
    MEIMotorIoTypeBRAKE,

    MEIMotorIoTypeSSI_CLOCK0,
    MEIMotorIoTypeSSI_CLOCK1,

    MEIMotorIoTypeSOURCE9,
    MEIMotorIoTypeSOURCE10,
    MEIMotorIoTypeSOURCE11,
    MEIMotorIoTypeSOURCE12,
    MEIMotorIoTypeSOURCE13,
    MEIMotorIoTypeSOURCE14,
    MEIMotorIoTypeSOURCE15,

    MEIMotorIoTypeINPUT,

    MEIMotorIoTypeSOURCE1 = MEIMotorIoTypePULSE_A,
    MEIMotorIoTypeSOURCE2 = MEIMotorIoTypePULSE_B,
    MEIMotorIoTypeSOURCE3 = MEIMotorIoTypeCOMPARE_0,
    MEIMotorIoTypeSOURCE4 = MEIMotorIoTypeCOMPARE_1,

    MEIMotorIoTypeSOURCE6 = MEIMotorIoTypeBRAKE,
    MEIMotorIoTypeSOURCE7 = MEIMotorIoTypeSSI_CLOCK0,
    MEIMotorIoTypeSOURCE8 = MEIMotorIoTypeSSI_CLOCK1,
} MEIMotorIoType;

typedef enum MEIMotorIoTypeMask {
    MEIMotorIoTypeMaskOUTPUT   = (1<<MEIMotorIoTypeOUTPUT),
    MEIMotorIoTypeMaskSOURCE1  = (1<<MEIMotorIoTypeSOURCE1),
    MEIMotorIoTypeMaskSOURCE2  = (1<<MEIMotorIoTypeSOURCE2),
    MEIMotorIoTypeMaskSOURCE3  = (1<<MEIMotorIoTypeSOURCE3),
    MEIMotorIoTypeMaskSOURCE4  = (1<<MEIMotorIoTypeSOURCE4),
    MEIMotorIoTypeMaskSOURCE5  = (1<<MEIMotorIoTypeSOURCE5),
    MEIMotorIoTypeMaskSOURCE6  = (1<<MEIMotorIoTypeSOURCE6),
    MEIMotorIoTypeMaskSOURCE7  = (1<<MEIMotorIoTypeSOURCE7),
    MEIMotorIoTypeMaskSOURCE8  = (1<<MEIMotorIoTypeSOURCE8),
    MEIMotorIoTypeMaskSOURCE9  = (1<<MEIMotorIoTypeSOURCE9),
    MEIMotorIoTypeMaskSOURCE10 = (1<<MEIMotorIoTypeSOURCE10),
    MEIMotorIoTypeMaskSOURCE11 = (1<<MEIMotorIoTypeSOURCE11),
    MEIMotorIoTypeMaskSOURCE12 = (1<<MEIMotorIoTypeSOURCE12),
    MEIMotorIoTypeMaskSOURCE13 = (1<<MEIMotorIoTypeSOURCE13),
    MEIMotorIoTypeMaskSOURCE14 = (1<<MEIMotorIoTypeSOURCE14),
    MEIMotorIoTypeMaskSOURCE15 = (1<<MEIMotorIoTypeSOURCE15),

    MEIMotorIoTypeMaskINPUT    = (1<<MEIMotorIoTypeINPUT),

    MEIMotorIoTypeMaskPULSE_A    = (1<<MEIMotorIoTypePULSE_A),
    MEIMotorIoTypeMaskPULSE_B    = (1<<MEIMotorIoTypePULSE_B),
    MEIMotorIoTypeMaskCOMPARE_0  = (1<<MEIMotorIoTypeCOMPARE_0),
    MEIMotorIoTypeMaskCOMPARE_1  = (1<<MEIMotorIoTypeCOMPARE_1),
    MEIMotorIoTypeMaskBRAKE      = (1<<MEIMotorIoTypeBRAKE),
    MEIMotorIoTypeMaskSSI_CLOCK0 = (1<<MEIMotorIoTypeSSI_CLOCK0),
    MEIMotorIoTypeMaskSSI_CLOCK1 = (1<<MEIMotorIoTypeSSI_CLOCK1),
} MEIMotorIoTypeMask;


For example, calling the meiMotorInfo(...) function for Motor 1 on an RMB-10V2 node would return the following data:

General I/O Bit
Supported
Name
validTypes
motorInfo.generalIO[0].supported
1
XCVR A 0x00010027
motorInfo.generalIO[1].supported
1
XCVR B 0x00010027
motorInfo.generalIO[2].supported
1
XCVR C 0x00010027
motorInfo.generalIO[3].supported
0
 
0
motorInfo.generalIO[4].supported
0
 
0
motorInfo.generalIO[5].supported
0
 
0
motorInfo.generalIO[6].supported
1
User In 0 0x00010000
motorInfo.generalIO[7].supported
1
User Out 0 0x00010027
motorInfo.generalIO[8].supported
0
 
0
motorInfo.generalIO[9].supported
                       -
motorInfo.generalIO[31].supported
0
 
0

 

Configuring the General Purpose I/O

The type/source control of the I/O mux. for each general purpose I/O is configured with the MEIMotorIoConfig fields in the MEIMotorConfig structure.

For example, here is the MPI code used to set the first general purpose I/O pin as an output that is driven by the internal brake signal:

 

MEIMotorConfig motorConfig;
mpiMotorConfigGet( motor0, NULL, &motorConfig );

motorConfig.Io[0].Type = MEIMotorIoTypeBRAKE;

mpiMotorConfigSet( motor0, NULL, &motorConfig );

 

Accessing the General Purpose I/O

To access the general purpose I/O associated with a motor the following set of functions are available. For accessing general purpose I/O as a set, you can use:
            - mpiMotorGeneralIn
            - mpiMotorGeneralOutSet
            - mpiMotorGeneralOutGet

These functions take two arguments, bitStart and bitCount, which allow either a single bit to be accessed (bitCount equals one) or multiple adjacent I/O bits to be accessed (bitCount greater than one).

The following code shows how to get the state of general purpose input 0.

 

long x;
mpiMotorGeneralIn( motor0, 0, 1, &x );

The next piece of code shows how to get the state of all the general purpose outputs:

 

long x;
mpiMotorGeneralOutGet( motor0, 0, MEIMotorGeneralIoLAST, &x );

 

FPGA I/O Bitmapping

Each SynqNet drive supports different FPGA I/O Bitmapping. Please select a drive from the menu below to see the supported general purpose I/O bits for that particular drive. If the SynqNet drive you are using is not listed, refer to our SynqNet Drives page for more information.


       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering