LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

about enums

@tbob Thanks for the reply.... but can u please down convert it into Labview 9 or Labview 8.5. i am not using Labview 10. i could not open the Vi.
0 Kudos
Message 21 of 32
(2,450 Views)

Hi LabVIEW guys,
I am a new bie for labVIEW.Smiley Wink
I tried to write the solution for this question... Please throw your comments and feed backs on my source code..
help me on optimization on this code:
i want to merge bot the for loops used in my code in to a single loop. But i felt little tough to do this task.
please provide the information or clues to do this
To improve labVIEW coding style, please give me suggestions.... Thank you.

 

Message 22 of 32
(2,432 Views)

@Electro SAM

thank you very much.i have tried alot for it.i am really thankful to you.

thanks for all who gave me their valuable tips and replies.

0 Kudos
Message 23 of 32
(2,421 Views)

@Electro SAM

what u have posted is working properly,but cant we do it without ' Typedef ' ? and in your vi if "NA" is present at Controller1 and any channel is chosen from controller2 , the chosen channel from controller2 is disabled in controller1, which should not happen. in the corresponding controllers only it should get disabled (i.e from controller 3 to 8).

0 Kudos
Message 24 of 32
(2,411 Views)

mohansagar,

 

It could be done without making the enum a typedef, but using the typedef is the preferred way.  By using a typedef you are assured that all the controls are identical.  If you need to change or add an item, you only need to change the typedef and all the controls and constants derived from it are automatically changed. For your present application this may not be a big factor, but when an enum is used for the state of a state machine, changes often occur and this becomes very valuable.

 

ElectroSAM,

 

Nicely done.  You should wire the error in to the error out in the Error case so that whatever error occurred will be passed to the output.  The Use Default if Unwired option on case structures should be used with great caution.  Many experienced LV programmers prefer to turn that option off.  The only place I routinely use it is (as you did) i the Stop: Value Changed case of an event structure.

 

Another way to get the enum references is to take a reference to the Input Cluster followed by a property node to obtain the array of references to the controls within the cluster.  You need to a To More Specific Class function to get access to the enum properties.  This is not necessarily better, just another tool.  It can be extended to gain access to any control on the panel.  Search for Ben's Nugget on control references for much more information.

 

Lynn

 

21838iD4B767EA45A91D10

Message 25 of 32
(2,396 Views)

@mohansagar wrote:
@tbob Thanks for the reply.... but can u please down convert it into Labview 9 or Labview 8.5. i am not using Labview 10. i could not open the Vi.

Here it is in 8.5

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 26 of 32
(2,375 Views)

@electro SAM wrote:

Hi LabVIEW guys,
I am a new bie for labVIEW.Smiley Wink
I tried to write the solution for this question...


 

Wow.  You must have been reading my mind.  Your solution is very close to the solution I posted back on page 1.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 27 of 32
(2,374 Views)

@electro SAM wrote:

Hi LabVIEW guys,
I am a new bie for labVIEW.Smiley Wink
I tried to write the solution for this question...


 

 

Wow.  You must have been reading my mind.  Your solution is very close to the solution I posted back on page 1.

 Ooops, double post.

- tbob

Inventor of the WORM Global
0 Kudos
Message 28 of 32
(2,373 Views)

Two spaces after a period was a typewriter thing. Most modern word processors take care of the spacing after a period for you.

Message 29 of 32
(2,353 Views)

@mohansagar wrote:

@electro SAM

what u have posted is working properly,but cant we do it without ' Typedef ' ? and in your vi if "NA" is present at Controller1 and any channel is chosen from controller2 , the chosen channel from controller2 is disabled in controller1, which should not happen. in the corresponding controllers only it should get disabled (i.e from controller 3 to 8).


Hi guys,

I can't get your requirement... According to your quote, I alter the code.
But if you change any of your values in the front panel in decending order, it will work. But if it is in ascending order, your controls won't get disable.

22110iDC65A6BF0BB7EB34


And one more possibility is also there, the user can choose a same option more than one time in ascending order (but not in the decending order).

 

22108i0E37985E109F31D4
It will lead the program in wrong.
Check it out...

 

 

 

<<May be my code have error, check my code with your requirement>>Smiley Wink

Download All
0 Kudos
Message 30 of 32
(2,295 Views)