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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use PFI as a user input switch?

0 Kudos
Message 1 of 9
(3,419 Views)
0 Kudos
Message 2 of 9
(3,417 Views)

Please put some words into the body of your message so that we can have some details on what you are trying to do.

0 Kudos
Message 3 of 9
(3,414 Views)
Hello.

I have a NI cDAQ-9188 that I am using to sample, display and log data. The user would like to add a "pickle" switch to the PFI port to signal an event to start or stop a process. I am having a difficult time trying to do this. Please advise.

Thanx.

Bill.
I was using IE9 but had to switch to google chrome to get text in the boxes.
0 Kudos
Message 4 of 9
(3,409 Views)

I assume that you're talking about starting/ stopping the actual data collection?  All you'd have to do is take your data collection VI (the picture below used the Acq&Cont Voltage example VI included with Labview), put a while loop and case structure around the VI.  You can wire your boolean switch to the case structure.  Just leave the false case blank and add a stop button of some sort to the while loop.  

 

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 5 of 9
(3,376 Views)

Thanx, but I don't think that is it.

 

I've got a producer loop (essentially your VI example) pushing consumer data though a queue to update the UI or store to disc. What I need to be able to do is when the user pushes a hand held button that I want to connect to PFI 0, I am able to capture that event and then start my process state machine.

 

I've attached an outline of what I have been doing. I would much rather catch a screen event in an event handling loop but the user is attached to this external button.

0 Kudos
Message 6 of 9
(3,368 Views)

OK, thanks for clearing that up.  Below, I've linked a DevZone example/ tutorial that is using a digital start trigger from a PFI channel to start analog input & output using the DAQmx VIs.  I think what you're looking for to start your data collection is the DAQmx Start Trigger (Digital Edge) VI.  This will let you specify a PFI trigger source to begin the task.  Try this and see if this is more similar to what you were looking for.

 

Synchronizing Input and Output Channels using an External Start Trigger:

http://decibel.ni.com/content/docs/DOC-11645

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 7 of 9
(3,333 Views)
0 Kudos
Message 8 of 9
(3,324 Views)

Figured it out. I am so smart. S-M-R-T Smiley Tongue

0 Kudos
Message 9 of 9
(3,297 Views)