Digitizing video with a SCPI compatible oscilloscope
|
|
Bjørn
|
Wed May 20 2009, 04:13PM
|
|
|
Registered Member #27
Joined: Fri Feb 03 2006, 02:20AM
Location: Hyperborea
Posts: 2058
|
Some oscilloscopes are easy to control from a PC using Standard Commands for Programmable Instruments. If it has a video trigger that can trigger on specific lines it is easy to grab each line in turn and put them back to an image. The practicality is quite limited but there might be one or two uses for it.
For y = 0 To 255
rs232_port.WriteLine(":trigger:video:line " & (y + 28))
Threading.Thread.Sleep(300)
rs232_port.WriteLine(":acquire1:memory?")
For i = 1 To 14
rs232_port.ReadByte()
Next
For i = 1 To 4000
d = rs232_port.ReadByte()
d = (d << 8) Or rs232_port.ReadByte()
If (d And &H8000) Then
d = 128 - (((Not d) + 1) And &HFFFF)
Else
d = d + 128
End If
If d > 255 Then d = 255
pic.SetPixel(i >> 3, y, Color.FromArgb(d, d, d))
Next
GraphDisplay.Image = pic
Application.DoEvents()
Next y
|
Back to top
|
|
Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob
|
|
Powered by e107 Forum System
|