PC-DMIS Tech Tip: This video demonstrates how to use CASE commands in a PC-DMIS program. These commands make it possible to switch between left hand and right hand part execution all within one program.
Click Here to learn more about our affordable Software Support Packages - the same group that makes these Tech Tips!
In this video, I'll be demonstrating the use of case commands and PC-DMIS. The case commands allow the programmer to isolate sections of a program and run them based on operator input. In my program, I have a left-hand and a right-hand part, and the execution of each is framed within two separate case commands. The input comment will prompt the operator to choose either left or right based on a number selection, either one or two.
In this example, the select "N" select commands are required to link the operator input to the appropriate execution. For this link to work, a number selection is placed to the right of each case command referencing the input comment selection. Finally, I'm using the default case and default case command to deal with an invalid operator input. I'll just quickly show you where to find those commands in the menu. Insert flow control command controlled pairs, and you can see them right there at the very bottom of the list.
Those are the three commands that I've used. Let's run this and let's see how it works. There's my operator comment, and you can see, I had the choice between one or two, so I'll choose one this time. That should be the left-hand part. You can see it's executing the left-hand part. Let's run it again. This time I'll choose the right-hand side, number two.
We'll run it one final time to choose the incorrect answer. Let's with, say, number four. I'll just click Okay and you can see now this is the default case at the end of my program. This may or may not have them but we need to account for that in our programming. I'll just say, "Okay," and it takes me back to the beginning where I choose the appropriate answer.
I just wanted to give you a quick overview of the case commands that are really handy tool and the PC-DMIS toolbox. I hope you found that useful. Thanks for joining me, and we'll see you next time.