05-03-2013 07:12 PM - edited 05-03-2013 07:14 PM
I’m terribly new to this sort of thing so forgive me if my questions seem trivial. I’m looking for VB code that allows me to pulse the outputs on the USB-6501 24pin I/O. Or, is it possible to view/edit the code that that MAX uses in its test panel ?
If any of these are possible, could someone point me to a link please? I’m trying to edit the output so that I can make the ports behave like a chopper circuit (ie. Pulse the output high for 25ms, low for 75ms. My expected result would be 25% of ttl voltage or read from a meter connected to the output – 1.25V rms). Does anyone see a problem with this?
05-06-2013 07:28 PM
Hi Gunnar-6501,
The USB-6501 only uses software-based timing. Because of this, generating a reliable 25ms pulse is likely to not be possible. You would need hardware with an onboard sample clock to use for this kind of timing, since many operating systems have unreliable response times. If you would still like to give your pulse generation a try, I would suggest looking at examples in Measurement Studio concerning generation of a Digital Waveform Graph for basic function setup. Using Visual Basic 2010 and Measurement Studio 2012, the following example is a useful starting point:
C:\Users\Public\Documents\National Instruments\MStudioVS2010\DotNET\Examples\DAQmxWithUI\DigitalWaveformGraph\vb\DigitalWaveformGraph.2010.vbproj
Let me know if you have any questions, but once again, a reliable 25ms high, 75ms low pulse is not likely to be achieved through software timing.
05-07-2013 01:23 AM
Thank you for your reply. I’ll check this example out in the next few days.
I have a follow-up question, when you say ‘generating a reliable 25ms pulse is likely to not be possible.’ Are you saying it wouldn’t be accurate or it won’t work? My application wouldn’t require tremendous accuracy. A little bit of drift or +/- 5 % on the voltage output would still be very useful.
As an example, I was going to program 3 VB buttons that would all output to the same port. ‘onmouseclick’ the port would ‘chop’ TTL voltage to 33%, 2nd button 66%, 3rd – 100% . Is this within the 6501s capabilities (please say yes)?
05-07-2013 07:40 PM
Hi Gunnar-6501,
I meant that, while you will be able to generate a pulse, it will not be an accurate 25ms each time. Because you will have to use software timing, the operating system will experience periods of slow operation that will cause the pulse to not reliably repeat every 75ms. It will also not be exactly 25ms each time either. Software timing will allow you +/- 5-10ms with each pulse in regard to both the duration and the duty cycle.
In regard to the TTL voltage, you are only able to output a TTL signal. The NI-6501 does not have the capability to output low-TTL steps. You may be able to do this with an analog DC signal, however. I would recommend looking into some of our hardware that includes some type of sampling clock such as many of our PCI cards or compact DAQ solutions. These will give you a reliable sample clock to base your pulses and duty cycle on and many also have low-TTL steps for digital I/O.