LabVIEW: Need help figuring out programme flow

  • Thread starter WWCY
  • Start date
  • Tags
    Flow
In summary, the conversation discusses the use of a FOR loop in a LabVIEW code. An array called Vsource is passed into the loop, with each iteration taking in one element from the array. The element is then input into a DAQ Assistant, which is connected to a circuit. Simultaneously, the element is passed into a "minus" function. From another DAQ Assistant, a measurement value called Vresistor is output as a dynamic data type. This value is confusing, as it is a single scalar that corresponds to the single element in Vsource. The Vresistor value then flows into a "minus" function and a data conversion function, where an array is output from both. The questions raised are regarding the output
  • #1
WWCY
479
12
Hi all, I'm having some trouble trying to figure out how the FOR loop is working for my code (attached below). I'll try to describe what I think is happening so that I can be corrected. Thanks in advance! I have only been using LabVIEW for 3 days, so I'd appreciate if explanations aren't too technical.

1. To the left of the FOR loop, an array (call it Vsource) is passed into the loop. The loop takes in one element from Vsource per iteration. I'll try to consider what goes on in each iteration
2. The element goes through into DAQ Assistant 1 where it is input to the apparatus (some circuit).
3. The element simultaneously flows into the "minus" function
4. From DAQ assistant 2, a measurement value (Vresistor) is output in dynamic data type. This is where I get confused. I'm supposing that this value for Vresistor is a single scalar that corresponds to the single element in Vsource.
5. This Vresistor value flows to a) the "minus" function and then to a data conversion function, and b) straight to a data conversion function. In both cases, somehow an array is output from the data conversion function.

My questions are:
a) If I am right and DAQ2 does output one scalar per iteration, why is the converted data type a double array, rather than a double scalar?
b) If I am not right...what exactly is happening?
Screenshot 2019-04-15 at 2.03.59 AM.png
 

Attachments

  • Screenshot 2019-04-15 at 2.03.59 AM.png
    Screenshot 2019-04-15 at 2.03.59 AM.png
    26.8 KB · Views: 505
  • main.jpg
    main.jpg
    45.6 KB · Views: 310
Physics news on Phys.org
  • #2
Is it possible that given an input value the circuit being measured will output a time based array of double values? And you can either use then or select the last value for your for box?
 

1. How do I create a basic LabVIEW program?

To create a basic LabVIEW program, start by opening the LabVIEW software and selecting a blank VI (Virtual Instrument) from the "New" menu. Then, begin by adding input and output controls, such as buttons and indicators, to the front panel. Next, add the necessary code blocks, known as "nodes," to the block diagram to define the program's functionality. Finally, run the program by clicking the "Run" button.

2. How do I control the program flow in LabVIEW?

To control the program flow in LabVIEW, use structures such as "For Loops," "While Loops," and "Case Structures." These structures allow you to perform specific tasks repeatedly or conditionally based on user input or program logic. You can also use the "Sequence" structure to execute code sequentially or the "Event Structure" to handle user events, such as button clicks.

3. How do I debug my LabVIEW program?

To debug your LabVIEW program, you can use the "Highlight Execution" feature, which is available in the "Tools" menu. This feature allows you to see which parts of your code are being executed as the program runs. You can also use the "Probe" tool to view the data values at different points in your program. Additionally, you can use breakpoints to pause the program at specific points and examine the data values.

4. How can I troubleshoot errors in my LabVIEW program?

If your LabVIEW program is not functioning as expected, there may be an error in your code. You can use the "Error List" window to view any error messages, which can help you identify the issue. Additionally, you can use the "Execution Highlight" feature and other debugging tools to pinpoint the source of the error. It is also helpful to refer to the LabVIEW documentation or seek assistance from other LabVIEW users.

5. Can I use LabVIEW for data acquisition and analysis?

Yes, LabVIEW is commonly used for data acquisition and analysis. It has built-in functions and tools for acquiring data from various sources, such as sensors and instruments, and for analyzing and visualizing the data. LabVIEW also has features for saving and exporting data in various formats. There are also many add-ons and toolkits available for more specialized data acquisition and analysis tasks.

Similar threads

  • Programming and Computer Science
Replies
29
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • Programming and Computer Science
Replies
1
Views
943
  • Programming and Computer Science
Replies
1
Views
646
  • Biology and Medical
Replies
7
Views
2K
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Classical Physics
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top