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.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCIe-6321 DI change detection

Hello,

 

This is my first project with DAQ so sorry for simple questions.

 

I have some switches like emergency stop, start, pause... that interface with my program and I want to preform some actions when value change is made.

 

If I uderstand correctly in my card I have 8 DIO lines that support buffering so they can be used for change detection (PFI lines can't), so I plan that this lines will be my inputs. PFI lines will be used as outputs to switch some relays because I don't need to monitor them.

 

change detection.png

 

So this concept should make it work?, whenever some of my lines at port 0 changes I read new data on all lines at port 0  and I can preform some actions based on which line chaged.

My question is how do I determine which button is switched after I start my application. How can I get initial values before first change happens?

 

Please correct me If I am thinking wrong 🙂

0 Kudos
Message 1 of 2
(4,139 Views)

Hi, Pawel,

 

welcome in DAQ programming. The easiest way how to get the initial status of switches will be simple reading digital values. You can look in LabVIEW > Help > Find Examples > Hardware Input and Output > DAQmx > Digital Input > Digital - SW-Timed input. There You can modify the example to acquire just one sample from each line of the whole port and You will get the initial states.

 

SW timed input.png

 

 

 

If You wish to do it in one easy step, You can use DAQ Assistant which is partly restrictive in some functionalities, but extremely easy to use. Just put it on the front panel and then follow dialog steps.

 

Just take care that You release resources after reading values. It has to be released before You start new task.

 

Good Luck!

0 Kudos
Message 2 of 2
(4,110 Views)