LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Key Focus for String inputs are not working properly.

I made a VI which controls relays for operating motors. I have 4 relays and they can either be operated manually or automatically by entering time. The VI compares present time with enterred one and turns the relay off. 
I want a focus to create on string input for time for each relay whenever they are switched to automatic mode. By turning multiple relays to automatic mode, the key focus starts blinking and enters string at slow speed. 
I have a basic VI attached. Help required.

 

Regards,


0 Kudos
Message 1 of 8
(4,078 Views)

Your problem is your design.

If multiple controls are set to automatic then in each loop multiple focus events are generated (so the focus will switch between multiple controls).

You should be using an event structure to capture individual events and set focus accordingly...

 

Stripped down example you can work from:

 

 

Message 2 of 8
(4,065 Views)

Hi Philips,

I have another VI of same kind but with only two relays. Whenever we input something in any control, a check mark appears on the top left corner of front panel window indicating to update latest value. How I can use that pragmatically. I mean the user inputs time in string control and the press a small OK button for the changes to take affect. 

Regards.


0 Kudos
Message 3 of 8
(4,028 Views)

Sorry, I don't see the checkmark you are talking about. Can you explain what you actually want?

 

  • Why don't you combine the two case structures into one?
  • I would use a numeric control with a time format for the time input. This way the input is automatically checked for correctness. In your case, somebody could enter "the sky is blue" and there is no telling what the program would do with it. 😄
  • The booleans inversion exists in both cases, thus it belongs after the case.
  • Your loop needs a small wait. You are buring 100% CPU doing basically nothing.
  • For scalability, you could make the grouped control set into a cluster and use an array of such clusters for multiple devices of the same flavor.
0 Kudos
Message 4 of 8
(3,998 Views)

His logic manipulates each enum shift-register individually based on each Relay functionality so I don't believe he could combine the two case structures into one per his current implementation.

 

NapDynamite - your logic seems to be incorrect if you're meaning to implement a timer in a relative HH:MM format rather than in absolute time. I changed some logic of your Relay1 to see if that's what you were intending to implement. Other gentlemen already seems to have answered about key focus.

 

I believe the green check mark you mentioned shows when your vi is changed (such as on the disk but loaded version is different) - but I couldn't say for sure unless if you take a snapshot and show it.

 

-DP

 

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 5 of 8
(3,978 Views)

Sorry for late reply. 
Refer to figure below. Whenever I update (type) something in this string control, or any other control, a check mark appears over the top left corner of the front panel indicating to update latest value.

Untitled.png

 

 

 


How can I use this pragmatically. Or is there some basic programming technique I'm missing out? A help will be an opportunity for me to learn.

 

Regards.

 

 


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

string.jpg ?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 8
(3,904 Views)

@NapDynamite wrote:


Refer to figure below. Whenever I update (type) something in this string control, or any other control, a check mark appears over the top left corner of the front panel indicating to update latest value.

How can I use this pragmatically. Or is there some basic programming technique I'm missing out? A help will be an opportunity for me to learn.


That checkmark is an edit time feature. In order to accept the new value, you could:

 

  • Click outside the current control to accept the new value
  • configure the control to "limit to single line" and complete the entry with the <enter> key.
  • Set the control to "update while typing". Of course this is a mess, because you'll get malformed strings most of the time that the code needs to recongize as such.
  • Use a numeric control with a time format as I already suggested above.
0 Kudos
Message 8 of 8
(3,896 Views)