LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best structure for an automated test program

I am getting ready to develop an automated test program that consists of pallets with the devices to be tested on them.  They will travel down a conveyor and be sent one at a tome into a test chamber that had an XYZ  motion system to move a set of probes from UUT to UUT.  It will then calculate pass fail criterion and mark the parts.  There will be several tests ran on each UUT.

 

Question becomes what would be the best programming structure to use?  I am thinking a state machine within an event structure or something along these lines.  I think the process would be linear and could be done one state at a time.  For example let the pallet into the station, Move probes in place, take several measurements with different pieces of equipment then determine pass fail and mark accordingly.  Then move the probes to the next UUT and repeat. Once completed release that pallet and shuttle in the next group to be tested.    Would this be the best structure to use?

 

Just looking for some guidance.

0 Kudos
Message 1 of 22
(3,252 Views)

Definitely NOT a state machine inside an event structure.

 

Something akin to a QMH would work.  e.g., "Keep testing palettes until I press the stop button."

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 22
(3,216 Views)

Look into the JKI State Machine, available on VIPM.

 

mcduff

Message 3 of 22
(3,196 Views)

I'd put the GUI in a event loop, and make it communicate to a sequencer.

 

The sequencer would be a OO (composite) command pattern. This will execute all commands (including iterations and conditions) in the order I put them in. Either hard code the sequence, or get it from a file, or even from a GUI.

 

The sequencer can be make so each step loops until done, or so each step iterates until done. This gives a different dynamic.

 

I wouldn't use any framework, although the sequencer would act as an actor, and the event loop will resemble a state machine, the interaction will look like a producer\consumer or master\slave structure.

 

I wouldn't recommend it as a first OO project though. It has it's challenges.

0 Kudos
Message 4 of 22
(3,159 Views)

@billko wrote:

Definitely NOT a state machine inside an event structure.


Well, I wouldn't quite say that.  A clever trick of having the states inside of the Timeout event case could work here.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 22
(3,137 Views)

@crossrulz wrote:

@billko wrote:

Definitely NOT a state machine inside an event structure.


Well, I wouldn't quite say that.  A clever trick of having the states inside of the Timeout event case could work here.


That is more of an event structure in a state machine than a state machine in an event structure to me.

 

Reminds me of this. You could do a (OO) state pattern in an event structure. Again, not beginners OO, but works out pretty well for CLD type projects. That will almost be like having a state machine in an event structure.

0 Kudos
Message 6 of 22
(3,131 Views)

wiebe@CARYA wrote:

@crossrulz wrote:

@billko wrote:

Definitely NOT a state machine inside an event structure.


Well, I wouldn't quite say that.  A clever trick of having the states inside of the Timeout event case could work here.


That is more of an event structure in a state machine than a state machine in an event structure to me.


It is really an interruptable state machine.

 

I usually put my Event Structure in a specific state like Idle or Wait or Check UI.  You just have to make sure you are checking your UI often enough that the user doesn't get annoyed.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 22
(3,126 Views)

As I draw this out I keep thinking I have a couple events that start a linear process.  A pallet of parts trips a sensor.  If there is no parts waiting to go in in test chamber the stop opens and lets the pallet advance.  the next event would be to let the pallet into test station if no parts are in test station.  Once in the test station a series of test states and robotic movements are performed.  Move robotic probe into position -  preform voltage test - perform resistance test - if good mark passed - move robot to net UUT and repeat testing - once done let pallet out and start process over.

 

 

0 Kudos
Message 8 of 22
(3,054 Views)

@buddyfares wrote:

As I draw this out I keep thinking I have a couple events that start a linear process.  A


You probably also want to abort, pause\continue, maybe even revert a process.

 

Although each process is linear, you're program might not be able to treat them as such.

 

I've done a few OO sequencers, and pause\continue\stop\restart\skip\etc. is easy once you have a proper sequencer.

Message 9 of 22
(3,034 Views)

From what you describe, please look into the JKI State Machine, available on VIPM. It's easy to implement a series of states, have events, etc.

 

mcduff

0 Kudos
Message 10 of 22
(3,018 Views)