|
-
Feb 8th, 2010, 12:14 PM
#1
Thread Starter
New Member
[Newbie Question] Loop Problem
I am developing a GUI for a device called LabJack to get streaming data of UV light intensity.
Code:
For i = 0 To numScansToDisplay - 1
For j = 1 To numChannel
testdata = Format(adblData(j - 1 + (numChannel * i)), "#.####") + ","
data = data + testdata
Next j
data = CStr(TimeValue(Now)) + data + vbCrLf
Next i
RichTextBox1.Text = RichTextBox1.Text + data
This is the result i get
4:31:41 PM4:31:41 PM4:31:41 PM4:31:41 PM-.0005,4.9894,-.3128,-.3178,
-.0005,4.9843,-.3758,-.3909,
-.0005,4.9843,-.411,-.4211,
-.0005,4.9843,-.401,-.4236,
4:31:42 PM4:31:42 PM4:31:42 PM4:31:42 PM.002,4.9843,-.3959,-.4262,
-.0005,4.9818,-.4236,-.4362,
-.0005,4.9818,-.3959,-.4262,
.002,4.9793,-.4236,-.4312,
But if i change the code to
Code:
data = data + CStr(TimeValue(Now)) + vbCrLf
The results are
-.0005,4.9894,-.3128,-.3178,4:31:41 PM
-.0005,4.9843,-.3758,-.3909,4:31:41 PM
-.0005,4.9843,-.411,-.4211,4:31:41 PM
-.0005,4.9843,-.401,-.4236,4:31:41 PM
In fact, what i am trying to get is:
4:31:41 PM,.002,4.9843,-.3959,-.4262,
4:31:41 PM,-.0005,4.9818,-.4236,-.4362,
4:31:41 PM,-.0005,4.9818,-.3959,-.4262,
4:31:41 PM,.002,4.9793,-.4236,-.4312,
I have tried numeours codes but i have no idea how to do it 
Thanks for help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|