01-18-2012 07:42 AM
I have been rattleing my head on this for the last couple of days with no luck.
What i am trying to do is the following:
send a signal into a NI9421 Module, when the module receives this signal it should output on the NI 9472. These 2 steps i have completed and are working however it is the next part whicc i am having trouble with.
When the input signal is removed from NI9421 i would like to kepp receiving a signal from the NI9472 for a period whihc can be easily adjusted.
I have tried to put in delays/waits (FOR loops behaving as counters),while loops etc but all this doesis delays the time between the input turning on before the output turns on. for example. If i put in a delay of 5 secs, the input needs to be closed 5 second before the output turns on, and the output will then remain on for a further 5 sec.
Any help is much appreciated.
Solved! Go to Solution.
01-19-2012 08:28 AM
What is the signal into the 9421? Could you attach the code you have so far so I can provide an example for you that is in useful context.
01-19-2012 08:53 AM
Hey Jack. W
Thanks for your help
The theory behind our project is that a physical momentary switch will be pressed and released (within a half a second approx), when the switch is pressed a signal (voltage 5 v ) is received by the 9421 (then the signal is back to 0 as the switch is in the open position), immediately after this signal is received the 9472 module outputs a signal.The length of time the signal is ouputted on the 9472 is detemined by a time delay.
The problem we are having is that there is a delay on the 9742 module when we press the input which equals the delay time setup in the time delay
We are using lab view 8.5. I have attached some code for you.
01-20-2012 09:50 AM
Just to clarify. Program runs and waits for the logic level of a channel on the 9421 to go HI » Immediately after the channel goes HI a channel on the 9472 starts outputting a signal » Output from the 9472 then stops after an adjustable amount of time.
What is the output signal?
The time delay you are experiencing is between the button press and the start of the output, how long is this?
01-20-2012 10:36 AM
The Output signal will be 12v brought in thru' the vsup and com. THe time delay we are experiencing is the same length of time that we set the delay to be. So for example if we set the delay for 3 secs then, when we press the button, it app waits 3 secs before the output is turned on for three sec, and what we are looking for it the output to turn on immediately for 3 sec, no waiting between the input and output.
01-24-2012 03:54 AM
Have a look at the example code below along with the description, hopefully it will get you started.
The while loop at the start polls the digital input pin and waits for a true before exiting the loop and entering into the DAQ Assistant2. The while loop has in it a wait of 10ms. This is to prevent it running to fast and hogging all of you CPUs time. Since the output of the DAQ Assistant in the while loop is an array the Index Array VI is used to get just one value which is wired into the loop condition.
The yellow lines used throughout are error lines and these can be very useful in LabVIEW to synchronise/ order parts of you code. Following the order of execution rule the DAQ Assistant2 will not begin until the while loop has finished its execution.
I have then used a Flat sequence to order a delay of 3 seconds (again with error lines) between the second DAQ Assistant and the third which turns off the digital output.
Hope this is clear and helpful