LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto press button

Hello.. I have a VI for my scale, and i need a autopress function, which automatically presses the button in every x minutes i can define it to. How to do that ? 

Best regards

Oesen
0 Kudos
Message 1 of 17
(4,447 Views)

How about a while loop with an elapsed time function?  You can OR the output with a front panel button.

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 17
(4,441 Views)

You need to be more clear about what you want to do. Are you asking how to simulate a user hitting a button on your front panel or are you asking how to write a LabVIEW application to actually push some physical button?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 17
(4,440 Views)

Use the Value or Value(signaling) property in a loop timed to your needs.

You'll need to change the mechanical action to switch instead of latch.

0 Kudos
Message 4 of 17
(4,436 Views)

@vt92 wrote:

How about a while loop with an elapsed time function?  You can OR the output with a front panel button.


This will only update the value. If you wanted to actually do some work as a result of the button press then you you would want to use an event structure and update the value using a property node with value signalling. However, there are better ways than that. A basic state machine would work. You wouldn't even need a button on the front panel.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 17
(4,435 Views)

This is what I meant:

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 6 of 17
(4,431 Views)

@vt92 wrote:

This is what I meant:

 


You don't need the elapsed timer. Simply use the timeout event on the event structure itself. Also, since the OP was asking about doing something repeatedly the "do something" code should be in the loop. Or in a separate task (producer-consumer architecture) and the event code would send a message to the consumer triggering the action.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 17
(4,423 Views)

I have uploadet my VI now.. I have i "measurement" button, which gives the measurement and the time in a array. I have to make a measurement in every x minutes or seconds. 

Best regards

Oesen
0 Kudos
Message 8 of 17
(4,417 Views)

 

 

 

 

Do not use two events strtuctures within a single VI. A VI should only have a single event structure. Also, since your code looks like it is identical make this a subVI. Then you can dynamically call them for as many scales as you need. You can also explicitly call it if you know the number of scales will always be the same. Rather than use the elapsed time VI I would recommend you use the timeout on the event structure itself. If you need to wait a long time (several seconds) just have the timeout event check to see if you have passed your time limit.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 9 of 17
(4,406 Views)

Thanks for the answers everyone. i also need a stopwatch to show the time in every measurement, so i have to use the elapsed time.. I so i must add a timeout event ?.. I made that program for a single scale, but the second scale is exactly the same type, so i copy/pasted the program and got two event structures. What is the disadvantage of having two event structures ?

Best regards

Oesen
0 Kudos
Message 10 of 17
(4,403 Views)