Instrument control package: Difference between revisions

Line 95: Line 95:
Chaging some configurations is simple done by calling helper functions
Chaging some configurations is simple done by calling helper functions
{{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px">
{{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px">
srl_baudrate(s1, 9600) # Change baudrate
set(s1, 'baudrate', 9600) # Change baudrate
srl_bytesize(s1, 5)    # Change byte size (config becomes 5-N-1)
set(s1, 'bytesize', 5)    # Change byte size (config becomes 5-N-1)
srl_parity(s1, "E")    # Changes parity checking (config becomes 5-E-1),
set(s1, 'parity', "E")    # Changes parity checking (config becomes 5-E-1),
                      # possible values [E]ven, [O]dd, [N]one.
                          # possible values [E]ven, [O]dd, [N]one.
srl_stopbits(s1, 2)    # Changes stop bits (config becomes 5-E-2), possible
set(s1, 'stopbits', 2)    # Changes stop bits (config becomes 5-E-2), possible
                      # values 1, 2.
                          # values 1, 2.
</syntaxhighlight>
</syntaxhighlight>
}}
}}
Anonymous user