LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested If and else without case structure

Hello All,

 

Lets talk about this.

 

In my project I dont want to use Case Structre/Stacked str for Nested If else conditions.

 

I think we can use Selector for this. Yes I know it's quite complicated solution but i want to these kind of alogrethims (PFA).

 

could you please tell me how much possibility (%) is there in LabVIEW without using case structure to implement any kind of logics.

 

Thanks & Regards,

Guru

 

 

Munna
0 Kudos
Message 1 of 45
(3,397 Views)

Hi Guru,

 

could you please downconvert your VI to LV2011?

 

Why don't you want to use Case structures at all? Is this some kind of arbitrary limitation?

Best regards,
GerdW


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

Dear GerdW,

 

Thank you so mcuh for your reply.

 

As per my cleint request I can't use Case structre so I'm searching for better solution to solve my problems.

 

Please help me.

 

Thanks & Regards,

Munna

Munna
Download All
0 Kudos
Message 3 of 45
(3,365 Views)

http://notalwaysright.com/

 

You've been hired as the expert.  Take a shot at convincing them that avoiding Case structures is silly. 

 

Perhaps they're using an older version of LabVIEW with a license that doesn't include Event structures and they've mistakenly proscribed Case structures?

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 4 of 45
(3,360 Views)

Dear Jim,

 

We are using LabVIEW 2012.  Sometime I used Case Str and Event structures.

 

Now I'm trying to Avoid these. I want to know what is the problem if I'm using Selecor instead of Case Structure in all the cases.

 

BR,

Munna.

 

 

Munna
0 Kudos
Message 5 of 45
(3,351 Views)

Hi Munna,

 

there is no "problem" to use Select function in favor of Case structure.

 

It just produces bigger block diagrams, produces (sometimes) harder to read (and maintain) code, - and it's just silly to not use an elementary programming structure offered by the IDE…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 45
(3,347 Views)

Dear GerdW,

 

Thank you so much for your support as always.

 

Yes, you're right. it's quite difficult to maintain the code if no. of cases are more.

 

I think we can use Selector instead of case structure for all the cases.

I mean,  case-1 Read the Text file case-2  Read and write to text file case-3 some String operations etc.

 

 

BR,

Munna

Munna
0 Kudos
Message 7 of 45
(3,342 Views)

Hi Munna,

 

the difference between a (proper) Case structure and your "Select" approach is:

in a Case structure only the code in the selected case is executed. When using Select instead all the time all code has to be executed (THINK DATAFLOW)!

 

So decide on your own if you want to refuse from using Case structure…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 45
(3,337 Views)

Think of a statemachine running without case structure...... *shudder*

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 45
(3,329 Views)

Dear GerdW,

 

You're correct.

 

I think execution time also will get increase with Selector approach (If cases are more).

 

Now, we are not thinking about how many cases executed/ time. Just I want to know how much possibility is there if I'm using Selector to implement any kind of Logics.

 

BR,

Munna.

Munna
0 Kudos
Message 10 of 45
(3,326 Views)