Moxa DA-SP08-I-DB [44/45] Da irigb 4dio pci104 emc4 module driver and utility installation

Moxa DA-SP08-I-DB [44/45] Da irigb 4dio pci104 emc4 module driver and utility installation
DA-IRIGB-4DIO-PCI104-EMC4 Module Driver and Utility Installation
3-9
/* 2. open the IRIG-B device by mxIrigbOpen(); */
HANDLE irigbCardHandle;
irigbCardHandle = mxIrigbOpen(0);
if( irigbCardHandle < 0 ) {
fprintf(stderr,"mxIrigbOpen() fail!\n");
return 0;
}
/* 3.1. Reference the IRIG-B API to control the IRIG-B module. EX: set the sync time source */
if (!mxIrigbSetSyncTimeSrc(irigbCardHandle, time_source) ) {
printf("Set sync source fail\n");
mxIrigbClose(irigbCardHandle);
return 0;
}
/* 3.2. Reference the IRIG-B API to control the IRIG-B module. EX: Configure IRIG-B input signal
type. */
if(!mxIrigbSetInputInterface(irigbCardHandle, time_source_interface, signal_type, inverse))
{
fprintf(stderr, "mxIrigbSetInputInterface() fail\n");
mxIrigbClose(irigbCardHandle);
return 0;
}
/*3.3. Reference the IRIG-B API to control the IRIG-B module. EX: Set Sync Time Source */
if(!mxIrigbSetSyncTimeSrc(irigbCardHandle, time_source)) {
fprintf(stderr,"mxIrigbSetSyncTimeSrc() time_source:%d fail\n", time_source);
mxIrigbClose(irigbCardHandle);
return 0;
}
/* …To do in your IRIG-B program … */
/* 4. Finally remember to close the IRIG-B device */
mxIrigbClose(irigbCardHandle);
For more information about creating an IRIG-B program, refer to the released code examples (such as
ServiceSyncTime.cpp, unites.cpp, or mxIrigUtil.cpp).

Содержание

Скачать