I'm working on a system that turns on LEDs directed into a camera exposure. My Labview setup acts as the slave to a master camera. Labview controls the LEDs by TTL (5+ on, 0 off). 1 of 24 LEDs are turned on for each camera exposure. After each exposure the LED is turned off. The next exposure will turn on the next LED. There will be 24 exposures.
The camera has two outputs used by my labview software. One is the “ready state”, the other is the “exposure state”. The “ready state” is at 5+ V and falls to zero when it’s ready. It then stays at zero until all 24 exposures are done. When exposing, the “exposure state” is at 5+ V, otherwise it’s zero.
The code is attached and explained in more detail: I’ve successfully demonstrated the digital outputs to increment the LEDs 1 through 24. My biggest concern is whether I’m correctly using the digital input edge detection with the timed loop to quickly and efficiently turn on the LEDs for each exposure (and then turn off the LED when the exposure ends).
Suggestions/comments for improving the code? Thanks.