Search the web
Sign In
New User? Sign Up
ultimaserial_group · UltimaSerial Users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Use digital input to initiate excel capture 148u   Message List  
Reply | Forward Message #624 of 794 |
Re: Use digital input to initiate excel capture 148u

To use D0's state as the storage control, you can use Digital0 as
trigger channel and set the trigger mode to WhenAboveLevel:

Dim buffer(1000) As Integer
Dim diodir As Integer
Dim currentrow As Integer

Private Sub StartButton_Click()
'Clear the worksheet
For i = 0 To DQChart1.Xmax
ActiveSheet.Cells(i + 1, 1) = ""
Next i

currentrow = 1
UltimaSerial.Device = Val(List1.Text) 'Select the device
UltimaSerial.CommPort = Val(Combo1.Text) 'COM port
UltimaSerial.PChannel(0) = Ch01_SE
UltimaSerial.PChannel(1) = DIG_Chn 'without it, DIN is not available
UltimaSerial.AcquisitionMode = WhenAboveLevel
UltimaSerial.TriggerChannel = Digital0
UltimaSerial.ChannelCount = 2 'enable only one analog channel

UltimaSerial.SampleRate = Val(TextBox1.Text)

UltimaSerial.EventLevel = 2 'Chart it when we have 2 or more points.

UltimaSerial.Start

Label4.Caption = "Serial Number: " + UltimaSerial.SerialNumber

End Sub

Private Sub StopButton_Click()
UltimaSerial.Stop
End Sub

Private Sub UltimaSerial_DriverError(ByVal ErrorCode As Integer)
Label4.Caption = UltimaSerial.MapErrorMessage(ErrorCode)
End Sub

Private Sub UltimaSerial_NewData(ByVal Count As Integer)
'This will be called if we use NewData event to acquire data
V = UltimaSerial.GetData() 'Get data
DQChart1.Chart (V) 'Chart all channels

If IsEmpty(V) Then Exit Sub

For i = 0 To UBound(V, 2)
ActiveSheet.Cells(i + currentrow, 1) = Format$((V(0, i)) / 3276.8,
"0.00") 'extract the first channel
currentrow = currentrow + 1
If currentrow = 30 Then currentrow = 1
Next i

Label18.Caption = UltimaSerial.DigitalInput(Dig0)

End Sub

Private Sub UserForm_Activate()

List1.AddItem "150RS" 'Devices
List1.AddItem "151RS"
List1.AddItem "194"
List1.AddItem "195B"
List1.AddItem "190"
List1.AddItem "148U"
List1.AddItem "158U"
List1.AddItem "710U"
List1.AddItem "718U"
List1.AddItem "154RS"

Combo1.AddItem "1 - COM1" 'COM port
Combo1.AddItem "2 - COM2"
Combo1.AddItem "USB"

End Sub




--- In ultimaserial_group@yahoogroups.com, "throrope" <throrope@...>
wrote:
>
> I'm using a 148U to capture descrete readings from a hand held probe.
> The analog single provides a running graph of the output which will
> let me see when the signal is stable. Since I'm about 12 feet from
> the computer, "Aquire Data" button in the user form won't do. I'd
> like to use the status of D0 per a momentary switch to accomplish
> capture. I modified the code to do so, but a buffer or something
> fills and locks up excel.
>
> I tried to create a goto loop with the same result. And, for some
> reason the command button had to be actuated for the DI to take.
>
> I tried calling the aquire data sub from the start button, with more
> errors.
>
> Any suggestions?
>





Thu May 17, 2007 2:31 pm

xchen992000
Offline Offline

Forward
Message #624 of 794 |
Expand Messages Author Sort by Date

I'm using a 148U to capture descrete readings from a hand held probe. The analog single provides a running graph of the output which will let me see when the...
throrope
Offline Send Email
May 16, 2007
8:29 pm

To use D0's state as the storage control, you can use Digital0 as trigger channel and set the trigger mode to WhenAboveLevel: Dim buffer(1000) As Integer Dim...
xchen992000
Offline
May 17, 2007
2:33 pm

Whoa! This is over the top. I did a work around in the meantime, but this sure opens possibilities. Thank You!!! ... available ... points. ... 3276.8, ... ...
throrope
Offline Send Email
May 17, 2007
4:48 pm

With the latest version and the following codes, you may log one data point, along with timestamp, to the excel sheet whenever D0 goes high: Private Sub...
ultimaserial
Offline
May 22, 2007
4:06 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help