04-17-2007 07:03 PM
My question is that it doesn't really mention what needs to be in it other than the call to MotionAssistantScript, but this code snippet implies that I need to write it specific to my application. But as it doesn't really specify what should be in it to run properly or how to write it I am confused. Some clarification and maybe an example of how these could be written properly or two would be appreciated.
Thanks
Ben
04-18-2007 03:32 PM
Hello Ben,
The template you are looking at should work with your setup, with only a few minor modifications. If you take a look at the NI-Motion C Reference Help for the function flex_stop_motion, you will see that it accepts 4 parameters: boardID, axisOrVectorSpace, stopType, axisOrVSMap.
status = flex_stop_motion(u8 boardID, u8 axisOrVectorSpace, u16 stopType, u16 axisOrVSMap);
Depending on the configuration you have setup, you will need to change these parameters accordingly, as described in the Motion Reference Help. For example, to use this example to stop axis 1 on a board with boardID 1, you would use the following parameters:
flex_stop_motion(1, NIMC_AXIS1, NIMC_KILL_STOP, 0)
Regards,
Jasper S
04-19-2007 07:29 PM
04-20-2007 03:46 PM
Hello,
The test.c file is simply a means to run the Motion Assistant code. You can call the MotionAssistantScript function from anywhere, but it is recommended that it be ran with error handling, along with a stop command following the script. Because this script is C code, it must be compiled whenever changes are made.
Regards,
Jasper S