<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I trigger on a status byte? in Measurement Studio for .NET Languages</title>
    <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/803528#M7828</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a C# beginner, I am working on grabbing a waveform off of&lt;/P&gt;&lt;P&gt;my Agilent oscilloscope using C#.NET and Measurement Studio.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So far it is working great.&amp;nbsp; Now I want to take the project one step &lt;/P&gt;&lt;P&gt;further, and grab the waveform only when the scope has been&lt;/P&gt;&lt;P&gt;triggered.&amp;nbsp; (For now I am going to trigger the scope manually,&lt;/P&gt;&lt;P&gt;then eventually I will use an external trigger pulse.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have figured out how to grab a status byte off of the&lt;/P&gt;&lt;P&gt;scope, the LSB of which turns positive after the scope triggers.&lt;/P&gt;&lt;P&gt;I would like to use that status byte to tell my C# program when&lt;/P&gt;&lt;P&gt;to grab the waveform and do&amp;nbsp;my calculations on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could give me a hint as to what the first step would&lt;/P&gt;&lt;P&gt;be, that would be great.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;img id="robothappy" class="emoticon emoticon-robothappy" src="https://ni.lithium.com/i/smilies/16x16_robot-happy.gif" alt="Robot Happy" title="Robot Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Nov 2008 21:58:36 GMT</pubDate>
    <dc:creator>Penny</dc:creator>
    <dc:date>2008-11-04T21:58:36Z</dc:date>
    <item>
      <title>How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/803528#M7828</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a C# beginner, I am working on grabbing a waveform off of&lt;/P&gt;&lt;P&gt;my Agilent oscilloscope using C#.NET and Measurement Studio.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So far it is working great.&amp;nbsp; Now I want to take the project one step &lt;/P&gt;&lt;P&gt;further, and grab the waveform only when the scope has been&lt;/P&gt;&lt;P&gt;triggered.&amp;nbsp; (For now I am going to trigger the scope manually,&lt;/P&gt;&lt;P&gt;then eventually I will use an external trigger pulse.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have figured out how to grab a status byte off of the&lt;/P&gt;&lt;P&gt;scope, the LSB of which turns positive after the scope triggers.&lt;/P&gt;&lt;P&gt;I would like to use that status byte to tell my C# program when&lt;/P&gt;&lt;P&gt;to grab the waveform and do&amp;nbsp;my calculations on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could give me a hint as to what the first step would&lt;/P&gt;&lt;P&gt;be, that would be great.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;img id="robothappy" class="emoticon emoticon-robothappy" src="https://ni.lithium.com/i/smilies/16x16_robot-happy.gif" alt="Robot Happy" title="Robot Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 21:58:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/803528#M7828</guid>
      <dc:creator>Penny</dc:creator>
      <dc:date>2008-11-04T21:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804283#M7836</link>
      <description>&lt;P&gt;Penny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just a few questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. What's the model number of your oscope?&lt;/P&gt;&lt;P&gt;2. Are you using VISA or 488.2?&lt;/P&gt;&lt;P&gt;3. Which method are you using now to read the status byte?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2008 20:29:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804283#M7836</guid>
      <dc:creator>Burban</dc:creator>
      <dc:date>2008-11-05T20:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804317#M7839</link>
      <description>&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The oscope is an Agilent 54855A, and I am using VISA&lt;/P&gt;&lt;P&gt;and Measurement Studio with a GPIB cable.&amp;nbsp; I am currently&lt;/P&gt;&lt;P&gt;reading the status byte with the VisaTask.mxb&amp;nbsp;code that&lt;/P&gt;&lt;P&gt;(miraculously) appeared when I built the project from a &lt;/P&gt;&lt;P&gt;NI-VISA Windows template.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since my last message, I have drag-and-dropped an&lt;/P&gt;&lt;P&gt;LED indicator onto my Form.cs[design].&amp;nbsp; It seems like&lt;/P&gt;&lt;P&gt;there should be some way to hook it up to the LSB of&lt;/P&gt;&lt;P&gt;the status byte...?&amp;nbsp; Then I could trigger my code on the&lt;/P&gt;&lt;P&gt;changing of that LED(?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Penny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2008 21:20:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804317#M7839</guid>
      <dc:creator>Penny</dc:creator>
      <dc:date>2008-11-05T21:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804356#M7840</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While I am at it, I am trying to create a "gauge" indicator on my Form1.cs,&lt;/P&gt;&lt;P&gt;and then "bind" it to a real number that I read in from the scope with &lt;/P&gt;&lt;P&gt;VisaTask.mxb, "lengthNumBytes"=4.&amp;nbsp; So far I cannot get that gauge to &lt;/P&gt;&lt;P&gt;read '4'.&amp;nbsp; I right-clicked on the "gauge", then went to Properties/DataBindings/Tag&lt;/P&gt;&lt;P&gt;and Properties/DataBindings/Value.&amp;nbsp; I set them both equal to lengthNumBytes,&lt;/P&gt;&lt;P&gt;which I know equals 4.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something that I am missing, with the obvious exception of a &lt;/P&gt;&lt;P&gt;C# intro lecture?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img id="robotindifferent" class="emoticon emoticon-robotindifferent" src="https://ni.lithium.com/i/smilies/16x16_robot-indifferent.gif" alt="Robot Indifferent" title="Robot Indifferent" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2008 22:41:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/804356#M7840</guid>
      <dc:creator>Penny</dc:creator>
      <dc:date>2008-11-05T22:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805063#M7844</link>
      <description>&lt;P&gt;Penny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently looking into this, but I do have a few more questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Are you using the instrument driver for the 54855A?&amp;nbsp; You can obtain this from NI.com/idnet and use it with Measurement Studio by running the Measurement Studio Instrument Driver .NET Wizard.&amp;nbsp; Information on this wizard can be found &lt;A href="http://digital.ni.com/public.nsf/allkb/27177DA13C6ED0AE86257362006A68B0?OpenDocument" target="_blank"&gt;here&lt;/A&gt;.&amp;nbsp; I haven't looked into the contents of this instrument driver, but they usually make programming much easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. When programming using VisaTask.mxb are you adding a Query and Parse step and then feeding it a command to return a status byte?&amp;nbsp; If so, what command are you feeding it?&amp;nbsp; If not, how are you reading this status byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some other thoughts on what you are doing: You shouldn't need an LED to trigger your code.&amp;nbsp; You can do it behind the scenes with the data from the status byte.&amp;nbsp; There is a C# method for reading the status byte called ReadStatusByte.&amp;nbsp; This returns a StatusByteFlags type which contains the contents of that byte.&amp;nbsp; You can use that information to trigger your board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the data binding, you may be having problems with the data from the lenthNumBytes variable being protected or not available to the Form class.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2008 20:42:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805063#M7844</guid>
      <dc:creator>Burban</dc:creator>
      <dc:date>2008-11-06T20:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805126#M7845</link>
      <description>&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp; I did not know about that Wizard; I am going&lt;/P&gt;&lt;P&gt;to look into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime yes, I am adding a 'Query and Parse' step to &lt;/P&gt;&lt;P&gt;VisaTask.mxb, with the command '*STB?'.&amp;nbsp; It returns the status&lt;/P&gt;&lt;P&gt;byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do the triggering behind the scenes with that ReadStatusByte&lt;/P&gt;&lt;P&gt;method, as you suggest.&amp;nbsp; If I were to do that, would that mean that&lt;/P&gt;&lt;P&gt;I would&amp;nbsp;just delete&amp;nbsp;the Query and Parse step in VisaTask.mxb, or&lt;/P&gt;&lt;P&gt;would it mean that I&amp;nbsp;should keep the Query and Parse step in place,&lt;/P&gt;&lt;P&gt;and somehow feed the resulting STB into&amp;nbsp;the ReadStatusByte method.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Penny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2008 22:00:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805126#M7845</guid>
      <dc:creator>Penny</dc:creator>
      <dc:date>2008-11-06T22:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805755#M7850</link>
      <description>&lt;P&gt;Penny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've modified the SimpleReadWrite example that ships with Measurement Studio to provide an example of how this could be done.&amp;nbsp; Look at the code for MainForm.cs to see what I did.&amp;nbsp; The new method is called TrigButton_Click.&amp;nbsp; You will need to modify it before it will work with your instrument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example does several things on the Click of the TrigButton control&lt;/P&gt;&lt;P&gt;1. Reads the status byte using the&amp;nbsp;ReadStatusByte method&lt;/P&gt;&lt;P&gt;2. Checks the status byte for a "0" value and conditionally does step 3.&lt;/P&gt;&lt;P&gt;3. Triggers a voltage read from my Instrument Simulator and displays it in the readTextBox TextBox control&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These steps may be easier&amp;nbsp;using the imported&amp;nbsp;instrument driver from ni.com/idnet.&amp;nbsp; I would like you to still check into using that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2008 20:14:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805755#M7850</guid>
      <dc:creator>Burban</dc:creator>
      <dc:date>2008-11-07T20:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I trigger on a status byte?</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805832#M7851</link>
      <description>&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!&amp;nbsp; That is a great working example to look at.&lt;/P&gt;&lt;P&gt;I'm going to keep working on this for a while and see&lt;/P&gt;&lt;P&gt;how far I can get.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile I am waiting for the .NET Wizard to be&lt;/P&gt;&lt;P&gt;emailed to me, so I will try that too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate all of the help.&amp;nbsp; Maybe now I can get&lt;/P&gt;&lt;P&gt;some traction with this stuff.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Penny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2008 22:15:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/How-do-I-trigger-on-a-status-byte/m-p/805832#M7851</guid>
      <dc:creator>Penny</dc:creator>
      <dc:date>2008-11-07T22:15:58Z</dc:date>
    </item>
  </channel>
</rss>

