LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple case selection at a time

Hi jeet,

 


@User002 wrote:

i still did not get answer of it


You got answers - and a lot of questions!

 

Use 3 case structures in parallel when you need to handle 3 conditions in parallel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 37
(1,342 Views)

We are doing our best to guess what you are asking. I guess you actually don't mean "select" but "execute" or "call". The easiest is to make VIs of the code of each case and place these VIs on the block diagram. Then they will run in parallel.

 

Certified LabVIEW Architect
0 Kudos
Message 12 of 37
(1,324 Views)

I did the same before. im using visa read and write operation in each case so im getting error if cases are running in parallel so im asking the same question 

0 Kudos
Message 13 of 37
(1,296 Views)

2 options: 

 

1.) Take your n Booleans and convert them into a number, for thee Booleans this is manageable but for for large numbers of permutations becomes difficult.  Cases = 2^n where n is # of Booleans.

RHryniowski_1-1661183168324.png

2.) Have n separate cases, one for each Boolean.  Gets big on your code block if each case is complex.

RHryniowski_0-1661182988672.png

 

0 Kudos
Message 14 of 37
(1,295 Views)

Hi jeet,

 


@User002 wrote:

I did the same before. im using visa read and write operation in each case so im getting error if cases are running in parallel


It's the first time you mention "VISA read" in this thread, so don't blame us for insufficient advice!

 

Why do you need to place several VISARead calls in parallel? Just create the strings/commands you want to send to your device in all those cases/ case structures, build an array of those strings and use a FOR loop to send all strings one after the other!

 

Why do you insist on "running in parallel" when you already learned you cannot run those VISA calls in parallel?

Why don't you attach your VI so we can inspect your code and provide better help? (This would atleast help with interpreting your question as you tend to hide important information from us…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 37
(1,284 Views)

@paul_cardinale wrote:

@User002 wrote:

how to select mutiple cases at time? i have some cases such as case 0 case 1 case 2. i want to select some time indusually, some time 0,1 or 0,2 or 1,2 etc or all three at t time.. is it possible? 


You should never select anything "indusually"; that's way too cromulent.


Actually it's not cromulent at all!


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 37
(1,287 Views)

im attaching the Vis. in that in want to select all three cases at once or 1,2 or 2,3, or 3,1 (all combinations possible). i tried to make it(cases) parallel but getting error about visa read, sometimes getting same output or not any output for all the channels. 

looking forward to help. thanks 

0 Kudos
Message 17 of 37
(1,262 Views)

@User002 wrote:

im attaching the Vis. in that in want to select all three cases at once or 1,2 or 2,3, or 3,1 (all combinations possible). i tried to make it(cases) parallel but getting error about visa read, sometimes getting same output or not any output for all the channels. 

looking forward to help. thanks 


Unfortunately, not many of us are using LV2021 or 2022 yet, please convert the VIs to LV2019

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 18 of 37
(1,256 Views)

converted to 2019..

 

0 Kudos
Message 19 of 37
(1,252 Views)

Hi jeet,

 


@User002 wrote:

converted to 2019..


Finally some code…

 

Suggestion:

All code, that is the same in all cases, does not belong into those cases! Move "constant code" out of the case structure! (This will reduce your cases 1,2,3 a lot…)

Then we can discuss about your other/original problem: what is the difference between those 3 cases!?

For me they look the same, even their input clusters have the same values…

 

  • What's the point of the wait inside the "Send" event case? Events should be handled as fast as possible!
  • What happens when you press "Init" (incidently) twice?
  • There's no project file, and all clusters miss a typedefinition…

 

More suggestions:

  • Do you really need upto 5 (!) input tunnels for the very same value???
  • Do you really need to compare ">1.2" two times for the very same value?
  • Do you really need to convert a boolean value to TRUE/FALSE in the most popular Rube-Goldberg way (IF true THEN true ELSE false)???
  • Do you need to add zero?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 20 of 37
(1,242 Views)