09-11-2019 07:27 AM - edited 09-11-2019 08:08 AM
I have an array of 10 switches that I send a command out to via digital output module NI9477, then I want to read if those output commands triggered a response with the LEDs that are controlled by those 10 switches within a pre-specified number of seconds. How can I throw an error or warning if the LEDs don't change state within the time limit?
Example:
command: turn on LED 2 and LED 4. turn off LED 5. timeout limit: 5 seconds
Remaining LEDs 1, 3, 6, 7, 8, 9 are not affected.
sent to digital output
reading digital input module NI9425
LED 2, 4 and 5 indication on front panel does not change state within 5 seconds.
How can I create a pop up message that says "LED X did not turn on within X seconds" ?
I've attached an example VI (with unconfigured/non functional DAQ assistants) that captures the essence of what I'm trying to accomplish. Due to the nature of my actual project, I cannot post the vi. I also don't have NIMAX installed on the machine I'm currently on.
*To be clear, my intent is how to generate error (not just display). How to time how long the input takes to respond to the command.
Solved! Go to Solution.
09-11-2019 07:56 AM
Look under the Dialog and User Interface palette and you'll see 1, 2, and 3 button dialogs there.
09-11-2019 08:54 AM
How do I trigger the error though? I currently have a block that uses a selector if the input time exceeds the timeout value. But how do I measure the time in between the LED circuit receiving the command to the LED and when the LED actually changes state?
09-12-2019 02:07 PM
You program it that way!
Are you familiar with shift registers? Are you familiar with comparison statements and case structures?
If the answer is no, then I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW
Write down a simple flow chart or some pseudo code that defines the logic you want, then you can search the palettes for the functions you will use to implement your logic.