取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 16 条)
6,672 次查看
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 项奖励
2 条消息(共 16 条)
6,657 次查看
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 项奖励
3 条消息(共 16 条)
6,656 次查看

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 项奖励
4 条消息(共 16 条)
6,654 次查看
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 项奖励
5 条消息(共 16 条)
6,640 次查看
Hmmm... Can't open your VI either... could you repost in LV 7.1.1 please 吃惊表情 ?

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

Epictetus

Antoine Chalons

0 项奖励
6 条消息(共 16 条)
6,635 次查看

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 项奖励
7 条消息(共 16 条)
6,610 次查看
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 项奖励
8 条消息(共 16 条)
6,584 次查看

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 项奖励
9 条消息(共 16 条)
6,557 次查看
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 项奖励
10 条消息(共 16 条)
6,526 次查看