Learn How to Write Labview Programs: Basic Help for Beginners

  • Thread starter Thread starter phrygian
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around learning how to write LabVIEW programs, specifically focusing on creating a signal that alternates between positive and negative ramps based on certain conditions. Participants are exploring programming techniques suitable for beginners, including variable storage and loop management.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses a lack of programming experience and seeks help in creating a LabVIEW program that generates a ramped signal with specific conditions for switching directions.
  • Another participant suggests using shift registers within a while loop to store values across iterations, indicating that this method allows for changing the direction of the signal based on certain thresholds.
  • A participant raises a concern about how to save a value for later use in the program without it being overwritten in each loop iteration, specifically in the context of changing voltage values.
  • One response indicates that using an array could be a solution for storing values, but notes that this would result in a new entry being added with each loop iteration.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the best method for storing values in LabVIEW, as different approaches are suggested, and concerns about the implications of these methods are raised.

Contextual Notes

There are limitations regarding the understanding of variable storage in LabVIEW, particularly concerning how values can be retained across loop iterations without being altered by new inputs.

Who May Find This Useful

Beginners in LabVIEW programming, particularly those interested in signal processing and loop management techniques.

phrygian
Messages
77
Reaction score
0
I don't have programming experience and I am trying to learn how to write labview programs.

I want to write a program that works like this:

I want to make a positively ramped signal that becomes negatively ramped once the difference between the current signal value and the initial signal value divided by the initial signal value reaches a certain value. The negatively ramped signal would become positively ramped again once it reached half the difference between the value where the signal switched directions and the initial value of the signal, and this process would repeat.

I have no idea how to do this without being able to store variables which I know you can't do in labview, can somebody help point me in the right direction?

Thanks a lot for the help
 
Technology news on Phys.org
The lines are variables, for carrying stuff through loops look up shift registers. Basically you can make a while loop that increases every loop then when it hits your valueit changes direction. I'll try to make a quick example when I get home, on my phone right now.

edit:

nevermind, seems my evaluation period has expired and all I have are my old 6i cd's and I'm not sure where they are. I'll try reinstalling later (I use labview for a LOT of stuff)

But basically just start with a signal value, like a double, that is your amplitue. Wire that to the edge of a while loop and right clcik on it and choose "add shift register". It adds an input/output for the while loop that contains the value that you put in the box.
Then just increment it each time by some amount, where the increment amount is multiplied by some IF where you have it so it does what you want, (multiples the increment amount by 1 or negative 1, etc.
 
Last edited:
The part that I am having trouble understanding is how do I save a value to be used later in the program without that value being changed every time the program loops? For instance, with the voltage changing, how can I save certain values of voltages to be used later if there will always be new values flowing to whatever position I want to save them at?
 
An array is your only option then, but it'll add a new entry for every time it loops.
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
Replies
69
Views
11K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
19
Views
4K