10-28-2015 09:25 AM
Hi,
Of course I looked at the example VI you posted! However when I run the below VI nothing happens. The trigger is generated internally on the CO0 while the desired pulse is generated on CO1. The CO1 is connected to an analog input channel so that I can display the signal being generated. At the moment nothing seems to happen and I honeslty don't know why...
10-28-2015 10:49 AM
You'll have to bear with me as well, since I don't have any hardware to test this with. One change you do need to make - you need to start BOTH counter tasks. If you only start the one that's waiting on the trigger, and never start the one you're using as the trigger, then there's never a trigger and nothing happens.
If you have an oscilloscope available, it would be worth putting both counter channels on the scope so you can see that they're both firing.
10-28-2015 05:22 PM
Hi,
Have tried to make some modifications to the previous VI as to ensure that the triggering CO0 starts before the second counter C01, which I think it does, but still don't have any output. I some sense this was my initial problem, namley how do I internally trigger one counter using another couter. Take a look at the attached file, maybe you have some suggestions on what I'm doing wrong!
Thank you for your time.
10-28-2015 07:23 PM - edited 10-28-2015 07:24 PM
My apologies, looks like I've misled you a bit - I can't find a way to get a simulated device of your hardware to allow the counters to be used this way. A finite pulse train requires two counters: one to generate the pulse train, and a second one to gate it. However, what you can do instead is make two infinite pulse trains, with one as the pause trigger for the second (one counter gates the other).
I highly recommend that you put indicators on your error outputs, or probe them, or enable automatic error handling, or in some way look at the error values and strings, since I think that would have indicated earlier in this discussion that there is a problem.
Try something like this and see if it works.
10-29-2015 08:14 AM
No need to apologize! It seems as the first configuration, where a finite pulse train i generated by the use of two counters - one to generate the pulse train and a second one to gate it, is more suited for my future application. The question here is how do I achieve this? Do I need to physically connect a wire from the CT0 Out to CT1 Gate? Will also try the code you suggested previoulsy!
10-29-2015 08:34 AM
10-29-2015 10:30 AM
Hi again,
The example VI did not work as expected, for some reason the output was distorted! Also, I find it difficult the to follow the workflow due to unfamiliarity with the property nodes. Thank you anyway! Can't help woundering wheter there exists a simpler solution to the problem. Do you think that the desired functionalty can be achieved using the DAQ-assist or some other straightforward method?
10-29-2015 11:56 AM
In what was was the output distorted? Can you provide an image?
I never use the DAQ Assistant, so I haven't investigated what you can do with it. It's worth learning the DAQmx functions so you can use the full capabilities of your device. That said, it's possible that there simply isn't a way to do exactly what you want with your current hardware.
The sample code I provided is a snippet - you can drag that code directly into a block diagram (or possibly to the desktop first, then into a block diagram, depending on your web browser). You don't need to recreate it, although you will need to modify the parameters and device names to match your setup.
What my example code attempts to do (and again, I can't test this because I don't have any counter hardware available at the moment, so all I can do is verify that it doesn't generate any errors) is use the Counter 1 output as a Pause Trigger for Counter 0. When the Pause Trigger condition is met, the counter output stops (but the counter keeps running). You'll need some way to synchronize these two counters (I suspect the distortion you describe is because the counters are not synchronized) but I don't know how you would do that, as it seems there is not another output available on your board to trigger both counters simultaneously. Perhaps you can find some way to use one of the analog timing signals to do this.
10-29-2015 12:13 PM
Hello,
nathand,
Going back to your initial question,
You said, "But, simply inserting this into a while loop will not solve the problem as the associated loop-delay is in the order of 70ms."
What is causing the 70ms delay? Does the pulse generation sequence take 70ms to complete?
10-29-2015 03:15 PM
Hi (hmarcano),
During my first approach to solve the problem I used the DAQ-assist as to generate a finite burst of 8-pulses with 50% duty cycle at 40kHz (or T = 25us) at the CO1 of the NI USB-6211 and this worked just fine. Now I wanted to repeat this cycle (say for example every 2ms), that is, once the 8 pulses are generated the counter output should stay on a low idle state for 2ms and then generate the same 8 pulses again and so on... In some sense this can be viewed as a custom counter output sequence! To achieve this I tried to put the DAQ-assist inside a loop along with a time-delay = 2ms. This simply did not work as the CPU-time it takes to loop i much greather than the 2ms time-delay. This seems to be a limitation of the DAQ-assist the task i recreated every loop and this takes a certain amount of time. Hope you now understand my confusion. Feel free to give suggestion, possibly example VI's!