{"id":129,"date":"2014-11-06T19:19:40","date_gmt":"2014-11-06T19:19:40","guid":{"rendered":"http:\/\/www.nerdlingen.de\/?p=129"},"modified":"2019-02-01T09:14:22","modified_gmt":"2019-02-01T08:14:22","slug":"agilent-u1253a-with-labview","status":"publish","type":"post","link":"https:\/\/www.nerdlingen.de\/?p=129","title":{"rendered":"Agilent U1253A with LabView"},"content":{"rendered":"<p>Agilent&#8217;s U-Series Multimeters have the ability to be talked to via an infrared interface (and some of them even <a title=\"Agilent's press-release about the OLED-Multimeter\" href=\"http:\/\/www.agilent.com\/about\/newsroom\/presrel\/2008\/08oct-em08149.html\" target=\"_blank\">feature an OLED display<\/a>), either through <del>Agilent<\/del> Keysight&#8217;s slightly overpriced <a title=\"Conrad Webshop with on of the Adapters\" href=\"http:\/\/www.conrad.de\/ce\/de\/product\/128130\/Keysight-Technologies-U1173B-Adapterkabel-IR-zu-USB-fuer-U1230-U1270-U1250-Passend-fuer-U1230-U1231A-U1232A-U1233A?ref=searchDetail\" target=\"_blank\">USB-To-IR Adapter<\/a>, or by building your own. If you intent to follow the latter path, be sure to read <a title=\"Bitbucket-Repository with Board and Drawings\" href=\"https:\/\/bitbucket.org\/jmedved\/agir\/wiki\/Home\" target=\"_blank\">Josip Medved&#8217;s Info about the Adapter<\/a>; it covers pretty much everything you need. There&#8217;s also a <a href=\"http:\/\/www.youtube.com\/watch?v=D3ISDn5hgZQ\" target=\"_blank\">YouTube-Video with a more sophisticated<\/a> (and probably oversized) approach.<\/p>\n<h2>LabView<\/h2>\n<p>With the communication working (you might test it with <a href=\"http:\/\/www.keysight.com\/main\/software.jspx?ckey=878442&amp;nid=-536902463.714140.02\" target=\"_blank\">Keysight&#8217;s own logging-tool<\/a>), it&#8217;s probably more interesting to be able to control the device using LabView. Unfortunately, I could not find any libraries, and the documentation is limited to a post on <a href=\"http:\/\/blog.philippklaus.de\/2014\/02\/agilent-u1273a\/\" target=\"_blank\">Philipp Klaus&#8217; blog describing the basic command set<\/a>.<\/p>\n<figure id=\"attachment_132\" aria-describedby=\"caption-attachment-132\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-132\" src=\"http:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-300x226.jpg\" alt=\"Screenshot of a sample program\" width=\"300\" height=\"226\" srcset=\"https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-300x226.jpg 300w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-100x75.jpg 100w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-150x113.jpg 150w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-200x150.jpg 200w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-450x339.jpg 450w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-600x452.jpg 600w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram-900x678.jpg 900w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/Keysight_UProgram.jpg 995w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-132\" class=\"wp-caption-text\">A sample program constantly reading the meter&#8217;s data<\/figcaption><\/figure>\n<p>In short, the Device features 2.5 &#8220;channels&#8221;, or let&#8217;s call them data-streams; it is capable of e.g. measuring voltage and frequency of an AC source simultaneously and can additionally report the current ambient temperature; although that feature might not be of so much use. In principle, to continuously read out the data measured by the multimeter, you might want to query it&#8217;s current setting (unit, range, precision), it&#8217;s value or status (like auto-range, position of the rotary switch etc.).<\/p>\n<h2>Command Set<\/h2>\n<p>To find out how to talk to the device, and how to interpret it&#8217;s response, I used a <a href=\"http:\/\/freeserialanalyzer.com\/\" target=\"_blank\">Serial Analyzer<\/a> in conjunction with the original software. The result is a LabView-Library that&#8217;s capable of handling a reasonable part of all passive commands (<del>no controlling of the device so far<\/del> only limited support for configuring the device so far) &#8211; the lib, however, should be considered in alpha-state and might still contain bugs. Every command sent from the computer should be terminated by a single linefeed (0x0A, &#8220;\\n&#8221; etc.); the device itself terminates with carriage return and linefeed. On error, the device will return &#8220;*E\\r\\n&#8221;. Most of the time, the meter acts as passive command-responder, except when the user turns the rotary-switch &#8211; in that case, the device sends the switch position counting from 0 (and excluding the &#8220;off&#8221; state &#8211; which means you won&#8217;t be able to detect a &#8220;switch-off&#8221; event except with a communication timeout) preceded by a star, i.e. &#8220;*1\\r\\n&#8221; for Volt.<\/p>\n<p>The commands I saw on the line include:<\/p>\n\n<table id=\"tablepress-1\" class=\"tablepress tablepress-id-1\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Command<\/th><th class=\"column-2\">Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">*CLS<\/td><td class=\"column-2\">allways sent to the device on the beginning of a command set. Probably resets the last read-command<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">*RST<\/td><td class=\"column-2\">said to reset the meter, up to now I didn't see any actual change in behavior<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">*IDN?<\/td><td class=\"column-2\">Request identification of the meter. Result is a string devided into 4 parts by commas, i.e.<br \/>\n\"Agilent Technologies,U1253A,MY12345678,V1.01\", reading the company's name, the model- and serial number and it's firmware version<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">STAT?<\/td><td class=\"column-2\">Returns the current device status. I could only identify two parameters so far.<br \/>\n<br \/>\nSample:<br \/>\n\"000000I00012L00204001\"<br \/>\n(Character 17, 2 in this case, indicates the current position of the rotary switch, whereas the last digit is set to 1 when AUTO-range is enabled)<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">CONF? (or)<br \/>\nCONF? @#<\/td><td class=\"column-2\">Request the current configuration (for channel @#) of the meter, see the next section<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">FETC? (or)<br \/>\nFETC? @#<\/td><td class=\"column-2\">\"Fetch\" either the 1st display\/stream\/channel (or however you'd like to call it) or request a specific one (i.e. \"FETC? @2\" for the auxiliary reading, i.e. the frequency of an A\/C voltage)<br \/>\n<br \/>\nThe meter always returns a single floating point number.<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">READ?<\/td><td class=\"column-2\">Return the current meter reading, only applies to the 1st channel\/stream\/dataset...<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">SYST:BATT?<\/td><td class=\"column-2\">Get the meter's battery status, returns a single floating point value in %\/fully charged.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-1 from cache -->\n<h3>Read configuration options<\/h3>\n<p>Following a &#8220;CONF?&#8221;, the device answers with it&#8217;s current setting (i.e. voltage or frequency) and a few parameters. To request the configuration of a specific &#8220;channel&#8221;, send &#8220;CONF? @#&#8221; replacing the # with a number from 0 to 2. The type of voltage or current, or any subtype of measurement is appended to the basic setting with a semicolon. Additional parameters are separated from this basic information with a space, again separated by commas. Example: &#8220;VOLT:ACDC +1.00000000E+00,+1.00000000E-04&#8221; denotes an AC\/DC voltage-measurement with a range of 1 Volt an a maximum resolution of 0.1 mV. The following table will give some more detailed information:<\/p>\n\n<table id=\"tablepress-2\" class=\"tablepress tablepress-id-2\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Option<\/th><th class=\"column-2\">Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">VOLT(:type)<\/td><td class=\"column-2\">The channel will return a voltage. When configured for DC voltage, it's just \"VOLT\". For AC, AC\/DC or DB(V\/M) measurements, the corresponding option follows with a semicolon, i.e. \"VOLT:ACDC\".<br \/>\n<br \/>\nAdditional parameters are the measurement rage in Volts and the value for the last (4th) digit (i.e. the precision). These parameters will not be returned for dBV or dBM measurements.<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">CURR(:type)<\/td><td class=\"column-2\">Current measurement. Again, DC is the default without a semicolon, AC and ACDC are reported seperately.<br \/>\n<br \/>\nFor the mA\/A measurement range, there's an additional measurement mode displaying the current as a percentage between 0 mA\/4 mA and 20 mA, the corresponding return value is \"CPER:4-20mA\" or \"CPER:40-20mA\".<br \/>\n<br \/>\nParameters are range and precision.<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">RES<\/td><td class=\"column-2\">Resistance, parameters are again range and precision.<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">COND<\/td><td class=\"column-2\">Conductance measurement, parameters are range and precision.<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">DIOD<\/td><td class=\"column-2\">Diode measurement, this setting doesn't seem to return any range or precision.<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">CAP<\/td><td class=\"column-2\">Capacitance, parameters as for VOLT or CURR.<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">CPER:(range)<\/td><td class=\"column-2\">\"Percentage Scale\". Probably made for adjustment measurements, displays a percentage of the measured current in the range of [4..20] mA or [0..20] mA. The range is given after the semicolon, i.e. \"CPER:4-20mA\". Additional parameters like for CURR.<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">FREQ<\/td><td class=\"column-2\">Frequency in Hz, parameters are again range and precision. So far only seen for the second channel.<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">PRES<\/td><td class=\"column-2\">The value of the frequency counter (channel 1). Does not return any reasonable range, only one parameter: 1 for direct counting, and 100 for a prescaler (divider) or 100.<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">PULS:(type)<\/td><td class=\"column-2\">Pulse-Width measurement. Might return either a percentage of high-value to low-value (\"PULS:POUT\") or the pulse width directly (\"PULS:PWID\"). Ranges will show the values of the voltage measurement.<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">TEMP:(type) (unit)<\/td><td class=\"column-2\">Temperature measurement, the only supported setting for the third channel.<br \/>\n<br \/>\nType might be either \"K\" or \"J\", depending on the configured type of the thermocouple - or \"ENV\" denoting the meter's environment measurement (channel 3).<br \/>\n<br \/>\nThe only parameter is the unit, either \"CEL\" for Celsius or \"FAR\" for Fahrenheit.<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">CONT<\/td><td class=\"column-2\">Continuity measurement, similar to RES but with (if configured) audible tone on contact<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">*E<\/td><td class=\"column-2\">Error, i.e. an unused channel.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-2 from cache -->\n<h3>Send configuration<\/h3>\n<p>Different &#8220;layers&#8221; of functionality for specific switch-positions can also be selected via Software. The device accepts two lines of configuration options after a &#8220;CLS*&#8221; command (I didn&#8217;t test it without), the possible options depend on the position of the rotary switch. An erroneous command will be acknowledged by &#8220;*E&#8221;, the configuration, however, might still be partially applied and might lead to instable operation (i.e. incomplete or overlapping data on the display). Success in changing the configuration will not trigger any response. Note that, upon selecting additional (calculated) quantities, those might become the primary reading; selecting AC-Voltage and Frequency for example will change the first channel to frequency, and reports the voltage on the second channel.<\/p>\n<p>Each switch position allows a different set of options, as can be seen in the following table:<\/p>\n\n<table id=\"tablepress-3\" class=\"tablepress tablepress-id-3 tbody-has-connected-cells\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Rotary Switch<\/th><th class=\"column-2\">Command<\/th><th class=\"column-3\">Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td rowspan=\"4\" class=\"column-1\">0 (V\/AC)<br \/>\n1 (Volt)<br \/>\n2 (mVolt)<\/td><td class=\"column-2\">CONF:VOLT{:AC,:DC,:ACDC} (range)<\/td><td class=\"column-3\">Change the range of the AC voltage measured, possible parameters are 5, 50, 500 and 1000 (Volt each) or 0.1, 0.5 and 1 (also Volt, valid for position 2). Omit the range parameter to enable auto-range.<br \/>\n<br \/>\nParameters AC, DC and ACDC are only valid for switch-positions 1 and 2.<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-2\">CONF:FREQ<\/td><td class=\"column-3\">Measure the frequency additionally to the voltage, it will become the primary reading. Auto-range only.<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-2\">CONF:PULS:(type)<\/td><td class=\"column-3\">Measure pulse-width (primary). Possible types are PDUT\/NDUT (positive\/negative edged dutycycle in %) or PWID\/NWID (positive\/negative edged step-width in ms)<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-2\">CALC:FUNC {DBV,DBM}<\/td><td class=\"column-3\">Set the primary channel to read calculated dB\/V or dB\/M values<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td rowspan=\"3\" class=\"column-1\">3 (Resistance)<\/td><td class=\"column-2\">CONF:RES (range)<\/td><td class=\"column-3\">Configure the resistance measurement; ranges are none (auto), 500, 5k, 50k, 500k, 5M, 50M or 500M (Ohms each of course).<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-2\">CONF:COND<\/td><td class=\"column-3\">Measure conductance, only one range is supported and may not be configured (500 nS)<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-2\">CONF:CONT (range)<\/td><td class=\"column-3\">Measure continuity; accepts the same ranges like CONF:RES<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td rowspan=\"2\" class=\"column-1\">4 (Diode)<\/td><td class=\"column-2\">CONF:DIOD<\/td><td class=\"column-3\">Standard, set to Diode-measurement. Range is fixed to 2.1 V<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-2\">CONF:FCOU (range)<\/td><td class=\"column-3\">Select the frequency counter function. Range is either 1 for direct counting, or 100 to select a prescaler of 1\/100 to measure frequencies of up to 20 MHz<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td rowspan=\"3\" class=\"column-1\">5 (Capacitance)<\/td><td class=\"column-2\">CONF:CAP (range)<\/td><td class=\"column-3\">Set the range of the capacitance measurement, either none (Auto) or 10n, 100n, 1000n, 10u, 100u, 1000u, 10m or 100m (Farad each).<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-2\">CONF:TEMP (type),(unit)<\/td><td class=\"column-3\">Switch to temperature measurement. Type is either K or J for {K\/J}-Type thermocouples. Unit is either FAR-enheit or CEL-sius.<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-2\">SYST:TCOM (0, 1)<\/td><td class=\"column-3\">Enable \/ Disable 0\u00b0 compensation<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td rowspan=\"4\" class=\"column-1\">6 (\u00b5A)<br \/>\n7 (mA\/A)<\/td><td class=\"column-2\">CONF:CURR{:AC,:DC,:ACDC} (range)<\/td><td class=\"column-3\">Set the current measurement to DC, AC or AC\/DC measurement and configure the range to autorange (none) or 500u, 5000u (\u00b5A) for position 6 (\u00b5A) or 0.05, 0.5 (A) for Position 7.<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-2\">CONF:CURR:PERC<\/td><td class=\"column-3\">Display the measured current as a percentage - no direct range parameter!<\/td>\n<\/tr>\n<tr class=\"row-16\">\n\t<td class=\"column-2\">SYST:CPER (range)<\/td><td class=\"column-3\">Configure the range of the Percentage Scale measurement - either \"0-20\" or \"4-20\" (mA each).<\/td>\n<\/tr>\n<tr class=\"row-17\">\n\t<td colspan=\"2\" class=\"column-2\">for Additional parameters see Positions 0 to 2!<\/td>\n<\/tr>\n<tr class=\"row-18\">\n\t<td class=\"column-1\">(possibly) All<\/td><td class=\"column-2\">SYST:TENV (0, 1)<\/td><td class=\"column-3\">Enable \/ Disable measurement of the environment temperature, will be readable on channel 3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-3 from cache -->\n<p>A few VIs exist already to configure the device using the above commands.<\/p>\n<h3>Update: Configure PWM Output<\/h3>\n<p>The last available switch-position (#8) will allow you to operate a PWM output with 3 Volts\/peak and an instrumental precicion of 1\/256 of the frequency set. The device features three commands to program the PWM output. &#8220;CQU:FREQ X&#8221; sets the output frequency to X, possible options can be taken from the manual and range from 0.5 Hz to 4.8 kHz. The pulse width can be controlled from 0.39 % to 99.609 % \/ total, given in values from 1 to 255. The device has two commands to set the pulse width, &#8220;CQU:PWID X&#8221; will program the pulse width and display the value in ms, where as &#8220;CQU:DCYC X&#8221; will display the duty cycle in %.<\/p>\n<h2>Code<\/h2>\n<p>The code including the sample program <a title=\"Bitbucket-Repository with the LabView code\" href=\"https:\/\/bitbucket.org\/21347\/labview-libs\/src\/cbdf915d2c149b1976d06c32f262d9bb9558f6ef\/Agilent%20U1253A\/?at=master\">can be found on bitbucket<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Agilent&#8217;s U-Series Multimeters have the ability to be talked to via an infrared interface (and some of them even feature an OLED display), either through Agilent Keysight&#8217;s slightly overpriced USB-To-IR Adapter, or by building your own. If you intent to &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.nerdlingen.de\/?p=129\"> <span class=\"screen-reader-text\">Agilent U1253A with LabView<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7,4],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-english","category-labview","category-software"],"_links":{"self":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":19,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}