From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse Generation from Fieldpoint IO Point Digital Input

I want to generate a single digital Pulse based on my input from field (i am using Fieldpoint IO Point) to acquire digital signal. I want a High Pulse if my input goes High.
 
Inputs: Fieldpoint IO Point
OutPut Required: Single Boolean Pulse
 
 
Hardware Used: CFP-DI-330
Software Used: Labview 8.2 Full Development System
 
Thanks!
0 Kudos
Message 1 of 10
(4,501 Views)
M_Atif,

Have you considered just using a sequence structure with a local variable, like so?



Regards,

Simon H
Applications Engineer
National Instruments
http://www.ni.com/support/

Message Edited by Simon H on 01-22-2007 01:34 PM

0 Kudos
Message 2 of 10
(4,493 Views)
I think i was unable to explain my problem, I want a SINGLE PULSE (Output should be High for a small period of time and then low even my input remain high). It should generate pulse only If i change my input from low to high.
 
The problem with your solution is that it remain High. I want it high for a small duration of time and then should remain low continuossly. It should generate pulse if a change the input from low to high.
0 Kudos
Message 3 of 10
(4,483 Views)
Please check Attached VI.
0 Kudos
Message 4 of 10
(4,481 Views)
M_Atif,

So logically what you want is for an output to be high if and only if the previous iteration's read is false and the current iteration's read is true?  This will be true only during the iteration after a rising edge. 



You can control how long the pulse is by either altering the wait in the loop or by using a sequence structure to turn the signal off whilst still in the while loop.

Regards,

Simon

Message Edited by Simon H on 01-23-2007 09:54 AM

Message 5 of 10
(4,476 Views)
Please analyze the attached file I have created, It will generate a single pulse for a small duration of time even if my input remain high. now can you please make it as a sub-vi. Problem is that when i create a sub-vi while using the local vairables it does not work. Please try to sortout this problem. Now i want to use it in a single VI multiple times.
 
Thanks for being with us.
0 Kudos
Message 6 of 10
(4,465 Views)
Please analyze the attached file I have created, It will generate a single pulse for a small duration of time even if my input remain high. now can you please make it as a sub-vi. Problem is that when i create a sub-vi while using the local vairables it does not work. Please try to sortout this problem. Now i want to use it in a single VI multiple times.
 
 
Thanks for being with us.
0 Kudos
Message 7 of 10
(4,465 Views)
M_Atif,

In what way does your VI not work?

Also think about if you really need to use a local variable here.  Local variables introduce some overhead and complications that are avoided by using simple wires.

Regards,

Simon
0 Kudos
Message 8 of 10
(4,432 Views)

Thanks Simon,

You are right that i am not able to use it as a sub-vi when i am using Local Variables, When i use a local variable and reuse it as a sub vi, if i change the value for one variable it changes everywhere,  then what are your suggestion to avoid the use of Local Variables except wires you discussed because i need Local Variable,  without these i am unable to develop a VI.

0 Kudos
Message 9 of 10
(4,417 Views)
M_Atif,

Using a local variable in a SubVI shouldn't cause any problems.  The reason I was warning you against using them is that they often misused which leads to poor coding practices.

In this particular VI I would suggest using highlight execution mode to verify the logic does what you intended (it looks to me like you have a lot of unnecessary code). 

It also looks like you have set up this VI to act like a functional global in the sense that you have an uninitialized shift register and a loop that will only execute once.  This means that every time this VI appears in your application you will be acting upon the same shift register data.  Is this what you wanted?  If not then I don't think you need the while loop nor the shift register.  If it is then the behavior you are seeing is probably to be expected.

Regards,

Simon
0 Kudos
Message 10 of 10
(4,400 Views)