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.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can i use a digital trigger to change the case of a case structure loop

I am trying to change the case of a case structure loop from false to true using a digital trigger but don't know how to "wire" it. Can this be done or do I need to use a different approch. I need to do this to switch between two logs that log an analog signal. One of the logs is for samples and the other is for standards so I don't want them in the same log.
0 Kudos
Message 1 of 3
(2,212 Views)
As far as I know, it isn't possible to read the state of a digital trigger from the digital trigger pin in a data acquisition board. However, I might be wrong!

I would suggest you to wire the digital trigger signal to both the digital trigger pin and TO ONE DIGITAL I/O LINE of the data acquistion board. You can read the state of a digital i/o line with the "Read from Digital Line.VI" in LV, or with the NIDAQ function call "DIG_In_Line (deviceNumber, port, line, state)". First, LV return a boolean regarding the state of the line which you can use to change the case of your case structure, and CVI returns a 16-bit integer, which you can manipulate to do the same as in LV.

Hope this information is helpful.

Aguila
0 Kudos
Message 2 of 3
(2,212 Views)
Ken

Here is a quick LabVIEW example written with LV 6.0.2 that shows a way to do what Aquila is saying. I hope this helps.

The only problem you may face with this method is if your trigger signal is not very long. With E-Series boards, the only way to monitor the Digital lines is my polling them by software. If the trigger comes and goes before the program checks the state of the digital line, you may miss the trigger.

If this is the case, you may want to consider using a counter on the board to read in the trigger. You can set up a counter for Simple Event Counting and connect the trigger to the Source of a counter. Then you can poll the current count on the counter, when the count increases, you will know that the trigger has occured.

Brian
0 Kudos
Message 3 of 3
(2,212 Views)