06-29-2023 08:17 AM
Hello guys,
Here is a simplified example of my application.
The user has to answer the 6 questions and the 3 radio buttons comparisons. He clicks on the next button to go to the next step.
What I can't do: when the save button is clicked, I want to return to the Show Item1 (question 1) state, as shown in the image below.
How do I do this?
Thanks in advance
Solved! Go to Solution.
06-29-2023 08:26 AM
Hi ngouda,
@Ngouda wrote:
What I can't do: when the save button is clicked, I want to return to the Show Item1 (question 1) state, as shown in the image below.
There is no "save button" in your image…
On the other hand: when your Vi consists of a state machine then it's quite easy to go to the desired states!
06-29-2023 08:34 AM
HI GerdW,
It's normal that the save button isn't in my image.
The save button is available in the last question.
the image I sent is the first question. By clicking on the save button, I want to be able to return to question 1.
Have you seen my vi?
I guess it's easy, but I can't figure out how to do it.
06-29-2023 08:37 AM
hi
You just need to output the shift register to Show item 1.
Alternatively you can create another state called "Init" that is executed in the beginning of the program that "reset" all controls to a desired state then goes to "Show item1".
So when click SAVE it will direct to the "Init" state , reset everything and go to "Show Item 1".
The state machine diagram would look something like this
One suggestion: Replace "CANCEL" for "BACK"
06-29-2023 08:54 AM
I spent too much time trying to understand why/how you wrote such a complex "check the many boxes" hard-coded routine whose real workings I was having a difficult time understanding. I even tried running it, and couldn't figure out what I was doing and what you were measuring. But then I looked again at the title, and said "Oh, simply have the Save case put "Show Item1" back on the Shift Register, but LVNinja beat me to it. Kudos to the Ninja!
Bob Schor
06-29-2023 08:56 AM
Hi LVNinja,
thank you for your reply. Yes indeed it was easy, thank you very much for your answer, your explanations and suggestion...
It works as I wanted now.
When the stress is there, it's hard to see well 🙂
06-29-2023 09:04 AM
Hello Bob_Schor,
Thank you for your reply.
Is my code difficult to understand? I haven't coded well?
I'd like to know how to simplify it so that someone can easily understand my code.
If it was you, how would you proceed?
Thanks
06-29-2023 09:45 AM
The way you did it works ! that's what matters.
However if you are curious on how to make things easier, you can explore using TAB Control, then you add the controls on each tab. When you click "NEXT" you just change the tab that is visible, so no need to make the visible/invisible logic (that you brilliantly implemented btw).
It's a easy way to implement "wizard" type of user interface.
06-29-2023 10:16 AM
Dear LVNinja,
Thank you very much for your feedback 🙂
C'est gentil.
I'm going to read up on the use of TAB Control over the weekend.
Bonne soirée
Sincerely