LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve the timing A contain timing B in the same block diagram?

Dear ALL,

 

Hi there! I got 2 separated in the same block diagram which named digitaltask1 and digitaltask2, they both contain a wait node inside a loop for timing control. In order to make sure digitaltask2 work totally in the digitaltask1's high time, you can see the need is to change the timing analysis from equal to containing.(in the 1st picture, if we set timing A = timing B= 100ms, the next picture timing B should be contained in timing A)

 

Could anyone give me some suggestions on how to deal with it? What should I do to achieve the function? Thank you in advance!

 

Best,

 

Jason

equal.pngcontain.png

0 Kudos
Message 1 of 23
(2,799 Views)

If you'd like help with LabVIEW code, you should attach your LabVIEW VI so we can see what you are doing now!

Message 2 of 23
(2,781 Views)

Hi Jason,

 

I guess this is still related to your other threads about driving an external display using some DO lines…

 

You need to create your digital waveforms as needed:

- when B should rise AFTER A then you need to set B to TRUE one sample later than A.

- when A should fall AFTER B then you need to set A to FALSE one sample later than B…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 23
(2,779 Views)

Hi GerdW,

 

Thanks again! I learn a lot from you these days!

 

Yes, this question is linked to the design.

 

I understand your thought. Could you please show me a more detailed and specific introduction on how to do it usually in LabVIEW with DAQ?

 

Thank you so much!

 

Best,

 

Jason

0 Kudos
Message 4 of 23
(2,772 Views)

Hi Jason,

 

this is no DAQ question, it's just a matter of how you are preparing your digital waveforms BEFORE outputting them using your DAQ device…

 

Just create those waveforms as needed. In the worst case you prepare a spreadsheet file with needed data "manually" and load that spreadsheet. (Just to be clear: with "spreadsheet" I mean CSV files.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 23
(2,769 Views)

Just one quick precaution:

 

Your timing diagram shows some digital state changes happening on rising edges of the clock and others on the falling edges.  Standard NI DAQ boards don't support this kind of "either/or" polarity for sample clocks.  They'll only be able to generate new samples (and possible DO state changes) on one specific edge polarity.   You can pick rising or you can pick falling but you can't pick both at once.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 23
(2,752 Views)

Hi Kevin,

 

Thank you for your reply!

 

The more important part in this project should focus on sig1's high time contains sig2 as follows:

 

I am trying to achieve the follow function of B. The original one for now is A.

 

Could you give me some advice?

 

Thanks a lot!

 

Best,

 

Jason

 

AABB

0 Kudos
Message 7 of 23
(2,725 Views)

Hi GerdW,

 

Thanks for your reply!

 

1.May I ask how to prepare the digital waveforms BEFORE outputting them using your DAQ device? Are there examples or snippets for reference?

 

2.How to prepare a spreadsheet file with needed data "manually" and load that spreadsheet?

 

Many thanks!

 

Best,

 

Jason

0 Kudos
Message 8 of 23
(2,717 Views)

Hi Jason,

 

1.May I ask how to prepare the digital waveforms BEFORE outputting them using your DAQ device? Are there examples or snippets for reference?

 check.png

 

2.How to prepare a spreadsheet file with needed data "manually" and load that spreadsheet?

The same way I did with that boolean array constant in the image!

Create a worksheet in Excel, fill in 0 and 1 as needed, then save the worksheet as CSV file. Load the file using the ReadDelimitedSpreadsheet function…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 23
(2,712 Views)

Dear GerdW,

 

Thank you very much for your time!

 

What should I do if the Leitung 0 and Leitung 1 are separated timing control for data and scan1a? How can I send the prepared digital waveforms to the DAQmx Timing?

 

Many thanks!

 

Best,

 

Jason

0 Kudos
Message 10 of 23
(2,690 Views)