08-03-2017 05:58 PM - edited 08-03-2017 06:07 PM
This is my VI. If I put n value for loop really high ( like 60 or 80) there is a big delay in relaying from labview to daq to my device. I currently put a time delay of 300 ms so the time it reads from labview be synced to time signal gets from daq to my machine (almost)
here is my question
1- im using c9174. is there a way to know how long it takes to send a digital signal so i can calculate a total time delay?
08-03-2017 07:39 PM
What do you want to have happen here?
The For loop is sending the data for 30 high/low pairs, and the DAQ Assistant is set to On-Demand sampling. This means that the Wait (ms) is the limiting time.
What does this mean? :
@Canucks.canucks wrote:
I currently put a time delay of 300 ms so the time it reads from labview be synced to time signal gets from daq to my machine (almost)
At the moment, I'm guessing you're trying to use the Stop button and are unhappy that it can take up to (0.3*60=18 seconds) to respond.
Determine what rate you want the boolean to pulse at, and then use clearer code, like the DAQmx functions, to get what you want.
If you want pulse trains, like you have now, you can continue with a For loop, but if you want to stop at any point, remove it.
Using DAQmx you could also have a regenerated output and use the Timing node to control sampling.
08-03-2017 09:25 PM
Thank you for your reply
basically by sendinging digutal sognal through our labview program , we are changing levels in our device . So our goal is instead of physically pressing the button 50 times so it goes from level 1-50 , we send digital signal 50 times 50 times so it automatically does that for us . The problem is if I get rid of time delay , the loop
runs for 50 times so 50 times the Boolean signal is sent to daq . However since it's too quick and it takes time to relay this from our labview program to our daq to our device , the device goes maybe 38 ( random number ) times instead of 50.
08-03-2017 09:36 PM
Dont' get rid of the time delay. What you need is to get your program to react more quickly to your Stop button.
I would consider making your For Loop a conditional Stop for loop and put your stop button inside of that. it will react much quicker since you won't need to wait for the inner For loop to finish (and probably again) before the outer while loop can end via the stop button.
08-03-2017 09:47 PM
I'm not using the stop button at all actually . I just want it to run for a certain amount
08-03-2017 09:55 PM
Then I guess I don't understand what your actual problem is and what you mean by "delay in relaying".
If you want to send a digital pulse stream, then I'd create that rather than doing point by point boolean changes. What DAQ device are you using?
How are the numbers 38 and 50 related to the 60 you have set for the loop?
08-03-2017 10:00 PM
I'm using c9174
see if I put the number for running the loop equal let's say 50 , then put time delay of let's say 300 ms . 50 Boolean signal is being sent to daq and my machine goes from level 50 level up as expected ( but then I'll end up with time delay in overall program )
if I get rid of the time delay , 50 Boolean is being sent super quick but my device only goes maybe 38 level up ( instead of 50)
08-03-2017 10:00 PM
I just put 60 in the code as an example
08-03-2017 10:03 PM
I see you say you are using a CDAQ 9174. But that is just a chassis. What module are you using in it for digital output?
I still don't understand what delay problem you are having. Why do you even think you have a delay?
08-03-2017 10:10 PM
I think we might get to the desired behaviour faster if we know what your device is, or more specifically how fast it can read a digital line.
Do you have a manual/spec sheet, or at least the name of the device you're sending the boolean to (the thing which is incremented, not the DAQ device, although that would also be nice to know).