Discussion:
Syncing loops
(too old to reply)
sha33
2008-07-31 19:10:10 UTC
Permalink
Hello All:
I have a rather simple problem. I have two loops; one is a timed loop and the
other is a counter source picking up random signals. The algorithm is:







- I have a stream of signal coming in thru the source. 


- I have a times loop that is used for a trigger.






- The setup is such that after 5 sec (determined by the
timed loop) I want to wait for the next immediate random signal (high state) and
when they are both true to I want to generate a pulse train for 20 sec. 




What I have done so far is attached. The problem is when
they are both true and while I am generating the pulse train, there will still
be state when they both are true but we wont do anything during the pulse train
generation.
So far I have created global variables to transport the signals outside the loop but now what?


This is that simple but my simple mind cannot solve this
problem. I am stuck! Any help?
Thanks in advance.

<img src="Loading Image...">


&nbsp;


&nbsp;


&nbsp;
Sorooshster
2008-08-03 17:40:17 UTC
Permalink
Hi sha33,
What hardware are you using?&nbsp; You've given some good information on your software issue but if you can explain the hardware (pci cards etc.) it will be easier to solve this.&nbsp; Depending your hardware you may not even need to use a timed loop.&nbsp; Thanks.
&nbsp;
sha33
2008-08-05 14:40:08 UTC
Permalink
Thank you very much for your reply. I forgot to mention the board. Its PCI 6601. I am using this board for some other projects too. I can detect the ttl pulse coming in and I have tested it but the problem is to get that sync thing right - whenever I reach my time I start the pulse train at the next pulse coming from the input (the ttl pulse) Thanks
sha33
2008-08-05 15:10:07 UTC
Permalink
To give you a better understanding : <img src="Loading Image...">
sha33
2008-08-06 16:10:06 UTC
Permalink
Any idea guys?
Sorooshster
2008-08-07 14:10:06 UTC
Permalink
Hi Sha33,
It seems like you are using the loops to essentially act as a trigger for the generation of your pulse.&nbsp; I think you will be better off if you use a counter task and set up the triggers in hardware.&nbsp; You can create a counter task that has an initial delay of 30 seconds, meaning that it will wait 30 seconds before starting.&nbsp; Once that task starts it generates a pulse train that you can define by the number of ticks, high time/low time etc.&nbsp; As soon as the pulse generation is done it goes back and waits for 30 more seconds.&nbsp; There is an example in the NI Example finder called Gen Dig Pulse-Retriggerable.vi.&nbsp; Go to the example finder and search for trigger or triggering to find that example.&nbsp; You migh also consider posting this question on the DAQ forums to get further help implementing this in hardware, which I think will be substantially easier than trying to use timed loops to act as timers for you hardware.&nbsp; Thanks and have a great day.&nbsp;
Loading...