tagCANDY CGI VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
[ツリー表示へ]  [ワード検索]  [Home]

タイトル Re^2: エクセルグラフ
投稿日: 2011/10/27(Thu) 18:43
投稿者よっち
オショウ様 大変早い解答ありがとうございました。
御指摘の通り、グラフはPictureでリアルタイム表示させることにしました。
実際に寄せ集めてプログラムしてみましたが、どうもAD変換のサンプリング間隔の調整がわからずまた恐縮ですが、質問させていただきます。果たしてサンプリング間隔1msなのか?
以下にプログラムを表示します。Command2クリックでAD変換及びグラフ表示が始まります。

Private Sub Command2_Click()
Dim c As Integer
Dim value As Integer
Dim volts As Integer
ReDim times(100) As Long
ReDim values(100) As Integer

Timer1.enabled = True
Timer1.Interval = 1

Picture1.Left = Form1.ScaleWidth / 5
Picture1.Top = Form1.ScaleHeight / 55
Picture1.Width = Form1.ScaleWidth / 1.5
Picture1.Height = Form1.ScaleHeight / 1.03
Picture1.ScaleWidth = 7755
Picture1.ScaleHeight = 6675
Picture1.ScaleLeft = 0
Picture1.ScaleTop = 0
Picture1.Line (0, 4050)-(7755, 4050)

For c = 1 To 500
Picture1.PSet (x, y), RGB(255, 0, 0)

x = x + 1
  y = (volts) + 4000
   DoEvents
OLE1.object.Sheets("Sheet1").Cells(2 + c, "A").value = c
OLE1.object.Sheets("Sheet1").Cells(2 + c, "B").value = volts
Next c

End Sub

Private Sub Timer1_Timer()
   Dim value As Integer
   Dim volts As Integer
   Dim us As Long

   If opened And Command2_collect Then

  value = adc10_get_value()
  volts = adc_to_mv(value)
  
   End If
End Sub

- 関連一覧ツリー をクリックするとツリー全体を一括表示します)

古いスレッドにレスはつけられません。