<?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 Re: 500 MicroSecond Pulse in Measurement Studio for .NET Languages</title>
    <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707769#M19086</link>
    <description>&lt;P&gt;I have written this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;NationalInstruments.DAQmx.Task task0 = new NationalInstruments.DAQmx.Task();&lt;/P&gt;
&lt;P&gt;DO0 = task0.DOChannels.CreateChannel("Dev1/port0/line0", "Port", ChannelLineGrouping.OneChannelForEachLine);&lt;BR /&gt;task0.Timing.SampleTimingType = NationalInstruments.DAQmx.SampleTimingType.OnDemand;&lt;/P&gt;
&lt;P&gt;task0.Timing.ConfigureSampleClock("",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000 ,&amp;nbsp; SampleClockActiveEdge.Rising,&amp;nbsp; SampleQuantityMode.FiniteSamples);&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;But it has an error:&lt;/P&gt;
&lt;P&gt;Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.&lt;/P&gt;
&lt;P&gt;Property: NationalInstruments.DAQmx.Timing.SampleTimingType&lt;BR /&gt;Requested Value: NationalInstruments.DAQmx.SampleTimingType.SampleClock&lt;BR /&gt;Possible Values: NationalInstruments.DAQmx.SampleTimingType.OnDemand&lt;BR /&gt;Task Name: _unnamedTask&amp;lt;0&amp;gt;&lt;BR /&gt;Status Code: -200077&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it mean that usb-6003 is not&amp;nbsp; able for changing clock frequency?&lt;/P&gt;
&lt;P&gt;Also, I was wondering if you could give me a sample code that how I can write a waveform exactly a 1 and a 0.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;E.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 16:31:05 GMT</pubDate>
    <dc:creator>Ehsanzb</dc:creator>
    <dc:date>2017-10-25T16:31:05Z</dc:date>
    <item>
      <title>500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3704692#M19066</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I am using NI usb-6003 and C# programming. I need to activate two digital line (p0/line0 and P0/line1) synchronously, and remain active 500 microsecond for the first one and 12 second for the other one. I couldn't do that with software because of the accuracy. I was wondering if anyone know how I can do it with the hardware using C#. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 19:45:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3704692#M19066</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-18T19:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705235#M19067</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure we're on the same page. If you're using LabVIEW ("software"), you are still able to enforce hardware timing, where the timing is enforced on the USB 6003 instead of on the software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There isn't any reason that&amp;nbsp;text-based should run faster. It might seem like because LabVIEW is a graphical programming language, and C# is text-based, that text-based would be faster, but that is not the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running into limitations with the USB 6003 with LabVIEW, the same limitations will exist in LabWindows CVI. But we can make sure you're using the hardware as optimally as possible, by exploring your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using a LabVIEW example? You can get to the example finder from within LabVIEW by going to Help -&amp;gt; Find Examples, and I would look in the Hardware Input and Output folder on the Browse tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps! Keep us posted!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 18:32:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705235#M19067</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2017-10-19T18:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705274#M19068</link>
      <description>&lt;P&gt;Dear Timothy D.,&lt;/P&gt;
