03-03-2010 10:56 AM
03-03-2010 10:59 AM
I am using an type-def enum in my main program's state machine, but this is only a subVI that is in the initialization state of my state machine.
I attached the code for reference. I had a question about wiring the output queue. Since the SUBVI is only executed one time, and the device type is the input parameter, can i simply wire the queue out from the last state of the stacked sequence for each of the device types?
03-03-2010 11:10 AM
glstill wrote:I am using an type-def enum in my main program's state machine, but this is only a subVI that is in the initialization state of my state machine.
I attached the code for reference. I had a question about wiring the output queue. Since the SUBVI is only executed one time, and the device type is the input parameter, can i simply wire the queue out from the last state of the stacked sequence for each of the device types?
The reference would work as you have it wired. I still think you are missing the point that several of us have been trying to make. There is no good reason to use the stacked sequence structures. Even a simple state machine doing essentially the same thing is a MUCH better solution. As stated earlier you will get self documenting code if you use well named ENUMs. In the long run you will be MUCH better off if you get rid of the stacked sequence frames. It is up to you now whether you want to heed the advice from folks with many years of experience under our belts or to simply ignore it.
03-03-2010 12:36 PM - edited 03-03-2010 12:37 PM
I would make sure both the test and the device are typedef enums. Instead of using sequence structures. I would create an array constant that has each of the required. For device 1 it would be test 1, test 2, and test 4. All that would be in the case structure for each device is its respective array. Then feed that array into an auto-indexing for loop that has just the enquue operation.
Now if you need to modify an order of tests, you would just go to the respective case structure for that device and edit the array.
03-03-2010 12:50 PM - edited 03-03-2010 12:52 PM
Ravens Fan wrote:I would make sure both the test and the device are typedef enums. Instead of using sequence structures. I would create an array constant that has each of the required. For device 1 it would be test 1, test 2, and test 4. All that would be in the case structure for each device is its respective array. Then feed that array into an auto-indexing for loop that has just the enquue operation.
Now if you need to modify an order of tests, you would just go to the respective case structure for that device and edit the array.
Message Edited by Ravens Fan on 03-03-2010 01:37 PM
Psst Ravens. Use ini files. One "main" to hold the station info and test specific config file names and "test specific" inis to hold the "steps" in order. Then you have No need to touch the code (or recompile the app) to release a new test or modify the order of steps.
You are absolutly correct in requiring the type defs !
03-03-2010 01:08 PM
Jeff Bohrer wrote:Psst Ravens. Use ini files. One "main" to hold the station info and test specific config file names and "test specific" inis to hold the "steps" in order. Then you have No need to touch the code (or recompile the app) to release a new test or modify the order of steps.![]()
You are absolutly correct in requiring the type defs !
Message Edited by Jeff Bohrer on 03-03-2010 12:52 PM
If it was me, I would use an .ini file. But the OP seemed resistant to go that route. So I wanted to show a way to do the same thing he was doing already (one VI that statically locks in the test sequences), but without the mess of stacked sequence structures.
03-03-2010 02:54 PM
03-03-2010 02:59 PM