Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Recommended way to create a pulse output with a 6518 using C# Application

 

Hello,

 

What is the Recommended way to create a pulse output when using a NI 6518 card (DAQmx driver) from code in my C# Application.

 

I am doubtful that a 6518 specifically supports doing this form pulse related code in DAQmx driver.

 

My scenario is to say, pulse high for 100ms, then bring low again.

 

(Pointing me to a useful example would also be appreciated as I am new to all of this stuff)

 

Ian

0 Kudos
Message 1 of 3
(3,427 Views)

Hey Ian,

The card you are using does not have an on board counter.  This means the timing for the pulse train generation would be done by your software.  This will give you very inaccurate timing.  I would suggest you try using a card with a counter on board.  If you have one - this example shows how to use a counter to do it (it's available in C#.NET and C): http://zone.ni.com/devzone/cda/epd/p/id/2415

 

Alternatively you will have to use the computers clock to send 1 and 0 to the DIO line.  You can find text based examples for DAQmx at Start > Program Files > NI-DAQ > Text Based Code Support

 

Let me know how you get on.

Dominic Walker
Cardiff University
Electrical and Electronic Engineering Student
0 Kudos
Message 2 of 3
(3,402 Views)

Thanks for response, I have alreay done some work to create a pulse for 6518 at this stage.

 

I do the timing myself in my code ....

I set line high

and then kick off a threading.timer for the pulse duration

in the timer callback i rest line - and kill the timer

(the threading.timer method will have to be locked to be thread safe)

 

Ian

0 Kudos
Message 3 of 3
(3,399 Views)