LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

part one to be executed and after certain time part two to be executed

I will put your requirement in a better way. You have two loops and you want to start the loop2, after 10s of execution of loop1. 

 

A simple solution would be to notify loop2, once the threshold time is reached in loop1. Check out the attached code.

 

Thanks,

Satish

0 Kudos
Message 11 of 28
(524 Views)

Hi Satish,

Thankyou for the Reply.

Your reply surely helps.But I'm stuck with a wierd problem now.

I've attached my code in the previous post, could you please let me know why am I not getting any output from the loop 1, (I'm trying to output a pulse from the loop1)

 

Thankyou

Regards,

Divya

0 Kudos
Message 12 of 28
(519 Views)

Hi Divya,

 

Can you be more specific? Which is your 1st loop and point out the corresponding waveform indicator. I see only 1 independent for loop (it has a for loop inside).

 

If you are talking about the waveform connected to DAQ box outputs 2, that is because, you are creating an array with 5 as the constant element. Hence, your waveform will be a single line, like a DC voltage

 

Satish

0 Kudos
Message 13 of 28
(511 Views)

Hey Satish,

Yes I was talking about the same waveform. Here, I created a waveform with 2 elements( 0 and 5), So it should not be a constant DC waveform right?

 

Divya

0 Kudos
Message 14 of 28
(504 Views)

Hi Divya,

 

No. You are wiring 5 for all the iterations. There is a simpler way to do thisSmiley Wink. Use the 'Get Pulse Pattern' from Signal Generator palette. Refer image.

 

Satish

0 Kudos
Message 15 of 28
(500 Views)

Hey Satish,

Thankyou.I'll try this..

But in my Make waveform.vi , I tried outputting value 0 for the first few seconds and looped it in a for loop.. and hten value 5 for the next few seconds and looped it too in the for loop and then followed by 0 again and a 5.. So where exactly are you saying that I'm outputting a single constant value 5??

 

Thanks,

Divya

0 Kudos
Message 16 of 28
(495 Views)

@Patricia B wrote:

Hello,

 

My suggestion would be to perhaps use a sequence structure with the Wait (ms) Vi in the first frame and the loop that needs to wait 7 secs in the second frame. Below are some articles that discuss the sequence structure and the Wait (ms) VI:

 



I'm very surprised to see a NI employee suggesting this as a solution. I would expect that NI suggest using best practices and proven architectures for solutions. There is a long list of reasons to avoid using sequence structures. A state machine architecture would be the preferred method. State machines are much easier to maintain, extend and control than sequence structures.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 17 of 28
(485 Views)

Hey Satish,

This is what I've tried with the Pulse pattern.Vi .But when I run it for a single time, I dont see an oputput on my scope again! 😞

 

Attached Code .

Regards,

Divya

0 Kudos
Message 18 of 28
(480 Views)

Hello Diya,

 

For clarification purposes, would you mind posting a screenshot of the portion of your VI that you are referring to as the 'first part' highlighted in some way?

 

Thanks,

Patricia B.

National Instruments
Applications Engineer
0 Kudos
Message 19 of 28
(462 Views)

Divya,

 

I'm getting a crank waveform with output2.vi. The waveform graph indicator is showing the same. Check whether your scope is in the propper settings. A triggered acquisition would be the best.

P.S : Since , I didn't have a random period.vi, I used my own values. But that doesn't have anything to do with your issue.

 

Satish

0 Kudos
Message 20 of 28
(450 Views)