Skip to content

Commit

Permalink
small docu corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Miloslav-RS committed Feb 2, 2024
1 parent c5aba0f commit b185429
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/source/Example_DifferentVisas.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Force use of the Rs Visa. For e.g.: NI Visa, use the "SelectVisa='ni'"
instr = RsInstrument('TCPIP::192.168.56.101::INSTR', True, True, "SelectVisa='rs'")

idn = instr.query_str('*IDN?')
idn = instr.query('*IDN?')
print(f"\nHello, I am: '{idn}'")
print(f"\nI am using the VISA from: {instr.visa_manufacturer}")

Expand Down
4 changes: 2 additions & 2 deletions docs/source/Example_Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Dealing with commands that potentially generate errors OPTION 1:
# Switching the status checking OFF temporarily
instr.instrument_status_checking = False
instr.write_str('MY:MISSpelled:COMMand')
instr.write('MY:MISSpelled:COMMand')
# Clear the error queue
instr.clear_status()
# Status checking ON again
Expand All @@ -29,7 +29,7 @@
try:
# You might want to reduce the VISA timeout to avoid long waiting
instr.visa_timeout = 1000
instr.query_str('MY:OTHEr:WRONg:QUERy?')
instr.query('MY:OTHEr:WRONg:QUERy?')

except StatusException as e:
# Instrument status error
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_HelloWorld.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Initializing the session
instr = RsInstrument(resource_string_1)

idn = instr.query_str('*IDN?')
idn = instr.query('*IDN?')
print(f"\nHello, I am: '{idn}'")
print(f'RsInstrument driver version: {instr.driver_version}')
print(f'Visa manufacturer: {instr.visa_manufacturer}')
Expand Down
8 changes: 4 additions & 4 deletions docs/source/Example_MethodsWithOpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
instr.opc_timeout = 20000

# Send Reset command and wait for it to finish
instr.write_str_with_opc('*RST')
instr.write_with_opc('*RST')

# Initiate the measurement and wait for it to finish, define the timeout 50 secs
# Notice no changing of the VISA timeout
instr.write_str_with_opc('INIT', 50000)
instr.write_with_opc('INIT', 50000)
# The results are ready, simple fetch returns the results
# Waiting here is not necessary
result1 = instr.query_str('FETCH:MEASUREMENT?')
result1 = instr.query('FETCH:MEASUREMENT?')

# READ command starts the measurement, we use query_with_opc to wait for the measurement to finish
result2 = instr.query_str_with_opc('READ:MEASUREMENT?', 50000)
result2 = instr.query_with_opc('READ:MEASUREMENT?', 50000)

# Close the session
instr.close()
2 changes: 1 addition & 1 deletion docs/source/Example_MultithreadMultipleSessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def execute(session: RsInstrument, session_ix, index) -> None:
"""Executed in a separate thread."""
print(f'{index} session {session_ix} query start...')
session.query_str('*IDN?')
session.query('*IDN?')
print(f'{index} session {session_ix} query end')


Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_MultithreadOneSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def execute(session: RsInstrument) -> None:
"""Executed in a separate thread."""
session.query_str('*IDN?')
session.query('*IDN?')


# Make sure you have the RsInstrument version 1.50.0 and newer
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_MultithreadSharedSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def execute(session: RsInstrument, session_ix, index) -> None:
"""Executed in a separate thread."""
print(f'{index} session {session_ix} query start...')
session.query_str('*IDN?')
session.query('*IDN?')
print(f'{index} session {session_ix} query end')


Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_QueryFloatArray_ASCII.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

rto = RsInstrument('TCPIP::192.168.56.101::INSTR', True, True)
# Initiate a single acquisition and wait for it to finish
rto.write_str_with_opc("SINGle", 20000)
rto.write_with_opc("SINGle", 20000)

# Query array of floats in ASCII format
t = time()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_QueryFloatArray_Bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

rto = RsInstrument('TCPIP::192.168.56.101::INSTR', True, True)
# Initiate a single acquisition and wait for it to finish
rto.write_str_with_opc("SINGle", 20000)
rto.write_with_opc("SINGle", 20000)

# Query array of floats in Binary format
t = time()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_QueryIntArray_AsciiBin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

rto = RsInstrument('TCPIP::192.168.56.101::INSTR', True, True)
# Initiate a single acquisition and wait for it to finish
rto.write_str_with_opc("SINGle", 20000)
rto.write_with_opc("SINGle", 20000)

# Query array of integers in ASCII format
t = time()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_QueryWithProgress.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def my_transfer_handler(args):
instr.events.io_events_include_data = True
# Set data chunk size to 2 bytes
instr.data_chunk_size = 2
instr.query_str('*IDN?')
instr.query('*IDN?')
# Unregister the event handler
instr.events.on_read_handler = None

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Example_SimpleStringIo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. code-block:: python

"""
Basic string write_str / query_str
Basic string write / query
"""

from RsInstrument import *
Expand Down
6 changes: 3 additions & 3 deletions docs/source/Example_SimpleStringIoUniversity.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.. code-block:: python

"""
Basic string write_str / query_str
Basic string write / query
"""

from RsInstrument import *

instr = RsInstrument('TCPIP::192.168.56.101::INSTR', True, True)
instr.write_str('*RST')
response = instr.query_str('*IDN?')
instr.write('*RST')
response = instr.query('*IDN?')
print(response)

# Close the session
Expand Down

0 comments on commit b185429

Please sign in to comment.