From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Validate user data collected in a cluster

I have an application where I need to collect something like 33 user values and save it to disk for recall. I am doing this with a cluster that embedds all the user entry fields as numeric controls. The user just tabs his way through the various controls and enters values.

The problem is to validate the user entries. Right now I have a big event structure that painfully goes through each  of  the values and uses an "In-range?" function  to set or clear a  "DataValid"  local variable that is used to pop a Message  (whew!)

What I would like is:
1. To pop up a fault message as soon as the focus shifts  from the field  that was just  edited and if it had a wrong value input.
2. Shift back the focus to  the field that had the wrong entry.

I tried something with 3  entires as a sample. But this one had to terminate the  VI upon detecting a wrong entry. ( LV7.1)

Any better and elegant ideas to implement this is welcome.

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 17
(2,844 Views)
Just righ-click on each control and set the correct valid data range, this way you don't need to validate and it will not be possible to enter out of range values.
Message 2 of 17
(2,841 Views)
Yes this way of using the native validation for numeric control is what we have done in many instances. But the only problem in this case is that the user is unaware of the coercion if he does not bother to look carefully ( and believe me most times they  don't bother ) after the change happens.

When tabbing furiously to enter 30 odd fields, the chances of entering a wrong value , have it coerced and proceed un-noticed is quite common. Reason why I was looking for a method to notify in case of a wrong entry. In fact  there was this practical case of  rpm entry in a pump endurance test set up. We had locked it between 500 to 3000 rpm even though the drive could go up to 6000 rpm. The user wanted to enter 3750 rpm, entered it and saved the form and of course the value was coerced to 3000 by LV silently. The test was run and  by the time they found out  the variance, it was more than a few thousand cycles.

Most of these edit forms are taken for granted and never re-checked once the user gets familiar with it. Unless you flash a dialog if he makes a mistake.

So my need still remains and I am also working to find out some ways to do it.  Have achieved it with "obvious" coding ( too big to post here as it is part of a large VI )  but looking for some "smart" way to do it.

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 17
(2,829 Views)

Just an idea...

You should verify that the cluster references order is always reversed (?). Further refinements should include string validation... but that's another story ! 🙂

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 4 of 17
(2,817 Views)

If you have LabVIEW 8.0, you can make and Xcontrol that can validate entries and e.g. light an LED, color the control background differently, or whatever if an input is out of range. There is no limit on what you can do. 😄

 

0 Kudos
Message 5 of 17
(2,810 Views)
The options in LV8 defenitley seem to address  my problem. Will check it out. Thanks.

In the meanwhile just to get what  I wanted by coding, I have been able to refine my earlier VI and get the result. It appears to do exactly my bidding in the limited tests that I did. Just check out.

Thanks for your help.

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 17
(2,800 Views)
Hello CC,

As my first VI sample that I posted, even this stops the VI when it encounters an error. I wanted it running and waiting for the user to attend to it.

And more than once I got an error with the "more specific class " function when running your VI - no time to analyse though.

Raghunathan

Message Edited by Raghunathan on 05-21-2006 08:40 PM

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 7 of 17
(2,804 Views)
I would recommend not to micromanage the order of checks and chop up the code into multiple frames of a sequence structure. Keep it simple!
 
Just use an event structure to validate all cluster values at once. I use a string indicator, but you could easily use a dialog box listing all values that are out of ramge at the same time.
 
Attached is one possibility.
Message 8 of 17
(2,791 Views)

Hi Raghunathan,

      I usually do as Altenbach has done, but I liked the immediate-message effect you described - here's one way to do it...

 

Cheers!

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 9 of 17
(2,788 Views)


Raghunathan a écrit:
Hello CC,

As my first VI sample that I posted, even this stops the VI when it encounters an error. I wanted it running and waiting for the user to attend to it.

And more than once I got an error with the "more specific class " function when running your VI - no time to analyse though.

Raghunathan

Message Edited by Raghunathan on 05-21-2006 08:40 PM


Well, the example provided was just an example. Here is a possible solution, more elaborated from the basic idea.

The advantage is that it works with cluster of any size since you don't need to declare each cluster element...

No "more specific class error" on my machines...

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 10 of 17
(2,778 Views)