LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elements with Bundling for Timestamp

I am currently in LabVIEW attempting to build a dynamic array that shows a random element based on a multiplier times 10, and the Date string w/ the Time string.

I am using a while loop to constantly update the values with shift registers to keep track of the iterations. Also, a boolean toggle for my switch. But, I am very lost. I plan on finishing and then connecting this to excel. Any pointers, or discords where i could get some help.

 

 

 

 

 

 

0 Kudos
Message 1 of 3
(144 Views)

If you place your indicator inside the loop, it will update with every iteration. If it is after the loop, it will only update once the loop has completed. Dataflow principle!

 


@thejohnwithdoe wrote:

Also, a boolean toggle for my switch. But, I am very lost..


A switch is a poor choice for a loop condition. Use a latch action button.


@thejohnwithdoe wrote:

I plan on finishing and then connecting this to excel.


Define "connecting".

 

 

0 Kudos
Message 2 of 3
(123 Views)

You need to learn some basics about LabVIEW.  Here are some questions and suggestions:

  • When the program starts, do you have an existing array to which you want to append new values once every 3 seconds, or do you want to generate a new array (from scratch, so to speak) at one value per 3 seconds?
    • In the first case, you code "kind of" makes sense, with the initial array brought in through a shift register and you append new values inside the loop to update the shift register.
    • In the second case (which makes more sense), you generate the new element (10 * random number) and output it through an indexing tunnel which builds the array for you.  [The indexing tunnel symbol is an open box with a pair of array braces, "[]" (the two keys to the right of "p" on my keyboard)].
  • Boolean Controls have "Mechanical Actions".  By default (it's a long-standing LabVIEW convention, one that the User can modify, but probably shouldn't), the first nine or so Controls on the Boolean Pallet have a "Switch when pressed" action.  You push it, it changes state, Off to On, or On to Off.  The three rectangular Controls labeled as "Buttons" have (by default) "Latch when Released" -- it changes when you push it, but when you "let go" of the Control, it "stays pushed" until it has been read by your LabVIEW code, at which time it returns to its default value.  [I underlined this because when I started learning LabVIEW, I thought it "returned to False", a subtle difference that caused me some grief until I read the Help description more carefully].
  • The three basic ways to get data into a Structure (like a For or While loop) are a Shift Register, Tunnel, and Indexing Tunnel.  While Loops usually use Shift Registers and Tunnels, For Loops usually use Indexing Tunnels.  Note the word "usually".
  • Do the following exercise -- create a While (or For, or both) loop and pass an Array into it.  Drag a wire from the Input tunnel to an Output tunnel.  Right-click on the Output tunnel you just created and examine the "Tunnel Modes" that are shown.  Make sure you understand all the options listed.

This should help you to Learn LabVIEW.

 

Bob Schor

0 Kudos
Message 3 of 3
(55 Views)