04-27-2018 12:00 PM
05-16-2018 04:20 AM
Hello Guys,
I am sorry to restart this discussion but I encounter an issue in my program.
I explain my step:
1/ I am in my state machine and when I launch the program, I have no problem for the moment.
2/ I push to button "Go to sinus" and all is fine
3/ I change the number of "total loop" : 50 to 100 and I repush to button "Go to sinus"
4/ I push the button "clean graph" and I repush to button "Go to sinus"
AND NOW I have my PROBLEM !
In the graph, it plots 0 to 50 then 0 to 50 but I want to plot 0 to 100.
Do you know why I have this issue?
Sincerely ,
Ngoc-Vinh Truong
05-16-2018 06:00 AM - edited 05-16-2018 06:00 AM
Hi Ngoc,
Do you know why I have this issue?
Yes.
You only clear two of your three shift registers/feedback nodes.
An error you easily can detect when debugging your own VI!
05-16-2018 06:13 AM
My BAD !!
I laugh about my problem. Indeed, when I see your answer, it seems like I am an idiot now .
Nevermind, thank you very much ! Have a good day ! 🙂
05-16-2018 04:31 PM - edited 05-16-2018 04:38 PM
I find it a lot easier to put X/Y graphs in a sub-vi and treat them as an "Action Engine".
The XY graph sub-vi holds its own history internally and even saves its data and restores it to the chart if the program is stopped and restarted.
I attached an example of one of my graphs from a program that monitors a grid tie solar power system.
The Sub-vi takes in an array of measurements and a command (Initialize, clear, write, and restore), its output indicator will be updated whenever the vi is ran.
Look how much neater my main block diagram is since the graph history shift registers are inside the sub vi's.