LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay of function

Hello,

 

I am trying to figure out how to delay the start of a specific function in our school project VI.

 

The purpose of the VI (as it is now) is to send a character (1-F, hexadecimal) to the sequence structure and therefore getting our signal generator to send "4 bits" to a sensor via laser (we get the laser to blink with a liquid crystal cell). What should be sent for that character is decided by local variables in the sequence structure giving the signal generator "true or false".

 

So the problem is to get the signal generator part to wait the first time for the first local variable in the sequence structure has performed it's action and therefore decided if the value sent should be true or false to the signal generator. As it is now, they start att the same time.

 

Hope the explanation is not to vague.

 

All input is appreciated!

0 Kudos
Message 1 of 6
(2,658 Views)

Use an event structure, create a String Value Change-event, and in that event use Hexidecimal string to number, then number to boolean array, and then loop through that array setting the outputs (why do you have the same code in both cases?). So both your current loops are placed inside the event structure and inside a for loop. Does that make sense?

Similar to the attached code. (I changed some from this description when modifying it)

 

Quick change and suggestion, modify as needed

/Y.

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

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

Hi, and thanks for you input!

 

The code is the same because we set the values for the signal generators differently. One gives a frequency that makes our laser be able to pass through a liquid crystal cell and the other simply does not generate a signal (it could be empty but it seems to produce better results for the cell to have it not generate a signal).

 

So could we setup a event structure to react for when the first local variable activates (the on in the first frame in the sequence structure) and by that starting the signal generator?

 

I'm very new to labview, so that's why I'm experiencing some problems.

 

Thanks in advance!

0 Kudos
Message 3 of 6
(2,621 Views)
Don't use local variables and don't use a sequence structure. Learn dataflow - the very basic paradigm of LabVIEW.
0 Kudos
Message 4 of 6
(2,606 Views)

@Rydman wrote:

 

I'm very new to labview, so that's why I'm experiencing some problems.


No problem, the basics of LabVIEW are easy enough to learn, but changing your way of thinking with data flow can be a challenge.  Here is some free training.  If you get some free time you should go through some of them.

 

NI Learning Center

NI Getting Started

-Hardware Basics

-LabVEW Basics

-DAQ Application Tutorials

 

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

0 Kudos
Message 5 of 6
(2,592 Views)

@Rydman wrote:

Hi, and thanks for you input!

 

The code is the same because we set the values for the signal generators differently. One gives a frequency that makes our laser be able to pass through a liquid crystal cell and the other simply does not generate a signal (it could be empty but it seems to produce better results for the cell to have it not generate a signal).

 

So could we setup a event structure to react for when the first local variable activates (the on in the first frame in the sequence structure) and by that starting the signal generator?

 

I'm very new to labview, so that's why I'm experiencing some problems.

 

Thanks in advance!


Did you look at the code i posted?

In my example everything stats when String is changed, it interprets the hexadecimal number and creates a 0-1 array, which is then generating a pulsed signal of either 0 or 5 amplitude. 

As before this is fed as a waveform to the laser.
No sequence, no locals.
And no, you can react to a local variable. You could use the Value(change) property, but more correct would be to use a user event or a queue to start the generator, if you _really_ want to keep the other version.

/Y

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

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