LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure problem...



This code is an absolute nightmare, with all these stacked sequences. Where did you get these ideas?????

  Why is it a nightmare? Is it becuase it does not look pretty?  I am in my 3rd week of learning LV. This code works though.  The ideas are mine.

0 Kudos
Message 11 of 36
(1,359 Views)
0 Kudos
Message 12 of 36
(1,355 Views)

And here's where we told you why to avoid them for the same code:  HERE

And again here

... for again the same code... 😉

Three threads for the same code and similar comments about the code... 

 

0 Kudos
Message 13 of 36
(1,349 Views)


RSibagatullin wrote:


This code is an absolute nightmare, with all these stacked sequences. Where did you get these ideas?????

  Why is it a nightmare? Is it becuase it does not look pretty?  I am in my 3rd week of learning LV. This code works though.  The ideas are mine.




Has nothing to do with looking pretty.  It's a bad practice. 

To repeat myself, this is why you should use a state machine instead of stacked structures:

Some of the benefits are:
 
Maintainability:  code easier to read and easier to debug.  it is possible to "see" what values are actually passed to & from each state.  You can use shift registers to "store" values.  You can wire left to right.  You can use the error cluster easily.
 
Scalability:  you can add more functionality which may not be restricted by a static sequence of events (as compared to the stacked structure).  You can use TypeDef controls which allow you to add more states easily. 
 
Structure:  you can return to certain states by defining the state transition.
 
to name a few!!
 
Maybe your code works today, but it may not tomorrow.  We're trying to save you some anguish..  But it's your choice.. 
 
RayR
Message 14 of 36
(1,340 Views)
Joe I agree with you. I just read a link on state machines from NI. I just did not know of state machine use in LV when I started this first LV project. My next LV project will definetly use the state machine architecture but not this one because it is too late for me already. Smiley Happy
0 Kudos
Message 15 of 36
(1,331 Views)
New question;
So as you can see I have table called "Experiment scenario" . Is it possible to dissable user access to certain columns of this table via code?
Another question is that is it possible to make the user able to copy and paste a row into another row from the same table? As if right now the table from the my GUI allows to coppy and paste only on cell by cell basis.
Thanks.

0 Kudos
Message 16 of 36
(1,318 Views)
Could someone help me out with coppying and pasting from a table the whole row  using a mouse?  Just like in Excel.
0 Kudos
Message 17 of 36
(1,280 Views)

 

There must be better ways, by my 2 cent quick fix.....is to manage it with Event structure/value change…

And have a case structure in it, so that if new and old values in “disabled” rows/columns are different, you can take the old value instead of the new ones.

About copy and paste...do you want to achieve the action during run-time by the user or do so programmatically/code?

 

0 Kudos
Message 18 of 36
(1,275 Views)
I took care of the disabled cells by restoring them immideatelly if there is a change Value event.
In regards to copy and paste a row I want the user to be able to copy and paste a row using mouse from the table on my GUI during run time.
Thanks

0 Kudos
Message 19 of 36
(1,271 Views)

I do not know how to paste the entire row like excel. But like everything, LabVIEW has a workaround that works (at least for me).

 

This is a sample code for my LV 6.i application that would select the entire row. Hopefully you can use it and modify it to your needs to select the desired values.

 

Once you have it, you can have a Boolean and event structure to manage the copying/pasting action of the selected row.

 

Best,

 

Santiago

0 Kudos
Message 20 of 36
(1,266 Views)