LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help (Getting stuck)

Solved!
Go to solution

Let's say there a number generator (Puts out only 0s or 5s) connected to a comparison element, which tests to see if a number is greater than or equal to 2.5. This will also put out numbers as quick as possible. (Atleast as quick as 1 microsecond).

Because what I'm trying to do, is make a sub-VI which takes in values, then if that number is greater than 0, it will pause the number generator, but resumes after a time delay (let's say 1 minute) after that number goes back to zero. 

I'm trying to mimic data from a DAQ device that stops acquistion when the value is not 0V, but continues after a time delay when that value goes back to 0V. With all this running autonomously until someone stops the whole process.

Also, is there anyway I should use event structures for this?

 

This relates back to a certain question I had earlier, but I've gone into a bit more detail.

The request to me:
I think what you are aiming to do is to use "events" in LabView. Basically, the slow phase lock has an "Abs Phase Noise" level that can be set in the software. There is then a voltage output from the computer (I'll call it the CEP noise voltage) that is 0V when the CEP noise is less than the level and 5V when the CEP noise is greater than the set level. The CEP noise voltage is only ever 0 or 5V and nothing in-between. You are going read this voltage with the aqciris computer and set up an event structure in the attostreaking code. The event structure will then pause the acquisition while the CEP noise voltage is 5V and resume it when it returns to 0V. You may want to add a time delay of a minute or two after the voltage returns to 0V or make the user press a button before resuming the acquisition to give you some time to check the CEP lock is ok.


Once again, thank you for your help.

 

0 Kudos
Message 1 of 16
(2,853 Views)

@Aseri wrote:

Because what I'm trying to do, is make a sub-VI which takes in values, then if that number is greater than 0, it will pause the number generator, but resumes after a time delay (let's say 1 minute) after that number goes back to zero. 
 


The easiest solution is a check with >0 connected to a case, and in one case put a 60000 wait. That might not act like you want, but it's what you describe. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 16
(2,833 Views)

Cheers I'll give it a go. 🙂

It's just they're fairly vague describing what they want from me so you can see my trouble. >.<

0 Kudos
Message 3 of 16
(2,831 Views)

The long wait will freeze stuff up until it's done, so probably it's better to store a start-value from the ms-timer and check periodically until it's passed 60k ms.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 16
(2,829 Views)

Do I put a while loop around this whole code? Within the case sequences though, for the True statement (If greater than zero) how can I configure it to pause the process untill that condition is met? 🙂

0 Kudos
Message 5 of 16
(2,828 Views)

Most all code will end up in some main loop. 🙂

You could e.g. check time in False statement as a start timer (as the first true will be right after the last f1alse, right?) and in the true subtract a check time from this false(start) timer. If > 60k, unpause. This will require shift registers to send values between loops.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 16
(2,824 Views)

This is so far from what I should have, but it's what I've got so far. I'm starting to get really worn out doing this and I've got to have something to show within a couple days. 😞

I should've taken a holiday before doing work experience, hahaha! (This is my first time using LABView, btw)

0 Kudos
Message 7 of 16
(2,798 Views)

@Aseri wrote:

(This is my first time using LABView, btw)


Actually, it is spelled LabVIEW....


@Aseri wrote:

This is so far from what I should have, but it's what I've got so far. I'm starting to get really worn out doing this and I've got to have something to show within a couple days. 😞


Instead of starting to write a program without any knowledge of LabVIEW, you should start with some tutorials first. Do that for a few days, then you will be able to solve the problem within minutes. You will still be done in a couple of days.

Looking at your code, there is really nothing there and it shows a complete lack of understanding of even the simplest progrmming basics. You generate a random number between 0 and 1 and check if it is greater than zero. This is more or less always guaranteed to be true. Then you use a case structure with both cases empty. Then you are running this loop as fast as the computer allows, millions of times per second. the speed will depend 100% on the computer hardware and what elese is running, and will be different at different times and on different computers. No predictability!  You cannot reliably run this with a microsecond loop time on a general purpose computer (e.g. under windows). Maybe you need LabVIEW RT or even FPGA.

 

It would also really be more useful if you could keep it all in one place instead of starting new threads, scattering the discussions. You already started here a couple of days ago.

 

Message 8 of 16
(2,780 Views)

Here's a slight improvement hopefully.

It's a simple indiciator that lights up whenever a value is greater than or equal to 2.5.

My question now is, how to I link that up to the stop button. So it automatically stops when that value is greater or equal to 2.5 (let's say if I were to start the value at 0 during run and moved it aboved 2.5 while it was running).

Thank you once again. :))

Download All
0 Kudos
Message 9 of 16
(2,719 Views)
Solution
Accepted by topic author Aseri

You event structure has no purpose. Delete it and change the wait to 50ms and you get the same outcome.


Aseri wrote:

My question now is, how to I link that up to the stop button. So it automatically stops when that value is greater or equal to 2.5 (let's say if I were to start the value at 0 during run and moved it aboved 2.5 while it was running).


Remove the stop button and wire the outcome of the comparison iteration directly to the conditional terminal of the loop. If you want to also keep the stop button, connect both by combining them with an OR function.

0 Kudos
Message 10 of 16
(2,706 Views)