&lt;P&gt;Thank you for the response.&lt;/P&gt;
&lt;P&gt;I don`t use LabVIEW software. I am developing a software using C# programming. In this case, I compared the windows form application timer with the hardware one. The windows timer is not able to do a task in microsecond. The only thing I need is to design a button on a form. When the button is pressed each time, I need to write true on p0/line0 for 500 microsecond duration and on p0/line1 for 2 second duration. I do not know how I can use the internal timer to do this. I would appreciate your help.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;E.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:51:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705274#M19068</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-19T19:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705821#M19070</link>
      <description>&lt;P&gt;E,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;If you look at Text Based NI-DAQmx Data Acquisition Examples, you can see what examples we have provided by our DAQmx drivers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would need the DAQmx drivers, the newest of which are &lt;A href="https://download.ni.com/support/softlib/multifunction_daq/nidaqmx/17.1/NIDAQ1710f0.zip" target="_self"&gt;here&lt;/A&gt;. Make sure you do a custom installation so you can choose to include the DotNET options which are not included by default.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hope this helps! But, let me know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2026 01:45:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705821#M19070</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2026-05-23T01:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705859#M19071</link>
      <description>&lt;P&gt;Thanks for the answer,&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/581583"&gt;@TimothyDug&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;E,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;If you look at Text Based NI-DAQmx Data Acquisition Examples, you can see what examples we have provided by our DAQmx drivers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;You would need the DAQmx drivers, the newest of which are here. Make sure you do a custom installation so you can choose to include the DotNET options which are not included by default.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hope this helps! But, let me know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/581583"&gt;@TimothyDug&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;E,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;If you look at Text Based NI-DAQmx Data Acquisition Examples, you can see what examples we have provided by our DAQmx drivers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;You would need the DAQmx drivers, the newest of which are here. Make sure you do a custom installation so you can choose to include the DotNET options which are not included by default.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hope this helps! But, let me know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2026 01:46:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705859#M19071</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2026-05-23T01:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705876#M19072</link>
      <description>&lt;P&gt;Thank you for the answer,&lt;/P&gt;
&lt;P&gt;I already installed the driver. I looked at the examples but I couldn't find the right answer.&lt;/P&gt;
&lt;P&gt;I have written this code to use stopwatch timer of windows but it doesn't work properly in 500 microsecond.&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DigitalSingleChannelWriter write0 = new DigitalSingleChannelWriter(task0.Stream);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO0 = task0.DOChannels.CreateChannel("Dev1/port0/line0", "", ChannelLineGrouping.OneChannelForEachLine);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; task0.Strat();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write0.WriteSingleSampleSingleLine(true, true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((sw.ElapsedTicks *1000000/Stopwatch.Frequency ) &amp;lt;=500)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write0.WriteSingleSampleSingleLine(true, false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; task0.Dispose();&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I want to write "true" on line0 only for 500 microsecond duration and then return to "false". &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 20:21:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3705876#M19072</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-20T20:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3706700#M19078</link>
      <description>&lt;P&gt;Hey, so the way you have it is, as you suspect, software-timed. Instead of a single sample write and a software while loop delay, you are going to want to write a waveform, and enforce the 500 microsecond delay by enforcing the corresponding frequency, 2kHz. Then just configure the waveform to write, a 1 and then a 0, at that frequency. That should be the behavior you&amp;nbsp;are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/55df5f1f/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if you'd like to create something continuous, a pulse train, this would use a counter task (as opposed to a digital task), and the following link should help you set that up.&lt;/P&gt;
&lt;P data-unlink="true"&gt;http://www.ni.com/example/30745/en/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in touch with us, and let me know how it is going for you, and of course if you have anymore questions, or if anything is unclear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2026 01:48:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3706700#M19078</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2026-05-23T01:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707326#M19083</link>
      <description>&lt;P&gt;Hi, I tried for the timing and write the waveform. I couldn't do that. Is it possible to give me a brief example of this. I couldn't find any example in NI DAQmx folder for writing the waveform and changing frequency.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;E.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 22:05:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707326#M19083</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-24T22:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707769#M19086</link>
      <description>&lt;P&gt;I have written this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;NationalInstruments.DAQmx.Task task0 = new NationalInstruments.DAQmx.Task();&lt;/P&gt;
&lt;P&gt;DO0 = task0.DOChannels.CreateChannel("Dev1/port0/line0", "Port", ChannelLineGrouping.OneChannelForEachLine);&lt;BR /&gt;task0.Timing.SampleTimingType = NationalInstruments.DAQmx.SampleTimingType.OnDemand;&lt;/P&gt;
&lt;P&gt;task0.Timing.ConfigureSampleClock("",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000 ,&amp;nbsp; SampleClockActiveEdge.Rising,&amp;nbsp; SampleQuantityMode.FiniteSamples);&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;But it has an error:&lt;/P&gt;
&lt;P&gt;Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.&lt;/P&gt;
&lt;P&gt;Property: NationalInstruments.DAQmx.Timing.SampleTimingType&lt;BR /&gt;Requested Value: NationalInstruments.DAQmx.SampleTimingType.SampleClock&lt;BR /&gt;Possible Values: NationalInstruments.DAQmx.SampleTimingType.OnDemand&lt;BR /&gt;Task Name: _unnamedTask&amp;lt;0&amp;gt;&lt;BR /&gt;Status Code: -200077&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it mean that usb-6003 is not&amp;nbsp; able for changing clock frequency?&lt;/P&gt;
&lt;P&gt;Also, I was wondering if you could give me a sample code that how I can write a waveform exactly a 1 and a 0.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;E.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:31:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707769#M19086</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-25T16:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707882#M19088</link>
      <description>&lt;P&gt;Hey, thanks for the replies!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did some research, and found that &lt;STRONG&gt;the USB 6003 cannot do a hardware-timed digital out task&lt;/STRONG&gt;. You cannot use hardware timing with the digital out task for the USB 6003.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to understand what you want to do as we probably offer a device better suited to your needs. Do you simply want two pulse trains running at 2 kHz and 0.5 Hz (500 us delay, and 2s delay)? Or, do you just want a signal that arbitrarily goes high for 500 us and then low indefinitely, and the same situation for 2s on a different signal?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all you want is a pulse train, then we have an example that would do that, which I attached. Although, you only have access to one counter with the USB 6003, so you cannot do two continuous tasks simultaneously at different&amp;nbsp;frequencies.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;You can however do an analog square wave task at a 2 kHz frequency. However, your USB 6003 only has 1 counter on it, so you could not do 2 simultaneous tasks at different rates. Check out the spec sheet here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ni.com/docs/en-US/bundle/usb-6003-specs/resource/374372a.pdf" target="_blank" rel="noopener"&gt;https://www.ni.com/docs/en-US/bundle/usb-6003-specs/resource/374372a.pdf&lt;/A&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;For writing the 1 and 0 to a digital waveform, if you configure the task as a square wave,&amp;nbsp;or a pulse train, you would not need to explicitly write a 1 and a 0 periodically. It would automatically happen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, to explicitly write a line high, there is a lot that goes into that. I have a code snippet from the&amp;nbsp;&lt;STRONG&gt;ContWriteDigChan_PipeSampClk&lt;/STRONG&gt; from our examples below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;myTask.Stream.WriteRegenerationMode = WriteRegenerationMode.DoNotAllowRegeneration;

                int states = (int)samplesPerBufferNumericUpDown.Value;
                int signals = myTask.DOChannels.Count;

                // Loop through every sample
                waveform = new DigitalWaveform[signals];
               
                Random r = new Random();
                for (int i = 0; i &amp;lt; signals; i++)
                {
                    waveform[i] = new DigitalWaveform(Convert.ToInt32(samplesPerBufferNumericUpDown.Value), 1);
                    // Generate a random set of boolean values
                    for (int j = 0; j &amp;lt; states; j++)
                    {
                        if (r.Next() % 2 == 0)
                            &lt;STRONG&gt;waveform[i].Signals[0].States[j] = DigitalState.ForceUp;&lt;/STRONG&gt;
                        else
                           &lt;STRONG&gt; waveform[i].Signals[0].States[j] = DigitalState.ForceDown;&lt;/STRONG&gt;
                    }
                }&lt;/PRE&gt;
&lt;P&gt;The bolded lines would be explicitly writing a line high or low, and you could adapt the code as neccessary for your application. However, like I said above, the USB 6003 is unable to do a&amp;nbsp;&lt;EM&gt;hardware-timed&lt;/EM&gt;&amp;nbsp;digital task.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps. Let us know how this works for you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2026 01:48:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3707882#M19088</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2026-05-23T01:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3709024#M19096</link>
      <description>&lt;P&gt;Dear TimothyDug,&lt;/P&gt;
&lt;P&gt;Thank you very much for your answers.&lt;/P&gt;
&lt;P&gt;Actually, I want to control two valves with NI usb-6003. I have connected the valves to digital line0 and line1 (valve 1), line 2 and line3 (valve 2). When I runt my software, the valve 1 should be opened continuously till I press a button in my software. In this case, the valve 1 should be closed for 2 second, and consequently the valve 2 should be open for 2 second. Two change each valve status, I need two pulses. For valve 1, The&amp;nbsp; first one should be 500 microsecond in line0, and continuous "1" for line 1. For valve two, line2 should be 1 for 500 microsecond, and line3 should be "1" for 2 second.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's all I need.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:28:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3709024#M19096</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-27T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710002#M19101</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you should be able to do that with the USB 6003. Were you able to find the examples for C#? If you go through the install of the DAQmx drivers, there should be the "DotNET examples" to install. Those should be a good starting point. Have you had any troubles with those?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 20:12:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710002#M19101</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2017-10-30T20:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710015#M19102</link>
      <description>&lt;P&gt;I have already the examples , but I could not find any example that be suitable for this task.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mean it is possible to do it with usb-6003?&lt;/P&gt;
&lt;P&gt;Is it possible to give me an example that how I can have a digital channel 500 microsecond activated?&lt;/P&gt;
&lt;P&gt;I have no idea how I can do this with usb 6003. I would be grateful if you could give me a solution.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;E.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 20:35:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710015#M19102</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-30T20:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710610#M19106</link>
      <description>&lt;P&gt;Hi Ehsanzb,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Yes, there is an example that should help you get started. You should go to &lt;STRONG&gt;Start Menu -&amp;gt; National Instruments -&amp;gt; NI-DAQmx Examples&lt;/STRONG&gt;.&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;If you cannot do this, you need to install DAQmx, choose "Custom Installation" and be sure to install the option for DotNET 4.5.1. Let me know if you have any trouble with this step!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inside there, I would go to &lt;STRONG&gt;Digital -&amp;gt; Generate Values -&amp;gt; WriteDigChan-&amp;gt;CS&lt;/STRONG&gt;. The full path on my computer is&amp;nbsp;&lt;STRONG&gt;C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Digital\Generate Values\WriteDigChan\CS&amp;nbsp;&lt;/STRONG&gt;and then the file you want is called&amp;nbsp;&lt;STRONG&gt;MainForm.cs&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a lot of comments in that file detailing what it does and how to configure and use it. Let me know if anything is unclear! Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 18:32:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710610#M19106</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2017-10-31T18:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710632#M19107</link>
      <description>&lt;P&gt;I saw this example before. There is nothing about the timing? I know how I can write on digital channel. But, I do not know how I can do timing...&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 19:16:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3710632#M19107</guid>
      <dc:creator>Ehsanzb</dc:creator>
      <dc:date>2017-10-31T19:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: 500 MicroSecond Pulse</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3711220#M19109</link>
      <description>&lt;P&gt;Hey Ehsanzb,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other examples. I would look through them to find which one specifically works for you. For example, there is&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Digital\Generate Values\WriteDigChan_ExtClk\CS&lt;/STRONG&gt;&lt;/EM&gt;, or&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Digital\Generate Values\ContWriteDigChan_PipeSampClk\CS&lt;/STRONG&gt;&lt;/EM&gt; if you want it to run continuously. These each have clocks to configure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any specific questions. We do provide examples and answer specific questions, but we do not write custom code for customers, though there are Alliance Partner companies who can do that for a fee. Would you like contact information for them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you try out these examples and have anymore specific followup questions, I would be happy to answer those!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 18:34:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/500-MicroSecond-Pulse/m-p/3711220#M19109</guid>
      <dc:creator>TimothyDug</dc:creator>
      <dc:date>2017-11-01T18:34:32Z</dc:date>
    </item>
  </channel>
</rss>

