LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help completing this VI


@altenbach wrote:

 


Hi,

 

So I wrote a simple state architecture. Could you please check for me, stuck with just 1 error 🙂 

0 Kudos
Message 11 of 19
(834 Views)

@concacid wrote:So I wrote a simple state architecture. Could you please check for me, stuck with just 1 error 🙂 

Where is it?

0 Kudos
Message 12 of 19
(827 Views)

Ok,

 

This code is not totally complete. I will have to insert sub-vis for to actuallly do read from the meter but this will run I'm sure. What I'm trying to do is to ensure that the string doesnt show until it gets to the actual sequence where it is contained. I tried to use a property node but still cant get it out.

 

Do you think this will work compared to the earlier one when I insert the missing code into the flat sequence? 

0 Kudos
Message 13 of 19
(825 Views)

Looks much better.

 

Still there are some strange things.

 

  1. For example the case structures after most dialog boxed can be removed, because both cases give the same output, irrespective of the value wired to the selector.
  2. You should really make your enum a strict type def. If you later add another state, all other diagram constants will automatically upgrade (In your case (no typedef) you would need to manually replace all of them. Tedious! You can link the "visible" property node to the indicator. no need for control references.
  3. All you seem to write to the string is "please wait..." If that text never changes, you don't need to rewrite it.
  4. Personally I would conduct most user interaction on the main front panel. Constatly popping up dialogs can be annoying to the user.
0 Kudos
Message 14 of 19
(821 Views)

@altenbach wrote:

Looks much better.

 

Dear Altenbach,

 

Thank you for your help. I think I did some work. All the points you've made above are very valid. 

 

1. I decided to duplicate the cases because labview kept returning some form of error. I've tried to change the tunnel to use default if unwired..hope that works.

2. I cant find the option for making the enum strict type def. I can however make it type def...still need to work on that

3. I want that text to ONLY during that case and disappear afterwards.

4. I decided to leave it at the constant pop-up phase for now because of its simplicity. I know its such a pain. I'm still figuring how not to actively follow the instruction.

 

I used the SafetoDefaultValues.vi to save the values in my indicators after a case. Was that what you were talking about?  

 

Apart from the above, I dont know how bad I have done.I dont want to ask for too much but...X_X 

 

I just need a knight to review my work. Just in-case you will be kind to help, I can mail or post them (vis&subvis) as you wish.

 

I'm still in learning school. LOL.

 

0 Kudos
Message 15 of 19
(800 Views)

@concacid wrote:

1. I decided to duplicate the cases because labview kept returning some form of error. I've tried to change the tunnel to use default if unwired..hope that works.


Just delete these case structures completely! They are not needed. If you use default if unwired, you get the default value, which might be different to what you actually want.


@concacid wrote:

2. I can however make it type def...still need to work on that


 That should be OK.


@concacid wrote:

3. I want that text to ONLY during that case and disappear afterwards.


 Well, I could not find a property where you make it disappear again. You could use a string indicator with a transparent background and simply write your text, or an empty string to it depending on the condition. No need to make it invisible with property nodes. 😉


@concacid wrote:

I used the SafetoDefaultValues.vi to save the values in my indicators after a case. Was that what you were talking about?  


 

I am not familiar with that VI. Where did you find it?


@concacid wrote:

Apart from the above, I dont know how bad I have done.I dont want to ask for too much but...X_X 

I just need a knight to review my work. Just in-case you will be kind to help, I can mail or post them (vis&subvis) as you wish.

I'm still in learning school. LOL.


 

 Seems you are learning very fast. That's a good thing. 😄

 

0 Kudos
Message 16 of 19
(782 Views)

altenbach wrote:


Just delete these case structures completely! They are not needed. If you use default if unwired, you get the default value, which might be different to what you actually want.

 

I did that but it then brings out an error of incomplete cases. 

 

 

I used the SafetoDefaultValues.vi to save the values in my indicators after a case. Was that what you were talking about?  


altenbach wrote: I am not familiar with that VI. Where did you find it?


I found it on the National Instrument's website: Find it here

 

 

altenbach wrote:


 Seems you are learning very fast. That's a good thing. 😄

 

I would love to learn faster. What is the next to learn, I think I'm a little bit okay with state architecture. Kindly suggest! 


 

0 Kudos
Message 17 of 19
(765 Views)

If you removed the case structure, then it is impossible to have incomplete cases.  You can't have cases without a case structure!

0 Kudos
Message 18 of 19
(755 Views)

Now it's looking good, a BIG difference from the 1st attempt, good job!

Regarding the case you should remove the full structure, not just one case, which could case the incomplete error can occur.

More of a style thing, but i prefer to wire a True from the Exit case to the Stop loop instead of comparing to the Exit case, with Use Default all others will be false and the loop wont stop, just like you want it and some less stuff on the block diagram.

 

The next step if taking a loop at events and queued state machine, both have examples and templates you can open. The queued state machine is ofc the next logical step and have the benefit och being able to queue up commands, e.g. if you change parameters you might need to both run Init, Measure and Redraw again.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 19
(746 Views)