Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
development:realtime:serial_event [2018/10/21 15:11]
42.49.180.224 1
development:realtime:serial_event [2017/08/17 11:21] (current)
127.0.0.1 external edit
Line 5: Line 5:
 The user has the option to either only react on specific characters, and to write events with The user has the option to either only react on specific characters, and to write events with
 a fixed //type// and //value//, or to forward the received character as the //value// of the event. a fixed //type// and //value//, or to forward the received character as the //value// of the event.
-The //sample// field of the event can be auto-incremented,​ and reset by sending the string ​"RESET"+The //sample// field of the event can be auto-incremented,​ and reset by sending the string ​"RESET"
 to the UDP port (default = 1990) on which the tool listens. The latter feature is used in the DCCN's MRI lab to reset the sample counter when a new sequence is started on the scanner host (which is then picked up by the [[development:​realtime:​fmri|fMRI gui_streamer]] tool). to the UDP port (default = 1990) on which the tool listens. The latter feature is used in the DCCN's MRI lab to reset the sample counter when a new sequence is started on the scanner host (which is then picked up by the [[development:​realtime:​fmri|fMRI gui_streamer]] tool).
  
Line 17: Line 17:
  
 The operation mode of the tool is controlled by given a configuration file. A documented example follows below: The operation mode of the tool is controlled by given a configuration file. A documented example follows below:
-&lt;code ini&gt;+<code ini>
 # Comment lines must start with a hash, empty lines are silently ignored # Comment lines must start with a hash, empty lines are silently ignored
  
Line 26: Line 26:
 # serial: Parameters of the serial port in the form  # serial: Parameters of the serial port in the form 
 #   ​portname:​baudrate:​databits:​stopbits:​parity #   ​portname:​baudrate:​databits:​stopbits:​parity
-# all numbers must be &gt;=0, parity may only be 0 or 1+# all numbers must be >=0, parity may only be 0 or 1
 serial=COM3:​115200:​8:​1:​0 serial=COM3:​115200:​8:​1:​0
  
Line 34: Line 34:
  
 # type: Type of event as either an integer, double ​ # type: Type of event as either an integer, double ​
-# precision number, or string (e.g. &quot;serial&quot;+# precision number, or string (e.g. "serial"
-type=&quot;serial&quot;+type="serial"
  
 # value: Value of event, can be integer/​double/​string ​ # value: Value of event, can be integer/​double/​string ​
 # or @ to pass on serial character # or @ to pass on serial character
-value=&quot;click&quot;+value="click"
  
 # sample: number to transmit with first pulse plus  # sample: number to transmit with first pulse plus 
Line 51: Line 51:
 # UDP port for RESET messages # UDP port for RESET messages
 port=1990 port=1990
-&lt;/code&gt;+</code>
  
  
Line 57: Line 57:
  
 We provide a simple ''​Makefile''​ for the MinGW compiler or GCC. Please go to the ''​realtime/​utilities/​serial2event''​ directory and type ''​make''​ or ''​mingw32-make''​. Note that you might need to [[development:​realtime:​buffer|compile]] the **buffer** library first. We provide a simple ''​Makefile''​ for the MinGW compiler or GCC. Please go to the ''​realtime/​utilities/​serial2event''​ directory and type ''​make''​ or ''​mingw32-make''​. Note that you might need to [[development:​realtime:​buffer|compile]] the **buffer** library first.
 +