LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Statechart - Synchronous to Asynchronous

In LV's help is a tutorial on Statecharts. I am now at the end of Part 3: "Defining and Modifying Statechart Data Types" where I am supposed to link the Statechart to the "Getting Started Caller VI (Unlinked).vi."
 
Following the directions, I located the "Run Statechart" function, right-clicked and selected "Link to Statechart," and selected my new Statechart; however, it would not connect because the wires/terminals were incorrect.
 
The Statechart in LV's "Getting Started Caller VI.vi" example (already linked) is Asynchronous (i.e. it uses a pink "Instance Name" wire as one of the inputs).
 
The Statechart I built using LV's tutorial came out to be Synchronous - Its has a blue "Trigger" wire as one of the inputs.
 
When I realized that I had created the wrong Statechart, I deleted it, and did the example tutorial over. Now, I am sitting here with another Synchronous Statechart that I made by following the tutorial!
 
How do I tell LV that I want my Statechart to be Asynchronous when I build it?
 
Is there a way to take the Statechart I have now and convert it, or is it better to just delete it and start over?

\
Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.
0 Kudos
Message 1 of 3
(2,862 Views)
Never mind. I found it:


  • Right-click the .lvsc file in the Project Explorer window and select Properties
  • In the Category section on the left of the dialog box, select Statechart Code Generation
  • In the Statechart Code Generation window, change Usage from Synchronous to Asynchronous.
    Run Statechart component in the VI. Hope this helps others! It was *not* intuitive, and it was *not* mentioned in the tutorial.

    \
    Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.
    0 Kudos
    Message 2 of 3
    (2,849 Views)
    Step 2 of the tutorial actually does have instructions for configuring a Statechart to be asynchronous:

    1. Launch LabVIEW and display the Getting Started window.
    2. Select File»New to launch the New dialog box.
    3. Select Other Files»Statechart from the Create New tree.
    4. Click the OK button. LabVIEW prompts you to save the statechart.
    5. Enter My Getting Started Statechart.lvsc and save the statechart in a convenient location on disk.

      LabVIEW displays a Project Explorer window that contains the necessary support files under the My Getting Started Statechart.lvsc project item. This project item represents the .lvsc file in which LabVIEW stores statechart information.
    6. Right-click the My Getting Started Statechart.lvsc item and select Properties. LabVIEW launches the Properties dialog box.
    7. Select the Statechart Code Generation item from the Category list. LabVIEW displays options relating to statechart code generation.
    8. Select Asynchronous from the Usage pull-down list. This action specifies that the statechart is asynchronous.
    9. Click the OK button to save changes and return to the Project Explorer window.
    Do you have suggestions on what would have made the synch/asynch more obvious to you as a user?  For instance, somewhere that we could have put a visual link/information that would have naturally led you to discover this?

    -Christy



    0 Kudos
    Message 3 of 3
    (2,823 Views)