Gaulty,
Here is some sample code that I know that works. You might not have you system initialized or setup correctly.
/////////////////////////////////////////////////
#include "flexmotn.h"
#include
int Status;
int main (int argc, char *argv[])
{
Status = flex_find_index (2, NIMC_AXIS2,NIMC_FORWARD_DIRECTION, 0);
return 0;
}