Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
e0e68358
Commit
e0e68358
authored
Nov 14, 2017
by
Markus Mueller-Trapet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functionality to use IEPE (or ICP) supply with NI cards
parent
075c2ef9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
8 deletions
+44
-8
applications/Measurement/NI_DAQ/itaMSTFni.m
applications/Measurement/NI_DAQ/itaMSTFni.m
+44
-8
No files found.
applications/Measurement/NI_DAQ/itaMSTFni.m
View file @
e0e68358
...
...
@@ -88,8 +88,8 @@ classdef itaMSTFni < itaMSTF
% Define listeners to automatically call the init function of
% this class in case of a change in the below specified
% properties.
addlistener
(
this
,
'inputChannels'
,
'PostSet'
,
@
this
.
init
);
addlistener
(
this
,
'outputChannels'
,
'PostSet'
,
@
this
.
init
);
addlistener
(
this
,
'inputChannels'
,
'PostSet'
,
@
this
.
init
_ni
);
addlistener
(
this
,
'outputChannels'
,
'PostSet'
,
@
this
.
init
_ni
);
end
function
this
=
edit
(
this
)
...
...
@@ -100,11 +100,10 @@ classdef itaMSTFni < itaMSTF
this
=
ita_mstfni_gui
(
this
);
end
function
this
=
init
(
this
,
varargin
)
function
this
=
init
_ni
(
this
,
varargin
)
% init - Initialize the itaMSTFni class object.
init
@
itaMSTF
(
this
);
% if this is an object loaded from disk (niSession is empty),
% we do not need to initialize the card
% we do not need to
re-
initialize the card
if
~
isempty
(
this
.
niSession
)
this
.
niSession
=
init_NI_card
(
this
);
end
...
...
@@ -281,9 +280,6 @@ classdef itaMSTFni < itaMSTF
niSession
.
Channels
(
end
)
.
Name
=
inputChannels
.
name
{
iChannel
};
% set to AC coupling to get rid of large DC offset
niSession
.
Channels
(
end
)
.
Coupling
=
'AC'
;
% if any(strcmpi(Channels.type{iDevice,iChannel},{'Accelerometer' 'Microphone'}))
% niSession.Channels(end).Sensitivity = Channels.sensitivity(iDevice,iChannel);
% end
end
end
...
...
@@ -307,6 +303,46 @@ classdef itaMSTFni < itaMSTF
end
% function
function
this
=
set_IEPE_channels
(
this
,
channelIds
)
if
isempty
(
this
.
niSession
)
this
.
niSession
=
this
.
init_NI_card
();
end
% first get NI info
[
inputChannels
,
~
,
niDevices
,
~
]
=
ita_get_ni_deviceinfo
();
% INPUT
% set channel data from MS
channelIds
=
intersect
(
channelIds
,
this
.
inputChannels
);
if
isempty
(
channelIds
)
error
(
'Nothing to do, maybe your channels are not active?'
);
end
inputChannels
.
mapping
=
inputChannels
.
mapping
(
channelIds
);
inputChannels
.
name
=
inputChannels
.
name
(
channelIds
);
inputChannels
.
type
=
inputChannels
.
type
(
channelIds
);
inputChannels
.
sensitivity
=
inputChannels
.
sensitivity
(
channelIds
);
inputChannels
.
isActive
=
inputChannels
.
isActive
(
channelIds
);
% Add analog input channels with IEPE supply
for
iChannel
=
1
:
numel
(
channelIds
)
devIdx
=
[];
for
iCh
=
1
:
numel
(
this
.
niSession
.
Channels
)
if
strcmpi
(
inputChannels
.
name
{
iChannel
},
this
.
niSession
.
Channels
(
iCh
)
.
Name
)
devIdx
=
iCh
;
end
end
if
~
isempty
(
devIdx
)
this
.
niSession
.
removeChannel
(
devIdx
);
else
error
(
'Could not find your channel'
);
end
% then add again
iDevice
=
inputChannels
.
mapping
{
iChannel
}(
1
);
iDeviceChannel
=
inputChannels
.
mapping
{
iChannel
}(
2
);
this
.
niSession
.
addAnalogInputChannel
(
get
(
niDevices
(
iDevice
),
'ID'
),
iDeviceChannel
-
1
,
'IEPE'
);
this
.
niSession
.
Channels
(
end
)
.
Name
=
inputChannels
.
name
{
iChannel
};
end
end
% function
function
sObj
=
saveobj
(
this
)
% saveobj - Saves the important properties of the current
% measurement setup to a struct.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment