Sorry I don't have example code. I just moved into a new position and don't have LV installed yet on my new computer. I'll try to explain it to you. You should create an indicator (#1) to show the incoming TTL pulse state. Initialize it to false. Also create another indicator (#2) which will show the previous state. Initialize it to false. Then create a while loop. Inside the loop, first read your incoming TTL line. After reading the TTL signal, set the indicator #1 to the TTL state (true=hi, false=lo). Then create a case statement. The True condition should execute only if the previous state indicator (#2) is false and the current TTL indicator (#1) is true. After executing the case (regardless of which case was executed), set the #2
indicator to the same as #1 indicator. End of loop.
The loop starts with #1 and #2 both False, and nothing changes until the TTL signal goes hi. Then #1 goes True and with #2 still False, the True case executes (containing your special code). After that, #2 is set to True. The loop continues now with both #1 and #2 being True, and the True case does not execute anymore. When the TTL signal goes low, the #1 and #2 indicator will both become False. The cycle repeats again, waiting for TTL signal to go high. Use a stop button of whatever is necessary to exit the while loop.
Sorry I could not give an example at this time.