Delta Electronics PCI-DMC-A01 Computer Hardware User Manual


 
Chapter 3 Operating Principles | PCI-DMC-A01 / PCI-DMC-B01
Revised March, 2012 3-3
NOTE
_DMC_01_get_device_table Get the Slot ID using the PDO protocol
Example: gpDeviceInfo[gDMCCardNo] is a “WORD” type variable. If its value is 7,
the binary form is expressed as “0000 0000 0000 0111”, so Slave devices with Slot
IDs “1”, “2” and “3” exist.
_DMC_01_get_node_table Get Node ID using SDO protocol.
Example: gpSlaveTable[0][gDMCCardNo] is a “DWORD” type variable. If its value is
7, the binary form is expressed as “0000 0000 0000 0000 0000 0000 0000 0111”, so
Slave devices with Node ID “1”, “2”, and “3” exist.
You can use the following algorithm to find the Node ID for SDO.
lMask = 0x1;
for(i=0; i<32; i++)
{
/* Condition is met when the i-th bit is 1. */
if((gpSlaveTable[0][gDMCCardNo]>>i) & lMask) {
/* The derived i-th value +1 is the Node ID and corresponds to servo parameter
“P3-00” */
gpNodeID[gNodeNum] = (unsigned short)(i+1);
gNodeNum++;
}
}
4) Exit procedure
Figure 3.5
Click on the “Exit” button to execute the following procedure:
for(i=0; i<gDMCExistCards; i++) {
rt = _DMC_01_reset_card(gpDMCCardNoList[i]); // Reset card
}
_DMC_01_close(); // Shut down PCI-DMC-A01