ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update state machine

To help understanding more my problem, please see the Figure 2 of this link http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/

 

- I have a state machine similiar with the above link. The state machine was handled by a similiar Type Def1 (on the left) & in one event there is a similiar Type Def2 (on the right), my state machine working fine!

 

However, I need to add a new event into the existed state machine ... I did try the following:

 

1. I add a new item New_Event into the Type Def1 (Auto  Update Type Def) & Save, then Add Case After in the state machine ---> it inserts automatically a new event New_Event. In this event I use a PopUp dialog box = "New_Event does happen!")

 

2. I aslo add a new item New_Event into the Type Def2 (Auto  Update Type Def) & Save!

 

3. In a specific event (as in the link), in Type Def2, I select the New_Event (to make sure it works, in this event I use a PopUp dialog box = "Should execute event New_Event") then add the 2nd event which will show "Second task is excecuted!"

 

4. Run program & the PopUp dialog box shows "Should execute event New_Event" ... but there is no PopUp dialog box "New_Event does happen!". Somehow it could not invoke the New_Event

 

5. After a while, it shows PopUp dialog "Second task is excecuted!"

 

6. I did try to Update Change both Type Def1 & Type Def2 then run again ---> same thing happen again!

 

*) I am not very experience with state machine ... might be I forget some thing to make it work when adding some thing new?

 

Thanks to any help

 

 

 

 

 

 

 

0 Kudos
Message 1 of 6
(3,423 Views)

Can you post your code? Make sure you include the typedef control.

PaulG.
Retired
0 Kudos
Message 2 of 6
(3,414 Views)

Hi, the project size is 92.6 Mbytes that was why I did not attach the zip. I can only attach the Main vi, but then you can not load or run it because of missing a lot of vi's & also you can not examine them! Please tell me what do you do like (whole files or only 1 Main vi)?

 

In your experience, if you have to add a new event in the existed state machine (as in my case), what steps I should do?

 

Thanks

Message Edited by plit string on 01-14-2009 03:13 PM
Message Edited by plit string on 01-14-2009 03:14 PM
0 Kudos
Message 3 of 6
(3,406 Views)
It sounds like you did exactly the what you are supposed to: edit and update the typedef, added the value to your case structure, etc. Did you try running it in highlight mode while poking around with a few probes? State machines are very easy to debug if it's a problem with one of your states getting out of whack.
PaulG.
Retired
0 Kudos
Message 4 of 6
(3,399 Views)

Hi Paul,

 

I thought that I missing some thing, but I did forget to do this method for debugging, I will do as you suggested to see what is happen! 

 

Thanks

0 Kudos
Message 5 of 6
(3,394 Views)

Hi Paul,

 

As you suggested I did find the state machine actually fall into another state by previous programmer (which defined as Default case), that was why it ignores my new event! I did add my new event into his state & now the New_Event is activated as I wanted

 

Thank for the suggestion ... I was so busy with other stuff & forgot this debugging (silly me)!

 

Thank again Smiley Happy Smiley Happy Smiley Happy

0 Kudos
Message 6 of 6
(3,362 Views)