Skip to content

Commit d06a4fd

Browse files
author
Dilmi Wickramanayake
committed
error handling
1 parent f19d608 commit d06a4fd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/nidaqmx/nidaqmx_analog_input_filtering/nidaqmx_analog_input_filtering.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147

148148
except DaqError as e:
149149
daq_errors = str(e)
150+
print(daq_errors)
150151
panel.set_value("daq_errors", daq_errors)
151152

152153
except KeyboardInterrupt:

examples/nidaqmx/nidaqmx_analog_input_filtering/nidaqmx_analog_input_filtering_panel.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
st.button("Stop", key="stop_button")
5454
else:
5555
st.button("Run", key="run_button")
56+
if panel.get_value("daq_errors", "") == "":
57+
pass
58+
else:
59+
st.error(panel.get_value("daq_errors", ""))
5660

5761
st.title("Channel Settings")
5862
physical_channel = st.selectbox(
@@ -420,8 +424,3 @@
420424
],
421425
}
422426
st_echarts(options=acquired_data_graph, height="400px", key="graph", width="100%")
423-
with st.container(border=True):
424-
if panel.get_value("daq_errors", "") == "":
425-
st.write("No DAQ Errors Found")
426-
else:
427-
st.error(panel.get_value("daq_errors", ""))

0 commit comments

Comments
 (0)