NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
univer_solar
Posts: 6
0 Kudos

Stop digital pulse based on external signal

Hi All,

 

I made a code to synchronized my PWM with an external signal source. For instance, the PWM can only work with the duty cycle updated dynamically when the external signal is high, otherwise the PWM should be low. I can control the dynamic duty cycle update and I tried to used the pause digital pulse function of DAQmx Trigger. There is a little bit problem that the PWM just pause based on the external signal, so sometimes the PWM is still high when the external signal is not in the properly condition. What I want is the PWM immediately change to low when external signal is low.

I attach my code. Would you please give me any advice for modifying the code?

Thanks in advance.

 

Active Participant
LiciaP
Posts: 800
0 Kudos

Rif.: Stop digital pulse based on external signal

Hi,

try having a look at this post for further suggestions.

I hope this helps!

Bye,

 

Licia

Trusted Enthusiast
John_P1
Posts: 2,073
0 Kudos

Rif.: Stop digital pulse based on external signal

The solution in the other thread seems to have worked out since the original poster was driving a stepper motor and the duration of his pulses wasn't too critical.  In your case, perhaps the software control isn't what you are looking for (hard to say without more information).

 

It sounds like you are basically looking for an AND gate--it might be easiest just to add this externally.  Could you elaborate a little more on the behavior you want?  For example, what is the intended behavior if the external signal goes low when in the middle of generating a pulse?  It would be also useful to know what hardware you are using and what other subsystems are available (are you using the other counters or the DIO?)

 

 

Best Regards,

John Passiak
Member
univer_solar
Posts: 6
0 Kudos

Rif.: Stop digital pulse based on external signal

Dear John,

Thank you for your reply. I am using NI USB 6363. My application is to make the PWM that can control the LEDs.

I am using the Counter 0 to generate Pulse train. The external signal is connected to PFI0. I want to synchronized the PWM generated by the Counter0 with the external signal. If the external signal is low, I want the PWM immediately goes to low so that the LEDs will be turned off.

The program I made in the attachment using the Pause Trigger so I think it only pause and keep its value (0 or 1) when the external signal goes to low, that's what I do not expected.

Best regards,

Univer

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page