EasyManua.ls Logo

Sutter Instrument MPC-200 - Get Current Position (C) Command

Sutter Instrument MPC-200
73 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
36
MPC-385 SERIES OPERATION MANUAL REV. 3.21K (20201120)
Extracting the MPC-200 Firmware Version Number: The firmware version number returned
by the ‘K’ command is encoded in BCD (Binary Coded Decimal) in two bytes, with minor
version byte first, followed by major version byte, each of which contains two digits with first
in the upper nibble and the next in the lower nibble. For example, if the complete version is
3.15, then the bytes at offsets 1 and 2 will show (in hexadecimal) as 0x15 0x03 (ret[1] and
ret[2] as shown in the following code snippets). The following code shows how to extract and
convert the 4 BCD digits into usable forms for later comparison without altering the original
command return data (written in C/C++ and easily portable to Python, Java, C#, MATLAB
script, etc.).
/* ret” is the array of bytes containing
the ‘K’ command’s return data */
/* define variables */
unsigned char verbyte; /* temp work byte */
int minver, majver, majminver;
float version;
Minor version number as an integer (e.g., 15):
verbyte = ret[1]; /* get minor ver. digits */
/* get 1’s digit & then get & add 10’s digit */
minver = (verbyte & 0x0F) +
((verbyte >>4 & 0x0F) * 10);
Major version number as an integer (e.g., 3):
verbyte = ret[2]; /* get major ver. digits */
majver = (verbyte & 0x0F) +
((verbyte >>4 & 0x0F) * 10);
Complete (thousands) version as an integer (e.g., 315):
majminver = majver * 100 + minver;
Complete version as a floating-point number (e.g., 3.15):
version = majminver * .01;
5.8.4 Get Current Position (‘C’) Command
This command is used to obtain the current position (X, Y, & Z coordinates) of the
manipulator or stage. The command sequence consists of one byte as shown in the following
table. The data returned consists of 14 bytes: The first contains the currently-active device
number 1 4 (1 byte), followed by 12 bytes containing X, Y, & Z position values in microsteps
(4 bytes each), and ends with the completion indicator (1 byte).

Table of Contents

Related product manuals