03-07-2014 09:23 AM
If you absolutely, positively have to do this the most inefficient way, you can do what your VI did - daisychain Select functions from the Comparison palette. It has every one of the disadvantages every one else has listed above. But it will work. So it is 100% possible.
Oh, and you have to convert your case selection criteria to one which a T/F selection can handle like you did, because the input is Boolean.
Otherwise, if you just want to be aware of what choosing other selections will do, you could use a case structure anyway, copy it for every case possible (but disconnected from your working VI), and put the whole set of copies inside a Disabled structure so it won't run but will be visible (sort of). Or you could print out the block diagram on paper. That will give you a picture for every potential case.
Cameron
03-07-2014 09:29 AM
@jcarmody wrote:
[..] I'd recommend against using LabVIEW with that kind of a request.
I'd recommend against using ANY programming language with that kind of a request.
That request might work in scripting environments with small "applications", but is an absolute no-go for anything else....
Norbert
PS: Just wondering, but April, 1st is still a bit away.....
03-07-2014 09:31 AM
Dear Jim,
It's our requirement means client requested like this. So, I'm getting the information like how many possibilities are there in LabVIEW.
So as I understood, it's quite difficult in LabVIEW without case structure in all the cases. (Like memory and execution speed).
My question is easy for text based programming languages (like Dennis_Knutson said).
Thank you so much for your support and Help.
BR,
Munna
03-07-2014 09:39 AM
@Munna232 wrote:
Dear Jim,
It's our requirement means client requested like this. So, I'm getting the information like how many possibilities are there in LabVIEW.
I think what people here are trying to say is: your customer is wrong. Very wrong. You should not build your program like this, and it is part of your job as the expert to convince the customer to change his requirements.
Even text based languages don't really do this for larger projects. Think of C. One of the powerful aspects of C is that you can break the code in to different files and then build a project from these individual components. When a programmer calls a function in a separate C file, someone doesn't have immediate access to the code. They have to go open up the other file, find the referenced function and read what it does.
03-07-2014 09:42 AM
Dear BowenM,
Thank you so much for your suggestion.
and your right
.......................
Still an aweful way to do it, but it will meet your requirements
....................................
I think that's one better solutions till now I got even though using case str for each case. Lets see this idea will work/not Beacuse here each case will give one result but finally we need only one result from all cases.
BR,
Munna
03-07-2014 09:43 AM
03-07-2014 10:55 AM
Sometimes part of our job is educating our Customers, Bosses and co-workers on LabVIEW
By definition, a If Then/Else structure in LabVIEW is a Boolean Case Structure.
If you where writing your code in C would you be able to
If X Then
{
If Y Then
{
}
Else
{
}
}
Else
{
If Y Then
{
}
Else
{
}
}
This is the EXACT equivalent in LabVIEW
You need to enlighten your customers.
As been pointed out above, without using case structure, all 100% of your code will run.
What if you were controlling a motor?
If X Then {run forward} Else {run reverse}.
Without a Case Structure, both the motor forward code and motor reverse code would run. What would the motor do?
03-07-2014 11:38 AM
It occurred to me that somebody doesn't want LabVIEW used on this project. I hope the same criterion is used when evaluating their favored language, perhaps: "All the code needs to fit on one screen so we can see everything without scrolling." ...or, something equally absurd.
03-07-2014 11:45 AM
Dear Omar,
Thaks for your reply.
...............................
What if you were controlling a motor?
If X Then {run forward} Else {run reverse}.
Without a Case Structure, both the motor forward code and motor reverse code would run. What would the motor do?
...........................
what about this idea?
BR,
Munna
.
03-07-2014 11:51 AM
Could it be your customer is confusing the case structure with the stacked sequence structure?