08-19-2014 08:40 AM - edited 08-19-2014 08:42 AM
so this was kind of a spur of the moment thing i decided to make a schedule builder its pretty simple to use and understand so i wont give an in depth detail just see the attached Vi please. one issue I'm hitting is that when i run it the Task description that goes into the individual cells does not stay in fact it come and goes and repeats. I think this is due to the 2 consecutive for-loop for indexing that I'm using but when i replaced that with just one for-loop other things just seemed out of place. Anyone have any ideas for how to fix this, always open to structural suggestions as well. 🙂
Thank you
08-19-2014 09:43 AM
Every time the loop iterates you write the Monday, Tuesday, ... array to Schedule. That overwrites any changes you have made. Moving that initialization outside the loop helps.
Some funny formatting seems to occur. Also setting the Start Time after the End Time has strange results. You may want to add some limit checking.
You also seem to have an aversion to straight wires. Makes it hard to see what is going on.
Lynn
08-19-2014 10:07 AM
It would be cleaner if it was in an Event structure. The flickering is distracting, and I could better understand what you are trying to do.
08-19-2014 03:23 PM - edited 08-19-2014 03:26 PM
Good idea to move the initialiazation of the table out of the loop that worked nice and yea i found the funky formatting you mentioned and ill have to look in to that more (i did however fix the cell alignment formatting by indexing through the whole table and setting each justification instead of the previous way where it just indexted thru the active cells. However I'm still having trouble. In the image below you can see that the last value of the Task box is imported inport into the next iteration of the loop (i think) so its carrying over that value into the next time i call the "run" case statement. I would think that by having this in the case statement it would prevent that fom running until the run button is pressed? Ideas?
I did consider using an event structure however my familiarity with them is subpar and i thought this would be easier pass variables between loops, as i plan on adding more features as i go such as the cluster of color indicators on the top, will be a key and ill be adding an export to excel function as well.
Thank you, Russ
08-19-2014 03:24 PM
and here is the semi-updated VI i could only attach 1 item at a time
08-19-2014 03:27 PM
Da-Coder wrote:
I did consider using an event structure however my familiarity with them is subpar and...
Then this would be a good problem to learn it then. Pretty much all GUIs should be centered around the Event Structure and it is a lot more expandable than passing variables around between loops.
08-19-2014 04:01 PM
Your attachments are missing....
I would make three points to help you learn.
1. Reinforcing what crossrulz said, learn to use the event structure for all GUI activity.
2. As your complexity grows, you will want to take care to only change the things you want to change and to preserve previous changes. A shift register may be helpful in avoiding local variables a Value property nodes. Both of those can introduce problems if misused.
3. Consider changing to a state machine architecture before you start adding features. A well planned and suitably implemented state machine is very robust and quite easily extended to add features. There are templates and examples with recent versions of LV.
Lynn
08-19-2014 05:40 PM
@johnsold wrote:
3. Consider changing to a state machine architecture before you start adding features. A well planned and suitably implemented state machine is very robust and quite easily extended to add features.
And plan out your state machine before you even write code. What I have been doing as of late is drawing up my state diagrams with Visio before I even touch LabVIEW. This has helped me so much and also adds to documentation so that you can go back in a year and figure out what you were thinking.
08-20-2014 03:14 PM - edited 08-20-2014 03:15 PM
so i took most of the advice 😄 and changed it over to use Event structures (Gold Gold Gold!) made it much simpler than repetative case statements, i even added one of the features i wanted already (Export to excel) but now im running in to a new issue that is puzzling me, so i run the first my first task and everything populates as it should, but then when i enter my 2nd task it replaces the the previous task's inputs before it....I looked and looked and i don't know where this is happening because i compared the logic with that of the previous version of the program (that worked and did not cover the previous task) and its all the same...any more ideas/tips for me???
attached is the newer vi but yesterday it wouldnt let me upload anything so i hope it works
---tried and its not uploading, am i missing something??? how do i upload???
Thanks, Russ
08-20-2014 03:27 PM
@Da-Coder wrote:
---tried and its not uploading, am i missing something??? how do i upload???
I normally zip up the project files and post the zip file. The forums seem to arbitrarily not like attaching VIs for who knows what reason.