LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with StateChart Examples

Greetings,

For some reason I'm having trouble again with the StateChart Module examples.  

I make a copy of the .lvsc file, and the Caller VI.vi

I rename them both.  

I open the Caller VI and re-link the StateChart blocks to the new copy I created.  

Then something odd happens.  The input node on the StateChart blocks turns red.  There's no error and I can't find out what a red input node means.  

When I modify the state chart to have a new state and trigger as per the example in Getting Started 1, I am unable to create a constant that will send the newly created "Pause" Trigger.  It is not listed in the items and cannot be manually added.

I have double, and tripped checked to ensure that I am indeed linked to the StateChart that I have edited.    

I really would like to use this new tool for a current project.  But if something so simple is taking up hours to figure out.....I'm worried.  

Can anyone tell me what I might be doing wrong?


---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 24
(3,025 Views)
Just so we are on the same page, you were not able to edit the Trigger and Group in your statechart to include "Pause"?


Message Edited by jmcbee on 04-22-2008 02:17 PM
0 Kudos
Message 2 of 24
(3,019 Views)
I think I figured it out.  So I'll try and answer my own post.

The problem I was having was that it appeared that I was unable to properly link to StateCharts.  What was really going on is that I was linked to the correct StateChart, but because I'd modified it the original, both the Run Statechart and Send External Trigger VIs were now mismatched to actual StateChart they were linking to.  (Although I'm really not sure why the Run Statechart was missmatched.  Deleting and re-creating the Inputs constant was exactly the same.  But it worked.)

When I attempted to create a new trigger in the "Pause" Event as per the tutorial, I found that right clicking the output tunnel of the event structure was not producing a constant that included the new trigger I added to the StateChart.  But when I deleted the wire connected the Event Structure to the StateChart and right-clicked directly on the Trigger Node, the constant was created with the Pause trigger included.  (The little red dot disappeared as soon as I deleted the connection to the Event Structure)
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 3 of 24
(3,015 Views)
Thanks for the reply JMcBee,

It turns out it was just the inputs that weren't matching up. 

Still not sure why the Run Statechart Inputs Cluster Constant changed.  But when I deleted it and re-created a new constant from the node, the red dot went away.  The cluster was still a cluster of one boolean though.  So I'm not sure what really changed there. 




Message Edited by pallen on 04-22-2008 04:24 PM
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 24
(3,011 Views)
Just out of curiosity, after you created your new trigger did you hit the "Generate Labview Code for Statechart" button?  I think that if the ungenerated code and the generated code do not match that you might get that red dot indicating a problem, however I cant check that theory right now (will try to do so in the future unless someone else can cofirm or deny).
0 Kudos
Message 5 of 24
(3,007 Views)
Yup.  I made sure to Generate LabVIEW Code.

I'm pretty sure now that the red dot was telling me that constants I had wired into those nodes didn't match StateChart.  It all kinda makes sense now.

Well...at least a little more sense. 

Now I just need to figure out how to bend this tool to my will use this in my latest project.   Smiley Very Happy
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 6 of 24
(3,002 Views)
Hi all,

I am pretty certain that most of these issues were caused by renaming the statechart file on disk. From how I read the initial post, it sounds like that was done. A known issue in the LabVIEW Statechart Module for LabVIEW 8.5 is that rename of the .lvsc file on disk is not supported. If you do it, we will behave very strangely and things will be mislinked. (A good number of things may actually be incorrectly linked to the original statechart file.) You almost certainly do not want to proceed further if you are trying to link to a statechart that has been renamed on disk.

Let me know if I misread your post and that is not what you did (a rename of the .lvsc file on disk).

This issue is in the readme file in case you want more info. If you need to rename a .lvsc file, it has to be done from LabVIEW via a save as or rename.

Thanks,
Nick
0 Kudos
Message 7 of 24
(2,983 Views)
Hi Nick,

Thanks for your response.  It's good to know that I shouldn't re-name the .lvsc file on the disk. 

In this case I was following the instructions and saved a re-named copy from LabVIEW to different spot on my hard drive.  (I did this to leave the original examples intact)

I'm pretty sure that it was when I modified the .lvsc file that the inputs no longer matched what was expected. 

Just so I'm clear, you're indicating that there's an issue with renaming an .lvsc from Windows Explorer?  (ie. Right click and rename from Windows Explorer)

It wasn't what I did here.  But it's also a very good thing to know what not to do.  Smiley Very Happy
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 8 of 24
(2,947 Views)


@pallen wrote:
Hi Nick,

Thanks for your response.  It's good to know that I shouldn't re-name the .lvsc file on the disk. 

In this case I was following the instructions and saved a re-named copy from LabVIEW to different spot on my hard drive.  (I did this to leave the original examples intact)

I'm pretty sure that it was when I modified the .lvsc file that the inputs no longer matched what was expected. 

If what you did was copy the examples folder somewhere and rename the folder (or any files except the .lvsc file) you should have been fine. If you feel ambitious and can reproduce the issue, please definitely let us know the steps you took to get in this weird state.


Just so I'm clear, you're indicating that there's an issue with renaming an .lvsc from Windows Explorer?  (ie. Right click and rename from Windows Explorer)

It wasn't what I did here.  But it's also a very good thing to know what not to do.  Smiley Very Happy


Right. Please do not do that in the current version of the statechart module. Smiley Happy It is something we hope to address in a future version, but doing it right now will not leave you in a very good state.

Thanks for the feedback.

0 Kudos
Message 9 of 24
(2,942 Views)
To follow up,

I've completed all of the Getting Started with StateCharts Tutorial and I ran into a couple of other oddities.  I did try to submit them as feedback from the LabVIEW Help Menu.  But webform would not acknowledge the Submit button.  I tried both in IE 7 and Firefox 2

When I first saved a copy of the .lvsc file and linked my VI to it, the Enums in the Event Structure would not update automatically to reflect the new triggers.  After I replaced all the Enums in the Event Structure, they updated as expected when new triggers were added. 

The other problem was that the end "result" of Getting Started Six was that the Counter would reach a value of 27 before entering the Menu state, due to the Join that was added. 

I looked at this a number of different ways, and my counter only ever goes to 26.  The example runs as expected otherwise, and I have experimented to ensure that I am using the Join function correctly.  I still only get 26.

All of the illustrations show no Return Trigger added to the Tock to Tick Transition, or the Green to Red Transition.  Although they do tell you to configure them that way.  (It won't work at all otherwise)   It's confusing because your code won't look like what the tutorial says it's supposed to look like. 

Much more minor, the link at the bottom of the Getting Started Three page only links back to page three and not to page four as it indicates.  

I think I have a better grasp of how this tool works than when I started.  But getting though things were kind of shaky, and I'm still unsure of a few things.  I'll be looking for more examples. 

I'll attach my final version of code.  Maybe you can tell me why my counter only goes to 26 when the tutorial says it should be 27.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
Download All
0 Kudos
Message 10 of 24
(2,929 Views)