01-17-2010 03:13 PM
Hi.
I'm building a motion system and facing some problem implementing it in LabView. I'll try to explain the problem the best I can.
Ii may be something very simple, but not for me, so please be patient 🙂
First of all i want to give user an option how much axes he wants to scan, so I created an enum
then according to what is chosen in the first enum i want that ONLY ONE of the (axes)/(axes 2) will be shown:
OR
i'm not sure how to make it, maybe somehow with property nodes?
Then we are going to the next issue. As i understand i have to use some case structure here and all it must be entered to the while loop structure so that user can switch it. But loop have to end somehow so i should enter some START button. BUT I also have other user controls in the UI and I want give user an option to go back and switch this enum after he made some other controls. So if I understand it right, the while struct with these enums have to run simultaneously(parallel execution?) with the other part of the code, until I press the general RUN button for example. I have no idea how to make it, and that is my biggest question.
Hope I expressed myself clearly enough, if not I'll try to explain it better 🙂
Thanks
01-17-2010 05:55 PM
You cannot change the enum's list at run-time. You have to use a menu ring. You can set the menu ring's items using property nodes.
Your next issue: A while loop will keep your program running until such a time as you stop it programmatically or you allow the user to stop it via some sort of Stop button. The easiest way to handle a user interface is to use an event structure (assuming you have the "Full" edition or higher). Examples ship with LabVIEW on how to use event structures. As far as a general programming architecture, I would suggest starting with a state machine. It's simple and very flexible. Depending on the level of complexity that you need you may want to consider a producer-consumer loop.
If you haven't already done so, you should look over the training material available. How to Learn LabVIEW.
01-19-2010 05:54 PM
Hi.
Menu rung does a great work here, thanks for that 🙂
About the second issue, i didn't really understand why and how to use event structure.
I used a while loop with the stop button:
Is it correct to make it that way?
Thanks
01-19-2010 08:43 PM