05-28-2016 03:46 PM
Hi there,
I would like to use the USB 6501 to trigger the execution of some code. I am struggling to figure out a way to do this because all of the examples I can find use a daq to trigger acquisition on the same device - I don't want to use the 6501 to do anything except see the trigger and then I want to execute code which doesn't use any daqmx vi's.
To be more clear, here is what I would like to do:
I am confused about a few things:
Thanks so much!
Sabrina.
Solved! Go to Solution.
06-01-2016 01:25 PM
Hey,
You can use the USB 6501 to trigger your code and the Counter is fast enough to catch to 1.5 us resolution you need.
As for how that is done, can you give me some background on what your experience with LabVIEW is?
I want to find some examples online by searching through our forums, you can as well if you don't want to wait for me. I just want to see how much information you are going to need or if maybe some training is needed.
As far as I can tell, you are trying to read in a digital signal, have the USB 6501 reading in the signal and when a certain signal is coming in, triggering a section of code.
The examples of triggering should work if you put your own code in the while loop. To be sure, I would have to see the code example you are looking at.
Can you,
1. Tell me if I am understanding you correctly and show me the examples you have been looking at for this?
2. Try some code with instead of the aquisition VI's in the loop, try the code that you want.
3. How are you going to assure the code is running within 10 ms?
-Ben
06-01-2016 05:28 PM - edited 06-01-2016 05:29 PM
Hi Ben,
Thanks for your response.
To respond to one my questions, I found that the minimum pulse width for the digital i/o channels on the USB 6501 (excluding the counter) is 300ns, so it certainly does have the ability to see a 1.5us pulse.
To respond to your questions:
I am new-ish to LabView, but I am experienced in many other languages (C/C++, Matlab, Python, XML, VHDL). I'm not a coder or a code jockey, but I've had to figure out various languages through out my career, so I'm at least comfortable with wading through a bunch of information and learning as fast as I can until I get whatever I need done.
Thanks again!
Cheers,
Sabrina
06-02-2016 12:25 PM
What do you mean breaks the flow of the program?
I was just thinking of using the trigger setup but stopping the task as soon as the trigger goes off and then have the code following the stop/clear task VI's. That way the code still waits on the trigger but there is no acquisition that happens once it is triggered.
You may also accomplish this with an edge count task. I am not sure.
Can you try creating a digital trigger task and then stopping the task right after the trigger VI and then have a loop/code diagram of the desired code?
-Ben
06-05-2016 09:43 PM
I'll give that a go and let you know. A critical instrument just broke so I won't be getting back to this for at least a week.
Thanks for all your help!
06-14-2016 08:18 PM
Hi, I'm back to the LabView now.
What I'm struggling with is that I am using LV to control a deparate software suite - so there is already a program flow associated with that. I can't just 'add in' DAQmx VI's - the program flow is controlled by the automation 'wires' for the other software suite. So adding in Daqmx triggering and tasks breaks the flow of the program. The screenshot attached shows what I mean by that.
I need to be able to use the pulse to start the execution of some code which is controlled by an automation flow which is completely separate from the DAQmx flow.
Any ideas?
06-15-2016 04:28 PM
What if you put your DAQmx Start Task VI into a flat sequence structure, and ran the “automation wires” through the sequence structure as well? The DAQmx task would be configured to wait for a trigger, so the DAQmx Start Task VI wouldn’t run until the trigger had been received. Since the “automation wires” run through the sequence structure, the flow would simply be halted until the trigger started the DAQmx task. You could then place the code you want to run after the trigger is received immediately following the sequence structure. This is where you could also stop the DAQmx task, as Ben had mentioned.
06-15-2016 07:35 PM - edited 06-15-2016 07:36 PM
Thanks Ross!
That's what I did, and it worked. Very much appreciated!
Cheers,
Tanya