05-03-2017 11:47 AM - edited 05-03-2017 12:11 PM
I am setting up a project that will have multiple queued state machines (event handlers) running in parallel that control various hardware components (DAQs, digitizers, camera(s), etc.). I want to assemble the data from these sources into a single data type / file, in a way that everything in synchronized. My thought was to build another state machine dedicated to this task (I'm calling it "Data QSM.vi") - all the other processes will send their data products to Data QSM via it's queue, and Data QSM will assemble them and write to a file. I was thinking of syncing this operation to, say, the frame rate of the camera, so every time the camera pulls a frame, a data packet is assembled and written to file.
Does this seem like a sound approach? I don't want to get too far into it if there are other more commonly used approaches. My main worry is that the data components will get out of sync, so I was going to time stamp each piece, and maybe make the assembler check the time stamps as it pulls data from the queue as it assembles. I'm worried about the latency this may cause. And for a case where one of the data sources starts to lag, I'm not sure how to handle it.
05-03-2017 12:09 PM
I have done similar, only it was ethernet data coming from multiple sources. I synchronized based on the one that was most deterministic. Just hold the other data in shift registers and update them when you get their data.