Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Fgen : Synchronisation + Delay insertion

Solved!
Go to solution

Hello everybody !

 

I have a PXI system in which I have a 5422 FGen allowing me to generate a "10 periods sinusoidal burst".

The 5422 FGen also has the following connections : ch0 ; Clk in ; PFI 0 ; PFI 1

 

I would like to insert a "timing reference" signal (in PFI0 e.g.) and generate my burst "x" ms later. Is there a function directly related to the fgen allowing to perform such a thing (synchro + delay) ? Do I have to use DAQmx possibilities (I must admit I am a little bit lost with the DAQmx functions ...).

 

Here is the part of my code  where I assume I could insert the function I am looking for.

 

Capture.PNG

 

Can anyone help me ? Thank you in advance !

 

0 Kudos
Message 1 of 18
(5,457 Views)

Hi!

 

I am Collin de Wit, an Application Engineer at National Instruments, if I undertsand you question correctly you are looking for a VI or function that can delay a user defined amount of ms? Preferrable with the F-GEN functions built in labview looking into the picture you posted. There is a special page in the community with a great example on this usage so I propose that you take a look at that page. https://decibel.ni.com/content/docs/DOC-41408

 

This example is with ns, but is very easy to implement for ms. It really shows the good example on how to use the properties for the timing.

 

Please let me know if the information was what you ae looking for.

 

Best regards,

Collin de Wit

0 Kudos
Message 2 of 18
(5,400 Views)

Hi Collin !

 

First of all, thank you for your response. The NI_TClk functions seem to potentially match my requirements !

However, I tried revisiting the exemple code attached in the link you gave. My point was to make my NI-scope the master of triggering issues. (I want the reference timing to be the time when my scope detects a pulse from an external device).

 

I did not get any error message or bug when I ran my code, but definitely not any synchronization could be observed ...

 

Do you see anywhere I did something wrong/didn't do something I should have done ?

For the moment I suspect 2 issues :

1) Give the reference time information more explicitly in my code.

2) Maybe I did not use the timing functions properly/did not use the appropriate functions ...

 

Here is a screenshot of my actual code :

 

Trigger_with_delay_MyCode.PNG

 

Thank you for your help !

 

Kind regards,

Geoffrey

0 Kudos
Message 3 of 18
(5,388 Views)

Hi!

 

It would be great if you could post your code so I can do some adjustments. There are a few things I see but preferable I would like to look into everything.

 

Hope to hear from you!

 

Best regards!

0 Kudos
Message 4 of 18
(5,374 Views)

Hi Collin,

 

Here is my code (with the modifications I added to it today).

The first part of it calls a program allowing us to interact with our DUT, so it is not useful for you (I noted it in comment on the code).

 

Thank you for your help !

 

Kind regards,

Geoffrey

0 Kudos
Message 5 of 18
(5,370 Views)

Hi !

 

What I saw in your code is that you start the task twice, you have the NI tckl initiate and after that the NI fgen initiate generation. This will probably not work correctly. Also setting the minimum number of point after initiating will probably result in unexpected behavior. Please try to adjust this and see if it works.

 

I would also recommend you to build in some timing in your while loop. Otherwise this will consume all of your CPU usage.

 

Hope to hear from you!

 

Best regards,

Collin de Wit

0 Kudos
Message 6 of 18
(5,342 Views)

Hi Collin,

 

Here's my update of the code after taking your remarks into account and some remarks coming out of the cluster error. This lead me to this state of the code where I am a little bit confused : I am getting an error in the "TClk Synchronize.vi" :

 

niTClk Synchronize.vi:4910001<append>

 

... And that's all ! I haven't found what this error code means ...

Do you have any idea of what's now going wrong ? I keep on searching !

Thank you for your help

 

 

 
0 Kudos
Message 7 of 18
(5,308 Views)

Hi!

 

This can be caused by low memory availability. It would be great to know which version of labview you are using and is it the 32 or 64 bit version? Besides that are you writing any data to disk and can you see how much this data is within a certain time frame? If you are not doing any of this it would be great if you could send me your whole project.

 

Thank you.

 

Best regards,

Collin

0 Kudos
Message 8 of 18
(5,305 Views)

We bought a package with a PXI (Win 7 64-bits controller) and LabVIEW 2014 32-bits installed.

The vi I sent to you is the only one that's running while the error occurs, this is just a test vi I created to test the synchronization concept so it is out of any project...

 

Kind regards,

Geoffrey

 
0 Kudos
Message 9 of 18
(5,300 Views)

Hi!

 

I have researched a bit more and this is an unknown error. Please could you make a screenshot of the error so i could maybe look for more detailed information.

 

Hope to hear from you!

 

Best regards,

Collin de Wit

0 Kudos
Message 10 of 18
(5,257 Views)