Click or drag to resize

KM_Controller Methods

The KM_Controller type exposes the following members.

Methods
 NameDescription
Public methodCheckCoffSize Determines and returns the section sizes of various sections in a KFLOP coff (common object file format) file
Public methodCheckConnected Tries to obtain a lock, and if a lock is obtained can execute optional actions before releasing the lock token.
Public methodCheckIsReady Call this to check if a "Ready" response came back after a command was manually typed in and we don't know what the response will be if any Note:There is a possibility that other DSP threads are printing to the console screen First check if any input is available if not, return instantly (KMOTION_OK) if so, then a whole line might not be available but should be in transmission and be in very soon, so wait up to a short while to get in an entire line if the line doesn't come in for some reason return (KMOTION_TIMEOUT) check if the line should go to the console (esc) if so print it and repeat the above as long as there is still input available if the line is not console data, check for "Ready", if it is "Ready" send it to the console and return KMOTION_READY; otherwise send it to the console ///
Public methodClearError Clears the Error log
Public methodClearFeedhold Clears Feedhold without Resuming(Performs Console Command StopImmediate2)
Public methodClearMessages Clears the Message log
Public methodCompile Compiles a source file
Public methodCompileAndLoadCoff Compiles a source file and loads it into the board
Public methodDisconnect Disconnect the application from the board
Public methodDispose Releases object resources
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExecuteProgram(Int32) Executes a previously loaded program
Public methodExecuteProgram(Int32, String, Boolean) Loads and executes a program from file
Public methodFeedhold Initiates Feedhold (Performs Console Command StopImmediate0)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetAxis Creates a KM_Axis object
Public methodGetAxisGroup Creates a KM_AxisGroup
Public methodGetBoards Get Boards checks the list of connected board locations and returns the total board count
Public methodGetBoardType Gets the board type BOARD_TYPE.KFLOP = 2 = KFlop 8 Axes Controller BOARD_TYPE.KOGNA = 3 = Kogna 16 Axis Controller
Public methodGetCommandValueT Returns the value of a WriteLineReadLine(), converted to the requested type
Public methodGetFirmwareVersion Query device for the loaded firmware version
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetIO Creates a new KM_IO bit
Public methodGetStatus Generates and returns an updated copy of the MAIN_STATUS structure
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetUSBLocation USB tree node location
Public methodGetUserData Gets a 32 bit word of user data To set int value in KFLOP in C do: persist.UserData[index] = i;
Public methodGetUserDataDouble Gets a 64 bit double from a KFLOP user data pair of 32 bit vars To set double value in KFLOP in C do: *(double *)&persist.UserData[index*2] = d;
Public methodGetUserDataFloat Gets a 32 bit float word of user data To set float value in KFLOP in C do: *(float *)&persist.UserData[index] = f;
Public methodHasErrors Checks if any error messages are in qeue
Public methodHasMessages Checks if any messages are in qeue
Public methodKillProgramThreads Halts the execution of each supplied thread
Public methodKMotionLock Prevents outside access to the board This function is similar to the WaitToken function, except that it returns immediately (instead of waiting) if the board is already locked
Public methodLoadCoff(Int32, String) Load a compiled C program into the board
Public methodLoadCoff(Int32, String, Int32) Load a compiled C program into the board (with PackToFlash arg)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodReadLineTimeout Block the calling thread while waiting for the response to complete within a specified timeout
Public methodRecoverKMotionLock Recovers controller from a motion lock state
Public methodReleaseToken Allow normal access to the board
Public methodResetUserData Sets all words of user data to 0
Public methodResumeFeedhold Resumes Feedhold (Performs Console Command StopImmediate1)
Public methodServiceConsole Flushes the console buffer
Public methodSetCallbackHandler Sets the internal c++ interop callback handler Separate delegate for this callback prevents the Garbage Collector from releasing the unmanaged function pointer from being destroyed
Public methodSetFailed Places the controller in a failed state, prevents further commands from processing
Public methodSetUserData Sets a 32 bit word of integer user data
Public methodSetUserDataDouble Sets a pair of two 32 bit words with a 64-bit double of user data To get the value in KFLOP in C do: double f = *(double *)&persist.UserData[index*2];
Public methodSetUserDataFloat Sets a 32 bit word with a 32-bit float of user data To get the value in KFLOP in C do: float f = *(float *)&persist.UserData[index];
Public methodThreadExecuting Checks whether a User Program Thread is currently executing.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodWaitForThreadComplete Waits for a User Program Thread to finish executing.
Public methodWaitToken Prevents outside access to the board until ReleaseToken is commanded
Public methodWriteLine Sends a console command to the board
Public methodWriteLineReadLine Sends a console command to the board and waits for the return value
Public methodWriteLineWithEcho Sends a console command to the board while echoing commands back to the callback handler
Top
See Also