#include #include /* Needed if linking in external compiler; harmless otherwise */ #include #include "sxdrive.h" #include "sxdriveui.h" int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { int sxdrive_ID; double pos; char inputs[80]; if (InitCVIRTE(hInstance, 0, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */ return -1; /* out of memory */ sxdrive_init(3, 1, &sxdrive_ID); //sxdrive_set_software_limits(sxdrive_ID, 15., -15.); //sxdrive_zero(sxdrive_ID); //sxdrive_get_mot_position(sxdrive_ID, &pos); //printf("Motor position = %f rev\n", pos); //sxdrive_rel_move(sxdrive_ID, 1., 1., 10.); //sxdrive_zero(sxdrive_ID); //sxdrive_get_mot_position(sxdrive_ID, &pos); //printf("Motor position = %f rev\n", pos); //sxdrive_abs_move(sxdrive_ID, 1., 1., 0.); //sxdrive_zero(sxdrive_ID); //sxdrive_get_mot_position(sxdrive_ID, &pos); //printf("Motor position = %f rev\n", pos); //sxdrive_get_enc_position(sxdrive_ID, &pos); //printf("Encoder position = %f encoder lines\n", pos); //sxdrive_get_inputs(sxdrive_ID, inputs); //printf("Input status report: %s\n", inputs); //sxdrive_set_manual_jogs(sxdrive_ID, 1., 1.); //printf("Jogs enabled\n"); //printf("Move forward, go home\n"); //sxdrive_rel_move(sxdrive_ID, 1., 1., 5.); //sxdrive_go_home(sxdrive_ID, 1., 1.); //sxdrive_exit(sxdrive_ID); sxdriveui_init(sxdrive_ID); RunUserInterface(); return 0; }