01-13-2020 03:57 PM
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.
01-13-2020 05:14 PM
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."
01-13-2020 06:52 PM
Look into the JKI State Machine, available on VIPM.
mcduff
01-14-2020 03:28 AM
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.
01-14-2020 06:14 AM - edited 01-14-2020 06:15 AM
@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.
01-14-2020 06:24 AM - edited 01-14-2020 06:26 AM
@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.
01-14-2020 06:37 AM
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.
01-15-2020 09:38 AM
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.
01-15-2020 12:24 PM
@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.
01-15-2020 02:24 PM
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