LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How limit input string control?

Of course, all of these examples are moot since the poster originally asked how to do this without an event structure. Why that is I have no idea. Perhaps the poster has a lot of code that isn't easy to change, or perhaps it's a homework problem.
Message 11 of 18
(3,033 Views)

smercurio_fc wrote:
Of course, all of these examples are moot since the poster originally asked how to do this without an event structure. Why that is I have no idea. Perhaps the poster has a lot of code that isn't easy to change, or perhaps it's a homework problem.

Good point! On top of that they are using LV 7.1 so we can't use an XControl, so...

 

Pass a reference to a sub-VI that continually reads from a property >>> Value and checks the length, limits and write it back.

 

Use your favorite method for signalling shutdown.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 12 of 18
(3,029 Views)

smercurio_fc wrote:
Of course, all of these examples are moot since the poster originally asked how to do this without an event structure.

 

Well, there are reasonable requirements and silly requirements! 😄

 

If somebody cannot use the event structure, e.g. because he has only LabVIEW base, then this is a reasonable requirement.

 

If soembody does not want to use an event structure, then this request requires clarifications as to why. Possible reasons could be:

  1. This is homework and the teacher gave exact boudaries for the sandbox.
  2. The poster has unfounded eventophobia, wants to keep things simple and does not want to complicate life by learning new things.
  3. ...

 We don't really want to do the homework of somebody else, so that leaves #2. The best cure here is to ignore the request and show how much simpler code can be if an event structure is used. 😄

 

An event structure is not some esoteric, advanced feature reserved for LabVIEW saints. It is a fundamental component and should be used whenever user iteractions are handled. (I am just going over some of my old (pre-event structure!) code and replacing the UI parts with event structures easily cuts the code in half and makes it easier to read and debug.)

 

So, unless I hear a clear and good reason why an event structure cannot be part of the solution, I will always suggest an event structure! 😄

 

(If you say: "Let's do a walk on the beach, but I want to have my shoelaces tied together and spin a pizza over my head while doing so", I'll say: "I walk with you, but I'll just walk.")


smercurio_fc wrote:
Perhaps the poster has a lot of code that isn't easy to change.

There is nothing to change! That's the beauty of the event structure! All we need is to add my event loop so it runs in parallel to the main code. It can run completely independent of anything else on the diagram. In contrast, using any kind of polling solution would require significant code rework. 😉

Message 13 of 18
(3,009 Views)

I hear you, altenbach, and I completely agree with you, so you're just preaching to the choir. Smiley Wink

 

That's why in my initial response I asked: "And you don't want to use the event structure because?..." Unfortunately we have yet to hear from the poster, so we're just talking to ourselves. 

Message 14 of 18
(3,004 Views)

smercurio_fc a écrit: [...] That's why in my initial response I asked: "And you don't want to use the event structure because?..." Unfortunately we have yet to hear from the poster, so we're just talking to ourselves. 
At least we are sure somebody is listening 😉 😄 

 

Chilly Charly    (aka CC)
Message 15 of 18
(2,995 Views)

Should LabVIEW have a max string size property builtin?

 

Just a thought...

Message Edited by StevenATK on 02-11-2009 11:59 AM
0 Kudos
Message 16 of 18
(2,919 Views)

StevenATK wrote:

Should LabVIEW have a max string size property builtin?


Shane suggested fixed-lenght strings quite a while ago. Not quite the same, though. It seems you want a "data entry" properties page for string controls, where we can set the max lenght.

 

Not a bad idea. There is always the product suggestion center. 😉

 

Of course you could just make your own xcontrol that validates whatever you want. 😉

Message 17 of 18
(2,912 Views)

altenbach wrote:

If soembody does not want to use an event structure, then this request requires clarifications as to why. Possible reasons could be:

  1. This is homework and the teacher gave exact boudaries for the sandbox.
  2. The poster has unfounded eventophobia, wants to keep things simple and does not want to complicate life by learning new things.

Hmm I can not decide. Which type of Labview programmer do we love to hate most. The programmer with unfounded eventophobia, or the referenceophils type programmer Smiley Very Happy



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 18 of 18
(2,894 Views)