Skip to content
Snippets Groups Projects
Commit cc6f0769 authored by Dion Timmermann's avatar Dion Timmermann
Browse files

Fixed device info for tcp devices

Does not crash anymore, but info might not be 100% correct.
parent bfd7462d
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,15 @@ classdef TCPIP < netvisa.instrument.MessageBasedResource ...@@ -21,9 +21,15 @@ classdef TCPIP < netvisa.instrument.MessageBasedResource
{'ByteOrder', 'Timeout', 'Terminator'}... {'ByteOrder', 'Timeout', 'Terminator'}...
}; };
obj.Vendor = string(obj.device.ResourceManufacturerName); % This is a trick to get vendor, model and serial number - but
obj.Model = string(obj.device.ModelName); % I am unsure if it is wise to send data to the device
obj.SerialNumber = string(obj.device.UsbSerialNumber); % implicitly...
try %#ok<TRYNC> % Reading the identification data is optional.
idn = strsplit(writeread(obj, '*IDN?'), ',');
obj.Vendor = string(idn{1});
obj.Model = string(idn{2});
obj.SerialNumber = string(idn{3});
end
% TODO % TODO
% - ByteOrder must be saved as a property and then passed to % - ByteOrder must be saved as a property and then passed to
...@@ -38,7 +44,7 @@ classdef TCPIP < netvisa.instrument.MessageBasedResource ...@@ -38,7 +44,7 @@ classdef TCPIP < netvisa.instrument.MessageBasedResource
end end
function lanName = get.LANName(obj) function lanName = get.LANName(obj)
lanName = string(obj.device.DeviceName); lanName = string(obj.device.HostName);
end end
function instrumentAddress = get.InstrumentAddress(obj) function instrumentAddress = get.InstrumentAddress(obj)
......
...@@ -66,6 +66,9 @@ function resourceList = visadevlist() ...@@ -66,6 +66,9 @@ function resourceList = visadevlist()
Model{ii} = char(res.ModelName); Model{ii} = char(res.ModelName);
SerialNumber{ii} = char(res.UsbSerialNumber); SerialNumber{ii} = char(res.UsbSerialNumber);
res.Dispose(); res.Dispose();
case 'tcp'
% TODO
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment