LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FP table updates then empties?

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

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 1 of 22
(3,400 Views)

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

 

schedule.png

0 Kudos
Message 2 of 22
(3,370 Views)

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.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 22
(3,355 Views)

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

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 4 of 22
(3,334 Views)

and here is the semi-updated VI i could only attach 1 item at a time

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 5 of 22
(3,333 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 22
(3,326 Views)

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

0 Kudos
Message 7 of 22
(3,315 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 22
(3,307 Views)

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

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 9 of 22
(3,273 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 22
(3,264 Views)