LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization preference for State Machine with LV 2009

Solved!
Go to solution

Think of this as tiptoeing in and whispering.  You've shown a great attitude toward receiving critique, and I've meant my critique to be constructive.   So here goes...

 

Considering the code I saw and the fact that you're just now learning about clusters and bundling, I'd really urge you to look into hiring some help.  Without the help of someone with more knowledge and experience, I foresee the likelihood of a long painful road ahead.  All those SR's imply a lot of "state information" and some of the code suggests a lot of interaction and dependency among them.

 

There are far, far, FAR more paths that lead to getting things "kinda mostly ok, quite a bit of the time" than paths that get things demonstrably and truly correct.  I suspect you're likely to find yourself wandering down a lot of those former paths, frequently thinking that "THIS time I've really got it", only to find out later that nope, not quite.

 

What are the consequences of such wrong turns in your situation?  What happens if an item that should have failed testing ends up passing due to a flaw in the test software?

 

Hiring help will likely be costly.  It's likely someone will need to come onsite and spend a lot of interactive time with you, as it seems likely this software doesn't yet have well-defined and written requirements and constraints.

 

But keep in mind that flawed testers can often be *more* costly, just in a different way.

 

Again, I'm meaning this as constructive advice.  Keep learning, but also do a realistic assessment on what you're ready to tackle, and what the consequences of bugs will be.

 

 

-Kevin P

Message 11 of 17
(357 Views)

Ok, I receive that.

 

     We are a very small company, in a niche RF business. I have worked on space flight hardware, and stuff that they won't tell me were it is used. I am an Engineering Tech/Production Manager/friend of the owner, and we grow into what we need in order to keep costs down, and keep ourselves busy between those large orders.

 

     This conversation is one that we talk about, and I'm not married to Programming. The nice thing is that, for what this will become, all the parameters are verifiable on the bench, and It will pretty much work, or it won't. When I finish building ths program, I will put it aside, and build the units that this test platform will calibrate. It keeps me busy, it's a fun change of pace, and this is the 3rd or 4th one that I have made over the years. (can't believe I put the switches on the outside of the while loop).

 

     I figured it would help to get a view of the other side. If the need clamors for it, then we will do it.

0 Kudos
Message 12 of 17
(352 Views)

Reading it now, THANKS Bill ! 🙂 

Message 13 of 17
(311 Views)

I would highly recommend you look into the JKI State Machine if you decide to refactor your code. It is available freely on VIPM. It has built in event and error handling for free.

 

It has a cluster built in, along with an event structure. All of your data can go in the shift register.

 

It is a String based State Machine, yours is an enum based, but in this case Strings are your friends. It has the following syntax: StateCategory: State >> Argument(Optional).

 

I think this type of syntax would greatly help you. For example you have the following states: Print Init 1, Print Init 2, Print Init 3, these could go to Print: Init >> 1(2)(3). Your Init is now one subVI which handles 3 different arguments.

 

Below is a screen shot of one of my State Machines, notice how categories are broken up, makes it easier to update, debug, etc.

 

mcduff

Snap4.png

 

Message 14 of 17
(295 Views)

     The second one I built was String based, and I did like that, but when I started on this one, I didn't realize the benefits of String over Enum. Not that I fully do now clearly, but I have had much more time this time to reinforce, relearn, and try different approaches.  I love this book by Peter Blume, and it is helping me prioritize the changes that are being recommended.  

 

     Does the String have the Type Def. advantage as well? I will look this up, because I just completed a chapter.

 

Thanks!!

0 Kudos
Message 15 of 17
(276 Views)

@Hobbs23 wrote:

       Does the String have the Type Def. advantage as well? I will look this up, because I just completed a chapter.


No. An enum type def State Machine can never have a bad state, whereas, in a string based State Machine, a state can be mistyped. This is why the JKI state machine is nice, it already has an error state built in to let you know you mistyped something.

 

mcduff

Message 16 of 17
(271 Views)

Hi Billko

 

just a couple things. 

 

1. I keep a journal now and It saved my butt. The Labview Stye Book has really provided  a great standard going forward for me. My personal thanks, it's not just about the money. 🙂

 

2. Is it just me? I tried using the cluster option with 8 seperate signals, and 7 layered timing. Everything works fine, but the amount of space that those unbundle by sig take up will clog up everything if I try to add all 25 seperate signals, and their timings that I need. 

 

It also seems to hide the nuts and bolts under the carpet instead in their simpler form. Seeing how I am about maxed out on this State Machine, by having to program ahead of the spec. It seems Clusters are good to know but not going to make up for imagining what a specification might be?

 

If you have time for a comment, great but I already have the gift that keeps on giving. 🙂 

Message 17 of 17
(220 Views)