Skip to content

Commit

Permalink
Merge pull request Ulm-IQO#602 from Ulm-IQO/instreamer_hotfix
Browse files Browse the repository at this point in the history
NI X-Series in-streamer fixes
  • Loading branch information
Neverhorst authored Jun 15, 2020
2 parents 76d7af5 + 38cd242 commit fbbf7eb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hardware/ni_x_series_in_streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NIXSeriesInStreamer(Base, DataInStreamInterface):
Example config for copy-paste:
nicard_6343_instreamer:
module.Class: 'ni_x_series_counter.NationalInstrumentsXSeriesCounter'
module.Class: 'ni_x_series_in_streamer.NIXSeriesInStreamer'
device_name: 'Dev1'
digital_sources: # optional
- 'PFI15'
Expand Down Expand Up @@ -410,7 +410,8 @@ def active_channels(self):
@active_channels.setter
def active_channels(self, channels):
if self._check_settings_change():
if any(ch not in self.available_channels for ch in channels):
avail_channels = tuple(ch.name for ch in self.available_channels)
if any(ch not in avail_channels for ch in channels):
self.log.error('Invalid channel to stream from encountered ({0}).\nValid channels '
'are: {1}'
''.format(tuple(channels), tuple(self.available_channels)))
Expand Down Expand Up @@ -843,7 +844,7 @@ def _init_digital_tasks(self):
@return int: error code (0:OK, -1:error)
"""
digital_channels = tuple(
ch for ch, p in self.active_channels.items() if p['type'] == StreamChannelType.DIGITAL)
ch.name for ch in self.active_channels if ch.type == StreamChannelType.DIGITAL)
if not digital_channels:
return 0
if self._di_task_handles:
Expand Down Expand Up @@ -973,7 +974,7 @@ def _init_analog_task(self):
@return int: error code (0:OK, -1:error)
"""
analog_channels = tuple(
ch for ch, p in self.active_channels.items() if p['type'] == StreamChannelType.ANALOG)
ch.name for ch in self.active_channels if ch.type == StreamChannelType.ANALOG)
if not analog_channels:
return 0
if self._ai_task_handle:
Expand Down

0 comments on commit fbbf7eb

Please sign in to comment.