Rigol Oscilloscope (DS1104z) Detect External Trigger when using Remote Control - Page 1
Forum section: electronics / testgear

author: twistar
author_rank: Newbie
timestamp: January 12, 2021, 02:12:16 am
content: 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?

author: Fungus
author_rank: Super Contributor
timestamp: January 12, 2021, 06:58:13 am
content: Quote from: twistar on January 12, 2021, 02:12:16 amThe 'scope won't ever send you messages all by itself so you don't really have a choice except to set it to single shot mode then check the status every few seconds to see if it triggered or not.I think the ":TRIG:POS?" command will tell you if it triggered or not.The other way is to attach something like an Arduino to the trigger out connector and get that to send you messages.

author: 2N3055
author_rank: Super Contributor
timestamp: January 12, 2021, 07:25:16 am
content: BNC in the back of the scope is Trig OUT signal. You need to make piece of hardware that will detect pulse and inform your software that trigger happened. It can be something simple, like Arduino connected to serial port, or even maybe some ready made digital I/O card.. I presume you have PC next to scope..

author: twistar
author_rank: Newbie
timestamp: January 14, 2021, 07:58:45 pm
content: Fungus, thank you. Putting the scope in single mode and then periodically polling it to find it if it has triggered is going to work for us!

author: tv84
author_rank: Super Contributor
timestamp: January 14, 2021, 09:34:58 pm
content: Quote from: 2N3055 on January 12, 2021, 07:25:16 amAgree. If the trigger is external, why not feeding the same trigger to the PC ?Seems the most logical setup.