diff --git a/+adi/+AD7124/Base.m b/+adi/+AD7124/Base.m index b426306..be2d0c5 100644 --- a/+adi/+AD7124/Base.m +++ b/+adi/+AD7124/Base.m @@ -66,7 +66,11 @@ function delete(obj) % Set device sampling rate obj.SampleRate = value; if obj.ConnectedToDevice - obj.setDeviceAttributeRAW('sampling_frequency', value); + for i=1:length(obj.channel_names) + if (ismember(i, obj.EnabledChannels)) + obj.setAttributeRAW(obj.channel_names{i}, 'sampling_frequency', value, false); + end + end end end end @@ -79,7 +83,11 @@ function setupInit(obj) % Do writes directly to hardware without using set methods. % This is required since Simulink support doesn't support % modification to nontunable variables at SetupImpl - obj.setDeviceAttributeRAW('sampling_frequency',num2str(obj.SampleRate)); + for i=1:length(obj.channel_names) + if (ismember(i, obj.EnabledChannels)) + obj.setAttributeRAW(obj.channel_names{i}, 'sampling_frequency', num2str(obj.SampleRate), false); + end + end end end diff --git a/+adi/+AD7124_4/Rx.m b/+adi/+AD7124_4/Rx.m index 3a17cfe..6f6cc36 100644 --- a/+adi/+AD7124_4/Rx.m +++ b/+adi/+AD7124_4/Rx.m @@ -12,8 +12,8 @@ % `AD7124-4 Datasheet `_ properties (Nontunable, Hidden) - channel_names = {'voltage0','voltage1','voltage2'... - 'voltage3','voltage4','voltage5','voltage6','voltage7'}; + channel_names = {'voltage0-voltage1','voltage2-voltage3',... + 'voltage4-voltage5','voltage6-voltage7'}; end methods diff --git a/+adi/+AD7124_8/Rx.m b/+adi/+AD7124_8/Rx.m index b0688fb..bac4d09 100644 --- a/+adi/+AD7124_8/Rx.m +++ b/+adi/+AD7124_8/Rx.m @@ -13,9 +13,9 @@ properties (Nontunable, Hidden) - channel_names = {'voltage0','voltage1','voltage2','voltage3',... - 'voltage4','voltage5','voltage6','voltage7','voltage8','voltage9',... - 'voltage10','voltage11','voltage12','voltage13','voltage14','voltage15'}; + channel_names = {'voltage0-voltage1','voltage2-voltage3',... + 'voltage4-voltage5','voltage6-voltage7','voltage8-voltage9',... + 'voltage10-voltage11','voltage12-voltage13','voltage14-voltage15'}; end methods @@ -25,4 +25,4 @@ end end -end \ No newline at end of file +end