LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing Data Point

I have written a program that constantly monitors the pressure from a transducer.  Once the pressure has stabilized the user can begin the record process which essentially records the data to an excel spreadsheet at different rates depending on whether or not the even has been triggered.  The event is determined by the pressure at the point when the record process began + a user defined slope, so when the initial pressure increases by this much begin recording at a faster rate.  To capture the initial pressure I'm using a for loop with an iteration count of 1 reading from the continuous pressure reading.  That value is then used in a formula node.  I'm getting an error saying that the left brace for the formula node is needed.  Is this because of the way I'm capturing that initial pressure value?  Thanks.....
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 1 of 6
(3,230 Views)


@MeCoOp wrote:
...To capture the initial pressure I'm using a for loop with an iteration count of 1 reading from the continuous pressure reading.  That value is then used in a formula node. 

I don't understand how you are "capturing" anything with a FOR loop. If it runs only once, you might as well leave it out. 😉 Please explain!!!
 
In any case, if you only want the last value from the FOR loop output, right-click on the ouptut tunnel and disable indexing. Now your formula error disappears. 🙂
 
A simple addition is better done with an ADD node from the numeric palette. Stick to wires, formula nodes are not that great in general.
 
(Also, why do you need two indicators for the continuous pressure? Just right-click on the gauge and do a "visible items...digital display". Now you have both in one. :))
Message 2 of 6
(3,219 Views)
Just replace your formula nodes by LabVIEW operators. The error is due to the fact that you are trying to add a single real value to an array. Laview Addition operator can do that directly, but using the formula node you would have to include the operation in a FOR loop !
Keep using formula nodes only for complicated operations with a few input variables, such as
z = 2 (sin(x**2)cos(y)+3 cos(x)sin(y**2))exp(x y)/(x y sin(x y))
that could be a nightmare with direct wiring.
Otherwise, LavVIEW standard operators are easier to use, more powerfull due to polymorphism, easier to debug and FASTER at execution.
 
As a true beginner, you should give some attention to basic programming principles with LabVIEW.
Keep your diagram tidy and compact, avoiding long wires and unnecessary bends and improve the diagram aspect by aligning objects. Read the manuals.
 
Chilly Charly    (aka CC)
Message 3 of 6
(3,217 Views)

You are getting the error because you are feeding the formula box with an array but have defined a scalar operation. I don't understand what you are wanting to accomplish with the FOR loop.

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 6
(3,215 Views)
Essentially with the For Loop I was trying to tell the program to read the value from the transducer at the instant the Begin Pressure Monitor button was activated and to store that value, to make that value static.  Thats why I have it set to an iteration count of one, hoping it would read it and store that value.  I also tried putting the field point read in the for loop with the same iteration count but it still continuously changes the value, I assume that as long as its in that case structure that will continue to occur.  So how do I save the initial value from the transducer once the Begin Pressure Monitor button is activated?
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 5 of 6
(3,193 Views)
Hi MeCoOp,

I don't know if I fully understand what you are trying to accomplish, but it sounds like you want the first (initial pressure) value to be used in all calculations, once it's acquired the first time. With your current code that will never happen since you are continuously writing new values to "Initial Pressure" when the "Begin Pressure Monitor" is TRUE. If you use "Highlight Execution" (the small light bulb) while your VI is running, you will get a good idea of your dataflow - you should see that the "Initial Pressure" keeps getting new values from outside the Case Structure.

To store the initial value and use it for the subsequent iterations, you could use a couple of Shift Registers on the edge of the While Loop to store the value. The reason that you need a couple of Shift Registers and not just one, is to keep track of if it is the first time the "Begin Pressure Monitor" has been pressed and if it's the first iteration of the loop. Here's a simplified example:



If this example doesn't relate to what you are trying to accomplish, please let me know why, thanks.

Have fun!

Message Edited by Philip C. on 08-03-2005 12:40 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
0 Kudos
Message 6 of 6
(3,177 Views)