Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Change TTL level on rising edge of trigger signal only

Hello everyone and thanks in advance for taking the time to read this.

 

I am currently using a USB-6211 and LabVIEW XX, I am also relatively new to labVIEW and so would greatly appreciate some helpful hints! Anyway, my problem is to do with triggering and manipulating an input TTL signal so I have attached a timing diagram to this post, and will refer to it to explain my problem better. Here it is....

 

I have a 5V TTL signal from an optical chopper as an input to PFI0 on my board (green signal on diagram below). On alternating cycles of this chopper signal, I need to output a 5V TTL signal to open and close a shutter. Thus, what I really need to do is create a digital waveform that switches state on the rising edge of the input chopper signal (i.e.. the red signal on the diagram below). Is there a simple way to do this? I have been trying to figure this out all day!

 

 

 

The next part is really confusing me:

 

In addition to generating this shutter signal, I need to time a laser to switch on and simultaneously collect voltage data from a photodiode. The problem is that the laser illumination and voltage signal collection must start after the shutter signal has gone high, and it must end before the shutter signal goes low (to make things easy these delays will be the same, and 10% of the period of the green chopper signal). This is then further complicated (in my mind) since the original (green) chopper signal frequency can be changed between experiments. The required signal is shown in blue.

 

Now I know that once I have generated this signal, I can use the Pause Trigger Property Node to stop/start the photodiode data collection, and simultaneously I can route the signal to another PFI pin to control the laser. However, I have absolutely no idea how to generate this signal. My (scattered) thoughts were as follows:

 

1 - Somehow measure the frequency of the incoming green chopper signal.

2 - Calculate 10% of the chopper signal period, to be used as the delay between shutter closing and laser illumination / data collection.

3 - To switch off the laser illumination/data collection I can use the 10% time value to work out the required duty cycle of the required blue signal.

4 - Generate a digital waveform using the above properties.

 

Now I have no idea if this is even possible with the method I have proposed, or if it would be possible tomanipulate the red shutter signal in some way. Can anybody confirm this, and point me in the correct direction (via shipped examples or examples on here) on how to do the actual signal generation?!

 

 

Many many thanks,

 

Calum

 

0 Kudos
Message 1 of 3
(6,177 Views)

on alternating PFIO count is your red signal line, once HI....add voltage signal to an array  Smiley Wink

 

Spoiler
pfi02.png

 

0 Kudos
Message 2 of 3
(6,167 Views)

Thanks apok, from what you said I did generate the red signal, however It was out of sync. I now have a better way to achieve this, but still need help with the other signal!!

 

Okay, I have managed to generate the red signal by dividing down the external clock (green) by two using a counter and pulse ticks (this was in another thread and I will try and find the link again to give credit where it is due!

 

Part one successful. However I am still struggling to create the other (blue) required signal. I thought that setting up my  second counter to trigger off the clock signal, and with the output of the first counter routed to the second counters input, I could simply introduce a start delay, and modify the duty cycle of the pulse signal accordingly would work.

 

Nothing is ever easy for me though, when trying to use the DAQmx property to set an initial delay I get error (200452). Can anybody help me introduce the delay I need?! (By the way I know the exact frequency of the clock (green signal, thus can enter the delay an duty cycle required on the front panel!)

 

Divide counter by two extended.jpg

0 Kudos
Message 3 of 3
(6,102 Views)