I'm trying to set up a remote logging system using a Rigol DS1104z oscilloscope. The scope is monitoring a few signals and is triggered externally. Every time the trigger happens I would like to record the data that is displayed on scope on my computer which is connected to the scope via USB.
I can currently control the settings on the scope using a python script which communicates with the scope through the VISA interface sending various SCPI commands. I can configure the scope as desired and even grab the data off of the scope and write it to memory on the computer.
However, I don't know how to synchronize the data grabbing with the external trigger from the scope. What I'm searching for is some sort of way that the scope can send a signal over USB when it is triggered (or better when it finishes acquiring the data after being triggered) so that the Python script can then be "triggered" to grab the data at the right time.
I do know that it is possible to monitor the "Trigger Status" over USB to determine if the trigger is waiting or triggered etc. In principle I could continuously monitor this to try to notice if the scope ever becomes "triggered" and if so I could then monitor for when the scope finishes being triggered (data is acquired) and use that as my signal for reading out the data. My feeling is that this will be slow and unreliable, especially if the trigger pulse is short in time.
I also realize there may be data bottlenecks, for example if the data is still being transferred by the time the scope gets the next trigger. For now, assume that the scope gets triggered once and then there is plenty of time for data acquisition/transfer before the next trigger arrives.
Does anyone have any tips for how I could achieve this?