From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-25-2013 12:30 AM
Hi,
I have an analog input read from a PLC which is copied into a variable. whenever it crosses a particular value x, I want to set a variable. Something similar to a zero crossing detector in hardware. Is this possible in Labview?
Thanks!
11-25-2013 12:57 AM
What exactly do you mean by "crosses particular value"? Do you want to trigger a signal whenever your analog input reaches or goes high than that particular value?
You might want to use "equal to" function in comparison palette.
11-25-2013 02:13 AM
the problem with using 'equal to' is , the signal has to be polled in a while loop and the while loop requires a delay and if during the delay time the signal crossing happens the program will miss to detect it.
I am looking for something similar to a microcontroller interrupt. when an event happens, a signal is triggered, we dont have to poll for it continuously.
11-25-2013 02:36 AM
Use event structure to trigger another event whenever an input changes it's value. If it is boolean ( High or Low ) then use " Boolean Crossing ptbypt".
11-25-2013 02:55 AM
What is the sampling rate of your acquisition? Use "Timed Loop" to acquire every sample without missing one. And then inside that loop use event structure to monitor for signal change and then trigger an event based on that change.
11-25-2013 03:23 PM
Use a >? comparison with the analog input wired to the top terminal and the value of x wired to the lower terminal. The output (boolean) goes to a shift register. Compare the previous result (left terminal of shift register) to current value (output of comparison). If they are different, you have an "x-crossing." If you only want crossings in one direction, the logic is slightly different.
Lynn