LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbe question on dynamic data

Hi,

 

I am trying to display dynamic data from a DAQmx in 2 different waysI am new to LabView so I hope I am explaining this rightI have attached a .vi at the bottom to help explain my question.

 

I need to display dynamic data in two different waysI need dynamic data to be shown in the text indicator Numeric 2 or to be shown in the waveform graphI need to be able to switch between the twoEventually I will log data with the waveform graph but for now I just need to know how to get the dynamic data into different parts of my program

 

You can see I attempted to read the dynamic data into numeric 2 in the outer loop and then read numeric 2 in the inner loopI assume while the inner loop exicute the outer loop does not so numeric 2 is never updatedI also tried to create a new daq assistant pointing to the same DAQmx channel but that results in an error.

 

Ideally this will run as a state machine whereupon startingthe program will constantly read the channel and display it in numeric 2.  When the user hits start the waveform graph will be 

populated and that data will be recorded.  When the user hits stop the data will be displayed constantly in numeric 2 again.  Easy enough.

 

Please point me in the right directionsolving this problem will allow me to finish my first LabView program!

 

Thanks.

 

Kyle

 

 

0 Kudos
Message 1 of 12
(3,115 Views)

The simple way:

 

Message Edited by Dennis Knutson on 10-09-2009 09:39 AM
0 Kudos
Message 2 of 12
(3,102 Views)
Yep. To switch between the two, put them on two separate pages of a Tab control.
Richard






0 Kudos
Message 3 of 12
(3,090 Views)

Thank you!

 

Although I am not using the tab control as each of you suggested I was able to slap myself on the forehead and come up with a solution.  I have attached it below with a function generator so you can see how it works.  I sure you vet's will say, 'thats simple' but for some reason I could not come up with it on my own.

 

Thanks again for the help!

 

 

0 Kudos
Message 4 of 12
(3,072 Views)

Place the numeric in the false case. No reason at all for two different case statements. Even if you wanted two case statements for some wierd reason, the use of the local variable is just wrong.

0 Kudos
Message 5 of 12
(3,069 Views)

OK made the change.  Is that a style issue or a program issue.  Again, I am very new to all of this and have not havd the NI traing.  I don't really get how this style of programming works vs. a C/C++ or VB.NET program yet.

 

Thanks again.

0 Kudos
Message 6 of 12
(3,063 Views)

Now for some added fun on a Friday, use Property Nodes to Disable & Gray Out the indicators that are not currently updating. The Express VI as a loop latency timer is overkill also, just use the Wait (ms) function. You're doing fine, good luck.

 

 

 

Edit: I would recommend the book LabVIEW For Everyone. On Amazon and maybe at your bookstore.
Message Edited by Broken Arrow on 10-09-2009 01:34 PM
Richard






0 Kudos
Message 7 of 12
(3,059 Views)

Think of a simple case statement as an If/Else. What you did with two case statements was have

If button = True

   Write to chart

Else 

   (nothing)

If button = False

    Write to numeric

Else

   (nothing)

 

The second If/Else would not be required if you used the Else in the first to handle the false condition.

 

The local variable you had is a classic example of a race condition. Never use a local unless you really understand dataflow and how local violate this.

Message 8 of 12
(3,051 Views)

OKI get the IF/ELSE <--> CASE analogy perfectly.  Kudos!

 

If I should not use local variables how would I exicute a SWITCH type statement?

 

Or how would I store a number in memory and increment it with a button press?  How would I read it out later?

 

If this is in the documentation dont waste your time answering, I'll get to it sooner or laterI do not need a SWITCH for my current program, I am just curious!

 

Kyle 

0 Kudos
Message 9 of 12
(3,038 Views)

A select function on the Comparison palette gives you a simple either/or true/false function. 

 

To "store a number in memory" look at shift registers.  Place a number in a shift register, and it will be available in later loop iterations at the left hand side terminal where you can do what you want with it including incrementing it.

0 Kudos
Message 10 of 12
(3,036 Views)