LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed sequence

Hello every one,

could some one could help me. i dont unterstand the timed sequence on this .vi

0 Kudos
Message 1 of 9
(4,094 Views)
What is it that you don't understand? How the timed sequence works, or how the code in the sequence works?

Also where will this code be running?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(4,069 Views)

both of them. I dont understand. please help me. also the code I sent

0 Kudos
Message 3 of 9
(4,059 Views)
Where will the code be running? PC, cRIO, what?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(4,048 Views)

on myDAQ

0 Kudos
Message 5 of 9
(4,040 Views)

my daq and pc

0 Kudos
Message 6 of 9
(4,035 Views)

The myDAQ is a LabVIEW device that you communicate with using LabVIEW drivers -- it doesn't strictly run LabVIEW code.  The code that you show runs on your PC.

 

You show two things -- a (single) sample of N points from N (2, apparently) Analog input channels, and a second timed sequence (which I've never seen used, nor have I ever used it, myself) that appears to toggle on, then off, a single digital output line.

 

Here's what I would expect to happen when you run this code.  You will get two N-element arrays in AI_1 and AI_O (note that you probably want to name that AI_0, zero rather than Capital O) whose value will depend on what is connected to the two inputs of your myDAQ.  The time it takes to do this will depend on the sampling rate you set in your Task as well as the number of points that you sample.  It is even possible that nothing will happen, as you don't appear to have started the Task (but it might be auto-starting).

 

I'm not as confident in predicting what will happen with the Timed Sequence.  I notice you did not wire any timing information controlling the first frame, so the timing of this will depend on the default values.  However, the timing might not be what you expect, as if these act like all other LabVIEW timing functions, they are "wait until", not "don't do until" functions.

 

So if (for sake of argument) the default was 1 tick of a 1KHz clock, and you wired in a period of 1000 (so a 1-second period), I would expect the Timed Sequence to behave as follows:

  1. You enter the first frame.
  2. You turn the Digital Output bit on.
  3. You wire 1000 into the next dt.
  4. You wait 1 msec, then enter the second frame.
  5. You turn the Digital Output bit off (in the second frame).
  6. You wait 1000 msec (= 1 sec), then exit the Timed Sequence.

Thus the Period that you wire in will have no effect on the timing of the On/Off sequence, only on how long it takes to get out of the second frame.

 

If what you want to do it to toggle the digital bit on and off, I would recommend using the Timed Loop and a shift register.  Wire the half-period into the dt input, and the initial setting (True) into the shift register.  Inside the loop, wire the signal on the Shift Register into the DO function, and also wire it to the right-hand Shift Register terminal, putting a Not operator in (to turn On to Off and Off to On).  If you want to do a single toggle (i.e. run through the loop exactly twice), you can test the loop index, "i", and if it is equal to 1 (meaning it has done the "0" and "1" case), wire this to the Stop terminal of the Timed loop.

 

Bob Schor

0 Kudos
Message 7 of 9
(4,024 Views)

OK, the first thing is to lose the timed structure. To begin with there is so much latency in the windows os that the "timing" is pointless. The other reason to not use the timed sequence is that on a PC you should never use sequences of any type, ever.

 

LabVIEW is a dataflow language. That means order of operation is defined by when data becomes available -- not some aribrary and artificial structure.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(4,003 Views)

thanks guy.

0 Kudos
Message 9 of 9
(3,976 Views)