LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update enum at runtime

I have a typedef enum that helps sequences each state in my testing process ( test1 point to test2 if pass or handle_results if fail, test2 point to test3 if pass or handle_results if fail, etc).  This works great for one product.  Now, management wants to modify product A into product B which doesn't need to do test3, and into product C which doesn't need to do test4, etc.  Is there anywhere to modify my typedef enum at runtime depending upon which product the operator selects to be tested?  It seems wasteful to create a VI for each product since they all use the essential state machine and only skip specific states within that state machine.  I thought about having a database which lists which tests are appropriate for each product.  Is this possible?
0 Kudos
Message 1 of 5
(2,506 Views)

enums are set at edit time.  You could use a queued state machine, where depending on the UUT you could queue up different tests.

 

Paul

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 5
(2,502 Views)


mysticfree wrote:
Is there anywhere to modify my typedef enum at runtime ?
First of all, Enums cannot be modified at run-time. Smiley Sad
Enums are used for basically polling the states of the program/diagram.
 
Then, I think, it is also not all possible to modify typedefs during run-time.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 3 of 5
(2,484 Views)
I would go with the queued state machine.
If a tester selects a specific product, just feed sequentially the several states to be performed.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 5
(2,478 Views)
Thanks for your replies.  After looking into queued state machine, I'm using a different approach by creating an Access database that contains test limits and boolean field for each test.  At the start of the VI, after the user selects a part, I read in the particulars for that part into a cluster.  As the program goes to each state, I check the boolean field for that test to determine whether to continue in that state.  If not, that test points to the next state. So far, this seems to work until I have a better understanding of how to set up a queued state machine.

Thanks again,
Ron


Message Edited by mysticfree on 05-21-2008 10:17 AM
0 Kudos
Message 5 of 5
(2,427 Views)