LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with StateChart Examples

Ah, ok, I think I understand what is happening now.

The Getting Started Caller VI (Unlinked).vi has its run statechart node and send external trigger node unlinked, but the enums in the event structure are actually pointing to an already existing statechart. This other statechart already has all the triggers you are going to create for your copy of the statechart. This is done to try to make it easier for you so that you don't have to drop all the enums yourself, but I agree it can lead to a really confusing experience. You start adding triggers (maybe even ones the tutorial doesn't call for) just to play with things, and the enum doesn't update. When you delete all of the existing ones and drop your own triggers directly (by doing a create constant off of the send external trigger node), things behave as you would expect. I will file a bug report on this potential confusion. (Incidentally, the reason for the "red dots" on your nodes was because of this; LabVIEW was letting you know that it was coercing one statechart's triggers enum to another's.)

I will also forward on your feedback about the other points of confusion in the tutorial. I agree the illustrations are confusing not showing the return trigger being configured for two transitions. I also do not see how you could get 27 either so I think you have followed the instructions entirely correctly and the tutorial is wrong. (If the initial transition in the concurrent region was to the green state, you would get 27, but that is definitely not what the tutorial says to do.)

Thanks again much for your feedback. Sorry the tutorial was a bit of a bumpy ride for you.
Message 11 of 24
(1,425 Views)
I kinda figured the dots were coercion dots. 

Although it seems odd to say, the confusion might have actually helped me a little by forcing me to dig a little deeper to figure out what wasn't working. 

I just installed the 8.5.1 upgrade, as well as the latest StateChart update.  Everything still works.   (Yay!) 

I'm still trying to find a few more examples though.

Thanks for all your help.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 12 of 24
(1,419 Views)
Minor add-on: in your first post, you mentioned being unable to choose the pause trigger in the enum. Based on what I think was going wrong, the pause trigger should have already been there before you even created it (since this enum is really another statechart's list of triggers.) I can't understand why it would not be there. If you encounter this again, try opening the typedef for the enum and letting us know what the name of this trigger typedef is (it should have a name that reveals which statechart it is from).

Thanks.
0 Kudos
Message 13 of 24
(1,417 Views)
Just FYI, I've gotten in touch with our documentation team and they are actively investigating all of the good points you made.
0 Kudos
Message 14 of 24
(1,392 Views)
Great!

I'm still playing with it today.  On one of the resource pages, there's a description of a Vending Machine Statechart.  I couldn't find an code to download for that one.  So I figured I'd try to make my own. 

I'm almost through the first iteration of the code, and I've already discovered a bunch of stuff that I didn't pick up in the Getting Started exercises.  I had planned to start a new thread and post some code when I got to that point, because I'm sure there's a lot of other folk out there that are keen to start using this new tool too.

One thing that's bugging me though is that whenever I modify a state, the structure on the diagram grows.  Even if I have AutoGrow disabled.  This makes it pretty much impossible to keep a diagram neat while I'm developing.  I suppose it's easy enough to clean everything up when I'm done.  But if a State grows while inside a SuperState, then it grows too.   So one little change can really mess up a nice, neat diagram.  Not that I'm anal about being neat, you should see some of the Visual Designer code I had to work with a few years ago.  *shudders*

If there's a way to stop that behaviour entirely though, I'd love to hear it. 

Thanks again for all your input.  
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 15 of 24
(1,381 Views)
How much does the state grow? We have a bug report on this, and our steps to reproduce cause it to grow ever so slightly. Is your growing more major? Feel free to post an example if you'd like.

Unfortunately we don't really have a workaround at the moment. I'm not sure why it is affecting you so much; I see it, but only rarely.

0 Kudos
Message 16 of 24
(1,378 Views)
It's weird.  Sometimes it grows more than others.  Sometimes not at all. 

I haven't noticed it as much when I'm making changes to code that's already in a state.  It seems to be worst when I'm first configuring a state. 

I'll try and do some screencaps when I start on the next piece of code.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 17 of 24
(1,364 Views)
Hi Nick,

I'm seeing some other weird problems with the statechart now.  When I first configure each state, it ends up just making a real mess of my diagram.  Some states will double in size, and if they're inside other structures it forces them to grow too. 

I figured I could ignore this and not worry about my diagram until I'm done configuring it.  But now that I'm working on a more complex diagram, I've hit another problem. 

Once I did my first configurations, I set all the AutoGrow options to false.  Then I re-sized and cleaned things up.  When I make adjustments after that, the states usually don't grow anymore.  But now everything is "jumping" around.  My entire diagram seems to shoot off to the left whenever I edit a state.  Things also seemed really "twitchy" when I tried to move them back.  It makes me wonder if I haven't somehow "broken" the diagram in a way.

I'm attaching the code here in case someone can tell if I've mucked things up somehow. 

The code still doesn't work quite right.  I'm trying to figure out why my events are taking so long to register.  I had a bunch of wait timers in a few states, and I think that was causing a problem. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 18 of 24
(1,346 Views)
Hi Patrick,

I've replicated the jumping issue you were talking about when editing your states; we've never seen anything like that before. I'll try to look a bit more sometime today and see what I can make of it.

Thanks,
Nick
0 Kudos
Message 19 of 24
(1,321 Views)
Hi again,

I've created CAR # 105817 on this issue. You'll be the first to know if I find a workaround, etc.

Thanks,
Nick
0 Kudos
Message 20 of 24
(1,317 Views)