08-25-2021 02:40 PM
Hello all,
Setup: I have a setup of 4 Keyence lasers connected to two different controllers. Each controller is connected to two lasers. The controllers are then connected to the controller via USB and Ethernet cable. One controller utilizes the USB connection and the other controller utilizes the ethernet connection. The laser setup is meant to measure vertical distance and this data is then plotted over time. There is also a gyroscope setup on the lower half of the block diagram attached. The gyroscope measures the rotation of the assembly.
Issue: The issue is that once the data is plotted, there is a noticeable time delay between the lasers from two different controllers. There is also a small time delay between lasers from the same controller, but not as significant. I do not know what is causing this delay.
Troubleshooting Performed:
I have attached the .vi code and screenshots of the resulting data in which you can see the time delay. Please let me know if you would like to see anything else or have any questions. Thank you for your help!
08-25-2021 05:15 PM
I don't have the Keyence drivers installed, so I get a lot of unfound VIs. But, I do have a couple suggestions / questions.
Questions:
What is the 2D array of I32 coming from "Extract Profile Array.vi"? Does that have timing and position data in it?
Why do you record the "second" data from "Get Time.vi"?
Is there anything that tells the 2 controllers to start recording at the same time? If you need microsecond synchronization, you will definitely want some kind of a hardware trigger. If the data read is started with "Read Profiles.vi", I would count yourself lucky that the profiles are so close to each other!
Suggestions:
Read from each instrument in a separate loop. Write data to file in another separate loop.
Don't use dynamic data nodes. You can build a single element array using "build array".
No need for "wait until (ms)" and a timeout of 50ms on the event structure
08-31-2021 02:36 PM
Thank you. After some discussion with some folks, I think we are wanting to do a mechanical trigger of some sorts. We are not exactly sure how to go about implementing it though to ensure that controllers are reading at the same time. Got any suggestions?
08-31-2021 03:10 PM
Can you explain what you mean by "mechanical trigger"? Like pushing a button?
Where the trigger comes from is completely up to you and dependent on your application. Sometimes it comes from some other part of the process or test. If you just want to trigger "on command" you can use a digital output from cheap DAQ hardware.
You may to have to talk to Keyence or read the manual to figure out how to make the instrument wait on a trigger to collect data. If that option is available, usually some wiring is required to get your trigger signal connected to the I/O pin of the instrument.