ProsilicaIo module¶
filename: | Prosilicaio.py |
---|---|
author: | roar@tordivel.no |
requirements: | 10.2 |
Standard Scorpion python IO interface to Advantech Bionic Interface
Driver Version 1.1.0.13
ProsilicaIo.py = 1497
In the module there are three input/output classes for Prosilica GC750 camera:
* RS232 - serial communication via on board camera's serial port
* SyncIn - read sync input state
* SyncOut - control sync output state
1.0.0.1, 23nov2015, RL: std autodoc header
1.0.0.0, 25mar2012, RL: initial
Sample usage:
import ProsilicaIo
import time
try:
cam = GetCamera('0')
# Opens serial port on camera and return RS232 object
rs232 = ProsilicaIo.open(cam, 115200, 8, ProsilicaIo.RS232.Parity.none, ProsilicaIo.RS232.StopBits.one)
# Transmit string while ten symbols received
while rs232.getRxLen() < 10:
rs232.write("Hello world!\r\n")
# Read received data and print
print rs232.read()
# Create object to read sync-in 1
syncIn1 = ProsilicaIo.SyncIn(camera, 1)
print syncIn1.IsSet()
# Create object to control sync-out 2
syncOut2 = ProsilicaIo.SyncOut(camera, 2)
# Set high level on sync-out 2 for 1 second
syncOut2.Set()
time.sleep(1)
syncOut2.Clear()
except Exception, msg:
print msg
-
class
ProsilicaIo.
RS232
(camera, baudRate=19200, dataBits=8, parity=0, stopBits=0)¶ Provides serial communication using camera on board RS232 port.
-
RS232.
open
()¶ opens serial port
-
RS232.
close
()¶ closes serial port
-
RS232.
setup
(baudRate=19200, dataBits=8, parity=0, stopBits=0)¶ set serial port parameters: baud rate, data bits, parity, stop bits
-
RS232.
getRxLen
()¶ returns count of bytes waiting in receive buffer
-
RS232.
getRxStatus
()¶ returns receive status: buffer overrun, framing error, parity error
-
RS232.
clearRxErrors
(clearMask=7)¶ Clears specified error bit in receive status.
-
RS232.
read
()¶ reads all data from receive buffer
-
RS232.
write
(data)¶ writes data in to transmit buffer and starts transmiting
-
-
ProsilicaIo.
open
(camera, baudRate=19200, dataBits=8, parity=0, stopBits=0)¶
-
class
ProsilicaIo.
SyncOut
(camera, outputNo, invert=False)¶ -
class
SyncOutMode
¶ -
GPO
= 'GPO'¶
-
AcquisitionTriggerReady
= 'AcquisitionTriggerReady'¶
-
FrameTriggerReady
= 'FrameTriggerReady'¶
-
FrameTrigger
= 'FrameTrigger'¶
-
Exposing
= 'Exposing'¶
-
FrameReadout
= 'FrameReadout'¶
-
Imaging
= 'Imaging'¶
-
-
SyncOut.
Invert
(invert)¶
-
SyncOut.
IsSet
()¶
-
SyncOut.
SetMode
(outputMode)¶
-
SyncOut.
Set
(set=True)¶
-
SyncOut.
Clear
()¶
-
class