lgo_DownloadDriverModule()
Initiate downloading of driver module into an intelligent board.
#include "laygo.h" LResult lgo_DownloadDriverModule ( LDriverId driver, LBoardId board, LFileName fileName );
driver | driver controlling the board |
board | driver relative board id |
fileName | name of file containing driver module |
lgo_DownloadDriverModule() initiates the download of a driver module into an intelligent board.
lgo_DownloadDriverModule() should be called only after lgo_CheckHardwareInitialization() has returned successfully.
LayGO driver module files have a default extension of .drv. If no path to the file is given, lgo_DownloadDriverModule() looks for the file first in the current directory, then in \laygo\bin on the current drive. An alternative default directory can be specified using the environment variable LAYGODRV.
If successful, lgo_DownloadDriverModule() returns a non-negative value indicating the minimum number of seconds to wait for a successful initialization. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
LResult result; if ((result = lgo_InitializeHardware(0, 0)) < 0) { return (FAILURE); } else { Sleep((long) result * 1000); if (lgo_CheckHardwareInitialization(0, 0) < 0) { return (FAILURE); } else { if ((result = lgo_DownloadDriverModule(0, 0, file) < 0) { return (FAILURE); } }