You are here

Multicase Selection

26 July, 2019 - 09:47
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/5b6e61df-b830-48cb-9764-94696cb47c80@1.3

Select an Integer 32 numeric input and an Integer 32 numeric output and label them Selector and Case respectively.

media/image11.png
Figure 5.10 Multicase GUI  
 

In the Block Diagram window, create a case structure, select the False case and arrange the terminals as shown in Multicase.

media/image12.png
Figure 5.11 Multicase  
 

Wire the Selector numeric control to the case selector on the case structure. The selector label reflects the diagram update.

media/image13.png
Figure 5.12 Multicase Selector 
 

In the0, Default case, add a numeric constant and leave its value as 0.

media/image14.png
Figure 5.13 Default Case 
 

Using the selector label, select case 1. Add a numeric constant, enter 1 and wire it to the case tunnel. The resulting diagram is shown in Case 1.

media/image15.png
Figure 5.14 Case 1 
 

Right click anywhere in the case structure and selectAdd Case After from the pop-up menu.

media/image16.png
Figure 5.15 Adding Cases 
 

Case 2 is added after case 1. Add a numeric constant, enter2 and wire it to the case structure tunnel.

media/image17.png
Figure 5.16 Case 2 
 

Multicase Selection Program shows the results of running this simple case selection programs for Selector set to 0, 1, 2 and 3 respectively.

media/image18.png
Figure 5.17 Multicase Selection Program