LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analogue output digital output

Hello,
 
I managed to create my VI in the proper way I think. I am trying to send a ttl every time my analogue output crosses zero. All whats left now is to transform the analogue data into a digital data and input it into the dammx write for the DO line. I would like to trigger on the zero corssing of the waveform and other intervals which I can select. Attached is the VI, I have created. I have trried to use a loop and find the zeros, but I think its simpler than that. I would also like to add the functionality of triggering eery nth zero corssing since the device I am triggering has a lower max freq then my drive signal
 
Thank you
 
Ala
 
 
0 Kudos
Message 1 of 9
(3,347 Views)

Hello Ala,

depending on the rate of zero crossings, or the rate of TTL you will ouptut, you might just decide to use a software check on the analog value change. anything below the KHz regime is no problem.

for checking zero crossing you would not check =0, because this value might never exist at rate of aquisition, but rather if it crosses the zero, by checking the previous value (use a shift register).

for faster rates of TTLs, you might need a hardware solution. but i do remember some NI cards doing exactly this. will update if i get more info.

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 2 of 9
(3,330 Views)
Thank you for the reply,I will be using the triggering in the Hz regime so I think any delays would not be to detrimental. I tried to search for the zero by collecting two consecutive data points and multiplying them, if the solution is negative then the point between these two points is the zero crossing but it did not work I think due to the rate of aquisition as you mentioned. I would need to use a shift register in a loop? As for the hardware solution, what sort of hardware am I looking at?.



Cheers
Ala
0 Kudos
Message 3 of 9
(3,318 Views)
Hi Ala,

Will something like the attached code do what you want?
It is in LV 8.2.1 format, so can be opened with LV 8.20 or later.

Regards
JamesC
NIUK and Ireland

0 Kudos
Message 4 of 9
(3,294 Views)

Hi James,

 

I cannot open the VI as I have labvciew 8.0, may you save it in that format for me please.

 

 

Thank you

Ala

0 Kudos
Message 5 of 9
(3,290 Views)

HI James, attached is another VI, trying to do the same thing. I figured that in order to vary the phase of triggering, I will keep triggering on zero zrossing but vary the phase of the (wv2) in relation to waveform 1. So will it will always bew triggering at zero crossing it will be varied in phase relative to the first equation waveform, thus I can trigger at any phase i desire.

 

Cheers

Ala

0 Kudos
Message 6 of 9
(3,285 Views)
0 Kudos
Message 7 of 9
(3,284 Views)
Hi Ala

My code in LV 8.0 format attached.

Regards
JamesC
NIUK and Ireland

0 Kudos
Message 8 of 9
(3,277 Views)

Hi James,

Thank you for that, Attached is  screen shot of the TTL and the analogue output. As you can see the TTL are not trigerring at a specefic instance with relation to the AO, and the pulse width varies(although this is not critical as I am triggering on the rising edge). I think the best solution would be to generate another simple waveform (WV2) at the same time of the equation waveform with the same frequency (low). Then use that signal to generate the trigger at zero crossing (WV2 labelleb in vi). Then to vary the phase with relation to the AO signal shift the simple waveform by a known phase and still trigger at zero crossing. Attached is the trigger illistration and a VI that shows the generation of the other waveform used for triggering. I have been trying to do this but to no avail.

 

Thank you

Ala 

Download All
0 Kudos
Message 9 of 9
(3,272 Views)