Delta Electronics PCI-DMC-B01 Manual De Usuario

Descargar
Página de 528
Chapter 3 Operating Principles |  PCI-DMC-A01 / PCI-DMC-B01
 
3-2 
 
Revised March, 2012 
Click on the “Open card” button to execute the following procedure:   
/* gDMCExistCards variable is set as the number of PCI-DMC-A01 on the PC*/ 
rt = _DMC_01_open(&gDMCExistCards); 
 
2) Card initialization 
 
Figure 3.3 
 
Click on the “Card init” button to execute the following procedure:   
for(i=0; i<gDMCExistCards; i++)   
/* Get the card number of the i-th card on the PC. Card number is the value set by 
the DIP Switch*/ 
rt = _DMC_01_get_CardNo_seq(i, &CardNo);   
gpDMCCardNoList[i] = CardNo; 
 
/*Check to see if the card has been initialized. If the value is 0, then the card has not 
been initialized .*/ 
rt = _DMC_01_check_card_running(gpDMCCardNoList[i], &running);   
if(running == 0) { 
rt = _DMC_01_pci_initial(gpDMCCardNoList[i]); 
 
// Initialize card
 
if(rt != 0) AfxMessageBox(“Can't boot PCI_DMC_01 Master Card!”); 

rt = _DMC_01_initial_bus(gpDMCCardNoList[i]); 
// Initialization communications 
protocol
 
gbpDSPBoot[gpDMCCardNoList[i]] = true; 
 
3) Establish communications 
 
Figure 3.4 
 
Click on the “Find slave” button to execute the following procedure:   
rt = _DMC_01_start_ring(gDMCCardNo, 0); 
// Begin communications
 
rt = _DMC_01_get_device_table(gDMCCardNo, &gpDeviceInfo[gDMCCardNo]); 
rt = _DMC_01_get_node_table(gDMCCardNo, &gpSlaveTable[0][gDMCCardNo]); 
Once the above procedure has been executed, the detected Slave device is 
displayed in the “Slave num” field.