Package psychopy :: Package hardware :: Module minolta :: Class LS100
[frames] | no frames]

Class LS100

source code

A class to define a Minolta LS100 (or LS110?) photometer

You need to connect a LS100 to the serial (RS232) port and 
**when you turn it on press the F key** on the device. This will put it into 
the correct mode to communicate with the serial port.

usage::
    
    from psychopy.hardware import minolta
    phot = minolta.LS100(port)
    if phot.OK:#then we successfully made a connection and can send/receive
        print phot.getLum()

:parameters:
    
    port: string
        the serial port that should be checked
    
    maxAttempts: int 
        If the device doesn't respond first time how many attempts should be made?
        If you're certain that this is the correct port and the device is on
        and correctly configured then this could be set high. If not then set 
        this low.

:troubleshooting:
    
    Various messages are printed to the log regarding the function of this device, 
    but to see them you need to set the printing of the log to the correct level::
        from psychopy import log
        log.console.setLevel(log.ERROR)#error messages only
        log.console.setLevel(log.INFO)#will give a little more info
        log.console.setLevel(log.DEBUG)#will export a log of all communications
        
    If you're using a keyspan adapter (at least on OS X) be aware that it needs 
    a driver installed. Otherwise no ports wil be found.
        
    Error messages:
    
    ``ERROR: Couldn't connect to Minolta LS100/110 on ____``:
        This likely means that the device is not connected to that port 
        (although the port has been found and opened). Check that the device
        has the `[` in the bottom right of the display; if not turn off 
        and on again holding the `F` key.
    
    ``ERROR: No reply from LS100``:
        The port was found, the connection was made and an initial command worked,
        but then the device stopped communating. If the first measurement taken with 
        the device after connecting does not yield a reasonble intensity the device can 
        sulk (not a technical term!). The "[" on the display will disappear and you can no
        longer communicate with the device. Turn it off and on again (with F depressed)
        and use a reasonably bright screen for your first measurement. Subsequent
        measurements can be dark (or we really would be in trouble!!).
        

Instance Methods
 
__init__(self, port, maxAttempts=1) source code
 
setMode(self, mode='04')
Set the mode for measurements.
source code
 
measure(self)
Measure the current luminance and set .lastLum to this value
source code
 
getLum(self)
Makes a measurement and returns the luminance value
source code
 
clearMemory(self)
Clear the memory of the device from previous measurements
source code
 
checkOK(self, msg)
Check that the message from the photometer is OK.
source code
 
sendMessage(self, message, timeout=5.0)
Send a command to the photometer and wait an alloted timeout for a response.
source code
 
setMaxAttempts(self, maxAttempts)
Changes the number of attempts to send a message and read the output Typically this should be low initially, if you aren't sure that the device is setup correctly but then, after the first successful reading, set it higher.
source code
Method Details

setMode(self, mode='04')

source code 

Set the mode for measurements. Returns True (success) or False

'04' means absolute measurements. '08' = peak '09' = cont

See user manual for other modes

checkOK(self, msg)

source code 

Check that the message from the photometer is OK. If there's an error print it.

Then return True (OK) or False.