LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP! Reset Temperature Values After Button Active for 3s!

Help!

 

Hello, I have recently started using LabVIEW at University, I am a complete novice.

 

I am required to reset the the minimum and maximum temperature values when the Celsius to Fahrenheit button is activated for 3 seconds. I have been playing around with Timer VI's but i cant get it working, any advice would be much appreciated. Please see screenshot below.

 

Is anybody able to send me a screenshot of something to fix my problem?

 

MBlair1234_1-1609418435320.png

 

0 Kudos
Message 1 of 4
(760 Views)

Hi MBlair,

 


@MBlair1234 wrote:

I am required to reset the the minimum and maximum temperature values when the Celsius to Fahrenheit button is activated for 3 seconds. I have been playing around with Timer VI's but i cant get it working, any advice would be much appreciated.


No screenshot, but some pseudocode:

 

IF button AND NOT(prev_button)  % detect rising edge
  start_time = current_time
ENDIF
IF NOT(button) and prev_button  % detect falling edge
  duration = current_time - start_time
  IF duration >= 3s THEN
    reset min/max values
  ENDIF
ENDIF
prev_button = button            % set prev_button for next iteration

 

See how far you get: you need just shift registers (for prev_button and start_time) and case structures (for IF-ENDIF)…

 

Suggestion: for a LabVIEW beginner I recommend to use shift registers instead of feedback node. IMHO they are easier to understand in term of DATAFLOW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(754 Views)

First you need to explain what "reset" means. Reset to what? (current temperature, some defaults, etc.)

 

There is no need to have the temperature in a shift register if you also have the feedback nodes. All you need is shift registers that contain max and min. They need to be initialized with -inf and +inf, respectively that will get reset, when your button is pressed for >3 seconds. For this to work correctly, you also need to change the mechanical action (e.g. to "switch until released")

0 Kudos
Message 3 of 4
(723 Views)

See if this can give you some ideas.

 

altenbach_0-1609441529772.png

 

 

other notes:

  • Use the chart digital display for the numeric indicators. Fewer terminals!
  • Don't label an indicator "degrees celsius" unless that's what it always displays.
  • As mentioned, use the correct mechanical actions for booleans.
  • You can remove the code going to indicators in (). They are just for demonstration
  • The elapsed time express VI is overkill to get current time for display
  • Please don no maximize the diagram window.
  • A meter is typically used as an indicator and a slide as a control. Now sure why you use them in opposite fashion.
  • A toggle switch is not an intuitive stop button
  • Use arrays and clusters to simplify the code
  • etc.
0 Kudos
Message 4 of 4
(700 Views)