◆ Delete()

void Delete ( void  )
pure virtual

Delete the MotionController and all its objects.

Part of the Create and Initialize RapidCode Objects method group.

Description:
Deletes the MotionController pointer and all the objects it created. This includes all of the first-class RapidCode objects (Axis, MultiAxis, IO, IOPoint, etc.). After a MotionController and all its objects have been deleted, you can use Create() again.

Every sinlge first-class object pointer will now be pointing to free'd memory. You will get access violation exceptions (or worse). We suggest setting the motioncontroller pointer to null after this is called.

Sample Code:
// -- C++ -- //
Note
RapidCode object destructors are private. Delete() provides users a method to clean up all RapidCode objects. This method is required if you are planning to re-create the MotionController or to fully destroy (and free) all objects when you application closes.
See also
CreateFromSoftware, Create
Examples
ControllerInterrupts.cpp, HardwareLimits.cpp, HelperFunctions.cs, Memory.cpp, MotionHoldReleasedBySoftwareAddress.cpp, MultiaxisMotion.cpp, PathMotion.cpp, PVTmotionMultiAxis.cpp, SingleAxisSyncOutputs.cpp, StreamingMotionBufferManagement.cpp, SyncInterrupt.cpp, SyncOutputWithMotion.cpp, Template.cpp, UpdateBufferPoints.cpp, and UserLimitDigitalInputAction.cpp.