ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM an Digitalen Ausgang - PWM on digital output

Hi!

I am currently using the PCI-MIO16-E card!
I want to use PWM for one digital output, so I thought I can use this simply code:

private

void klemme_schonend_unten_zu()

{

int delay=4;

do

{

     System.Threading.Thread.Sleep(delay);

this.m_Hardware.Klemme_unten(1);
System.Threading.Thread.Sleep(24-delay);

//jetzt klemme öffnen

this.m_Hardware.Klemme_unten(0);

delay=delay+1;

}

while(delay<=24);

this.m_Hardware.Klemme_unten(0);

}

0 Kudos
Message 1 of 2
(3,195 Views)
Sorry, no chance to edit.. here again:
 
OK, I want to use PWM to my digital output with this code:
 

private

void klemme_schonend_unten_zu()

{

int delay=4;

 

do

{

System.Threading.Thread.Sleep(delay);

this.DigOutKanal.WriteSingleSamplePort(true,1);

System.Threading.Thread.Sleep(24-delay);

this

.DigOutKanal.WriteSingleSamplePort(true,0);

delay = delay + 1;

this.m_Hardware.Klemme_unten(0);

 

}

while(delay<=24);

Is this ok? Or is anything finished on the hardware to use?

Yours, Klaus from AUSTRIA

0 Kudos
Message 2 of 2
(3,193 Views)