NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Macros | |
#define | plRESET(p) plCommand((p),NULL) |
#define | plINIT(p) plCommand((p),"INIT:") |
#define | plCOMM(p, baud, dps, h) plCommand((p),"COMM:%d%03d%d",(baud),(dps),(h)) |
#define | plPVWR(p, port, a, x) plCommand((p),"PVWR:%c%04X%.128s",(port),(a),(x)) |
#define | plPVCLR(p, port) plCommand((p),"PVCLR:%c",(port)) |
#define | plPINIT(p, port) plCommand((p),"PINIT:%c",(port)) |
#define | plPENA(p, port, mode) plCommand((p),"PENA:%c%c",(port),(mode)) |
#define | plPDIS(p, port) plCommand((p),"PDIS:%c",(port)) |
#define | plTSTART(p) plCommand((p),"TSTART:") |
#define | plTSTOP(p) plCommand((p),"TSTOP:") |
#define | plGX(p, mode) plCommand((p),"GX:%04X",(mode)) |
#define | plLED(p, port, led, s) plCommand((p),"LED:%c%d%c",(port),(led),(s)) |
#define | plBEEP(p, n) plCommand((p),"BEEP:%i",(n)) |
#define | plVER(p, n) plCommand((p),"VER:%d",(n)) |
#define | plSFLIST(p, mode) plCommand((p),"SFLIST:%02X",(mode)) |
#define | plVSEL(p, n) plCommand((p),"VSEL:%d",(n)) |
#define | plPSTAT(p, format) plCommand((p),"PSTAT:%04X",(format)) |
#define | plSSTAT(p, format) plCommand((p),"SSTAT:%04X",(format)) |
#define | plPPRD(p, port, addr) plCommand((p),"PPRD:%c%04X",(port),(addr)) |
#define | plPPWR(p, port, a, x) plCommand((p),"PPWR:%c%04X%.128s",(port),(a),(x)) |
#define | plPURD(p, port, addr) plCommand((p),"PURD:%c%04X",(port),(addr)) |
#define | plPUWR(p, port, a, x) plCommand((p),"PPWR:%c%04X%.128s",(port),(a),(x)) |
#define | plPSEL(p, port, id) plCommand((p),"PSEL:%c%s",(port),(id)) |
#define | plPSRCH(p, port) plCommand((p),"PSRCH:%c",(port)) |
#define | plPVTIP(p, port, tip, np) plCommand((p),"PVTIP:%c%d%d",(port),(tip),(np)) |
#define | plTTCFG(p, port) plCommand((p),"TTCFG:%c",(port)) |
#define | plTCTST(p, port) plCommand((p),"TCTST:%c",(port)) |
#define | plDSTART(p) plCommand((p),"DSTART:") |
#define | plDSTOP(p) plCommand((p),"DSTOP:") |
#define | plIRINIT(p) plCommand((p),"IRINIT:") |
#define | plIRCHK(p, mode) plCommand((p),"IRCHK:%04X",(mode)) |
#define | plIRED(p, port, sig) plCommand((p),"IRED:%c%08X",(port),(sig)) |
#define | pl3D(p, port, mode) plCommand((p),"3D:%c%d",(port),(mode)) |
Functions | |
static int | plPVWRFromFile (polaris *pol, int port, char *filename) |
These are a set of macros that send commands to the POLARIS via plCommand().
The plGetError() function can be used to determine whether an error occurred.
The return value is a terminated string containing the reply from the POLARIS with the CRC and final carriage return chopped off.
Get the 3D position and an error value for a single marker on a tool. The mode should be set to 1 or 3. This command is only available in diagnostic mode.
port | the port number: '1', '2' or '3' |
mode | see NDI POLARIS documentation |
The IRED command should be used to set up a marker firing signature before this command is called.
Cause the POLARIS to beep.
n | the number of times to beep, an integer between 1 and 9 |
A reply of "0" means that the POLARIS is already beeping and cannot service this beep request.
This command can be used in tracking mode.
Change the POLARIS communication parameters. The host parameters will automatically be adjusted to match. If the specified baud rate is not supported by the serial port, then the error code will be set to PL_BAD_COMM and the POLARIS will have to be reset before communication can continue. Most modern UNIX systems accept all baud rates except 14400, and Windows systems support all baud rates.
baud | one of PL_9600, PL_14400, PL_19200, PL_38400, PL_57600, PL_115200 |
dps | should usually be PL_8N1, the most common mode |
h | one of PL_HANDSHAKE or PL_NOHANDSHAKE |
Request tracking information from the POLARIS. This command is only available in tracking mode.
mode | a reply mode containing the following bits:
|
The GX command with the appropriate reply mode is used to update the data that is returned by the following functions:
Initialize the POLARIS. The POLARIS must be initialized before any other commands are sent.
Check for sources of environmental infrared. This command is only valid in diagnostic mode after an IRINIT command.
mode | reply mode bits:
|
The IRCHK command is used to update the information returned by the plGetIRCHKDetected() and plGetIRCHKSourceXY() functions.
Set the infrared firing signature for the specified port. This command is only available in diagnostic mode.
port | the active tool port '1', '2' or '3' |
sig | a 32-bit integer whose bits specify what IREDS to fire |
Initialize the diagnostic environmental infrared checking system. This command must be called prior to using the IRCHK command.
Set a tool LED to a particular state.
port | one of '1', '2' or '3' (active ports only) |
led | an integer between 1 and 3 |
state | desired state: PL_BLANK ('B'), PL_FLASH 'F' or PL_SOLID 'S' |
This command can be used in tracking mode.
Disable transform reporting on the specified port.
port | one of '1', '2', '3' or 'A' to 'I' |
Enable transform reporting on the specified port.
port | one of '1', '2', '3' or 'A' to 'I' |
mode | one of PL_STATIC 'S', PL_DYNAMIC 'D' or PL_BUTTON_BOX 'B' |
Initialize the specified port.
port | one of '1', '2', '3' or 'A' to 'I' |
Read the tool SROM. Use plHexDecode() to convert reply to binary.
Write the tool SROM. Use plHexEncode() to convert data to a hex string.
Ask the POLARIS for information about the tool ports.
format | a reply format mode composed of the following bits:
|
The use of the PSTAT command with the appropriate reply format updates the information returned by the following commands:
This command is not available during tracking mode.
Read the user part of the tool SROM. Use plHexDecode() convert reply.
Write the user part of the tool SROM. Use plHexEncode() to convert data.
Clear the virtual SROM for the specified port. For a passive tool, this is equivalent to unplugging the tool.
port | one of '1', '2', '3' or 'A' to 'I' |
Set the virtual TOOL IN PORT and non-POLARIS tool signals for this port
Write to a virtual SROM address on the specified port. The plPVWRFromFile() function provides a more convenient means of uploading tool descriptions.
port | one of '1', '2', '3' or 'A' to 'I' |
a | an address between 0 and 960 |
x | 64-byte data array encoded as a 128-character hexidecimal string |
The plHexEncode() function can be used to encode the data into hexidecimal.
Send a serial break to reset the POLARIS. If the reset was not successful, the error code will be set to PL_RESET_FAIL.
Get a feature list for this POLARIS.
mode | the desired reply mode
|
The feature summary bits are defined as follow:
Request status information from the POLARIS.
format | a reply format mode composed of the following bits:
|
The use of the SSTAT command with the appropriate reply format updates the information returned by the following commands:
This command is not available during tracking mode.
Set default tool configuration prior to testing.
Get a string that describes the POLARIS firmware version.
n | the processor to get the firmware revision of:
|
Select from the different calibrated operating volumes available to the POLARIS.
n | the volume to select, see plSFLIST() |
Write data from a ROM file into the virtual SROM for the specified port.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
filename | file to read the SROM data from |
If the return value is not PL_OKAY but plGetError() returns PL_OKAY, then the ROM file could not be read and no information was written to the POLARIS.
This function uses the PVWR command to write the SROM. The total size of the virtual SROM is 1024 bytes. If the file is shorter than this, then zeros will be written to the remaining space in the SROM.