LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI start event - does it exist

But concerning this one, I din't properly understand how to initialize values without any actions from user.

To be more clear, I want that once VI starts, the values X, Y, Z take values of X0, Y0, Z0 respectivel


 

I do not focus in your problem but about what you say in above i made this vi for you 

check it and tell me if it is what you point to solve 

0 Kudos
Message 11 of 17
(1,468 Views)

Hatef,

 

Thanks for VI.

Frankly speaking, I didn't properly understand how your solution matches my setup.

In my task there were 3 key points:

  • once VI starts, X, Y, Z get X0, Y0, Z0
  • during configuration phase (until button "START" clicked) X, Y, Z should follow X0, Y0, Z0
  • once "START" clicked, all user inputs aren't taken into account
0 Kudos
Message 12 of 17
(1,458 Views)

There is no such thing as "it is always better".  Try using "it is almost always better".

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 13 of 17
(1,431 Views)

pavel this vi want to show you how you can how to initialize values without any actions from user. for example if your start xzy is one of x0 z0 or y0 value in this vi the related frame will be initialize

0 Kudos
Message 14 of 17
(1,430 Views)

@paul_cardinale wrote:

There is no such thing as "it is always better".  Try using "it is almost always better".

 


I started off with that, but in this case the sequence structure served no purpose and with the exception of very few cases (e.g. for sequencing on FPGA, benchmarking) they shouldn't be in code (they are misused so much more than they are used effectively) so I decided to leave it as a hyperbole. I did also just say I 'discourage' it's use.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 15 of 17
(1,412 Views)

Sure; it's often good advice to avoid things that tend to be misused.  However it can sometimes lead people astray.

Many times I have seen things badly coded (sometimes very badly contorted code) because someone was strictly adhereing to a "Never do X" rule.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 16 of 17
(1,396 Views)

Yeah I would keep this much simpler, no need for events.

 

Just use a sequence frame or similar with a dataflow item out to the start of your application. Using a single frame and dataflow can avoid some of the overuse issues that concerned some posters. Or this can become the first state of a state machine but seeing as you already have this structure.

 

This is from one of my applications where I needed this easily and the main application didn't need a state machine.

init-variables-lv.jpg


Either way I would scrap the events, it is much more confusing to read the code and is unclear what your intention is if your not around to explain it

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 17 of 17
(1,382 Views)