![background image](http://html1.mh-extra.com/html/aim/api-fdx-2-v2/api-fdx-2-v2_getting-started-manual_2871728041.webp)
API-FDX Linux Getting Started Manual
33
GmbH
Section 8 – Programming the API-FDX Module
8.1.9. Starting the Transmitter and the Receiver
void MyFdxStart()
{
TY_FDX_TX_CTRL x_TxControl;
TY_FDX_RX_CTRL x_RxControl;
//---Start the Receiver
x_RxControl.ul_StartMode = FDX_START;
x_RxControl.ul_GlobalStatisticReset = FDX_RX_GS_RES_ALL_CNT;
FdxCmdRxControl(g_ulPort2Handle, &x_RxControl);
//---Start the Transmitter
x_TxControl.ul_Count = 0;
x_TxControl.ul_StartMode = FDX_START;
FdxCmdTxControl(g_ulPort1Handle, &x_TxControl);
}
8.1.10. Stopping the Transmitter and the Receiver
void MyFdxStop()
{
TY_FDX_TX_CTRL x_TxControl;
TY_FDX_RX_CTRL x_RxControl;
//---Stop the receiver
x_RxControl.ul_StartMode = FDX_STOP;
x_RxControl.ul_GlobalStatisticReset = FDX_RX_GS_RES_ALL_CNT;
FdxCmdRxControl(g_ulPort2Handle, &x_RxControl);
//---Stop the transmitter
x_TxControl.ul_Count = 0;
x_TxControl.ul_StartMode = FDX_STOP;
FdxCmdTxControl(g_ulPort1Handle, &x_TxControl);
}
8.1.11. Releasing the Ports and Logging Out
void MyFdxFreeResources()
{
if (g_ulBoardHandle != 0)
FdxLogout(g_ulBoardHandle);
if (g_ulPort1Handle != 0)
{
if (g_pUdp1Port1Handle != NULL)
{
FdxCmdTxUDPDestroyPort(g_ulPort1Handle, g_pUdp1Port1Handle);
}
if (g_pUdp2Port1Handle != NULL)
{
FdxCmdTxUDPDestroyPort(g_ulPort1Handle, g_pUdp2Port1Handle);
}
FdxLogout(g_ulPort1Handle);
}
if (g_ulPort2Handle != 0)
{
if (g_pUdp1Port2Handle != NULL)
{