LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

events

Hi All,
 
I work to develop an application that does some data acquisition and displays the data in a graph or chart. At this moment I have a While loop, an Elapsed time and a Cancel button. When I click on Run, the application runs, then it stops.
Now, I want to be able to change the scale of the graph/chart to either logarithmic or linear, after I performed the data acquisition. At this moment, I can only change between Linear and Logarithmic before I run the application, not after I've run it. I tried adding a second while loop around the initial one, but that doesn't do what I want  Any advice of how to do this?
 
Regards,
Nick
0 Kudos
Message 1 of 16
(4,000 Views)
Hi Nick

To change the scale between logarithmic and linear in runtime, use a property node of the graph and select the property "Y Scale > Mapping Mode". It takes 0 for linear and 1 for logarithmic mapping as input.
See attached example for one possible method if implementing it. You could also use an event structure for the boolean switch.

Hope this helps,
Daniel

0 Kudos
Message 2 of 16
(3,985 Views)
Hello Nick,

If you let you program run after the end of the acquisition, then you can add a bit of code to programmaticaly switch to linear or logarithmic scale.

Maybe if you post your code we'll be able to give better advice on how to do that.

Hope this helps

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 16
(3,984 Views)

Thank you Daniel for the sample VI. I made some changes to better reflect my case and I attached it in here. Titou, the VI attached in here will operate for a few seconds, then it will stop. The data is displayed in the chart, but I want to be able to switch the mode when after the elapsed time has completed, with the data already acquired. I suspect the application should still run in some kind of loop after acquiring the data.

Regards,

Nick

0 Kudos
Message 4 of 16
(3,982 Views)
I can't open your VI. Don't know why, no error message, it just won't open.
But you're right, you need another loop if you want to programmatically switch after acquisition has finished.
Because I can't open your VI, I modified mine again. It should give you the idea how this can be accomplished. The upper loop switches the mapping mode and waits for the user to stop the application. The lower loop simulates DAQ and terminates automatically at some point.

Daniel

0 Kudos
Message 5 of 16
(3,968 Views)
Hmmm... Can't open your VI either... could you repost in LV 7.1.1 please Smiley Surprised ?

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 16
(3,963 Views)

Thank you Daniel and TiTou. The VI that Daniel kindly provided again does what I was asking for. Now I try to do even more changes to it. Once the first data acquisition process has completed, I want to be able to restart it again, from within the application. I tried adding a new event and a button to reset my elapsed time component, but it doesn't work. I will attach in here the project saved as in version 7.1, maybe this time it can be opened. I got some warnings about missing some vi's, so not so sure it can be opened.

FormatTime String.vi
    Cannot save VI from VI.LIB to previous version.
subElapsedTime.vi
    Cannot save VI from VI.LIB to previous version.

Regards,

Nicolae

0 Kudos
Message 7 of 16
(3,938 Views)
Well, looks like you're missing some very basic (LabVIEW) programming concepts. The lower loop in your posted VI will terminate when either the specified time has elapsed or the user clicks the stop run button. So far, I think that's want you want. But once the lower loop has terminated, it won't ever start again as long as the VI runs. So you need to put another while loop around the DAQ loop which will decide whether to start again or finish.

0 Kudos
Message 8 of 16
(3,912 Views)

Hi Daniel,

I only start learning Labview a few weeks ago and I enjoy it. But I have some difficulty understanding how to use various structures and how can I do specific things. I appreciate your help. I tried adding another while loop around the lower loop in the application. As expected the inner loop is running now continuously. I am aware I need to set a condition to start/stop the inner loop, but I don't know how to do that. For you it might be very simple, but for me, at this stage it isn't. How can I put a condition to run the inner loop only once and then to wait until I press a button?

Regards,

Nick

0 Kudos
Message 9 of 16
(3,885 Views)
I enjoyed learning LabVIEW, too. I recommend you go through some tutorial to learn how the different structures work and to learn about the LabVIEW programming concepts.
See the attached VI for one possible way to implement what you need. There are several other possibilities to implement this functionality, e.g. by using notifiers/occurrences, putting everything in one loop, ...
But I hope you get the idea and see how it works.


0 Kudos
Message 10 of 16
(3,854 Views)