
C. Programming
The
MWM
is controlled via simple text commands of the form:
DISPLAY,LINE,0,0,"Hello"
Each command begins with a text key; only the first three letters are re-
quired but the full command can be used. Some commands will have a
sub-command, and/or parameters including integers, floating-point num-
bers, and text strings. Each command will return a requested value, or a
default “OK”.
These commands can be sent to the device via
TCP/IP
(for example, using
telnet
) or
USB
. A full list of commands is provided in Appendix D.
Watchdog timer
The
MWM
has a watchdog timer that resets the device if any internal
function or operation fails to complete within approximately 5 seconds.
Thus if your application fails to receive an expected response then it can
attempt to re-establish a connection after that time.
C.1
python
example
A simple program involves opening the communications channel, config-
uring the imaging sensor, optimising the exposure time, and then either
acquiring the spectrum or the calculated wavelength. An example, writ-
ten in
python
, is outlined below. Further examples will be provided for
matlab
and
LabVIEW
.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# MWM w a v e m e t e r p y t h o n e x a m p l e
# ( c ) M O G L a b s 2 0 2 0
# U s i n g p y t h o n d r i v e r f r o m m o g l a b s . com
59
Summary of Contents for MWM
Page 1: ...MWM wavemeter Revision 3 19 mogwave 1 4 15 Firmware 0 6 9 ...
Page 4: ...ii ...
Page 7: ...Contents v G Ugrading firmware 83 References 84 ...
Page 8: ...vi Contents ...
Page 54: ...46 Chapter 6 Calibration ...
Page 58: ...50 Appendix A Specifications ...
Page 66: ...58 Appendix B Communications ...
Page 70: ...62 Appendix C Programming ...
Page 86: ...78 Appendix E mogwave configuration ...
Page 92: ......
Page 94: ...86 ...
Page 95: ......