15,904,339 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12292743 (Top 43 by date)
Member 12292743
4-Nov-16 10:58am
View
yes
Member 12292743
4-Nov-16 4:44am
View
1) mysql
2) vb 2010
3) optris ct sensor
4) sensor connected to computer via USB
Member 12292743
3-Nov-16 11:46am
View
"You make the connection to your database from your application"
okay so how can I go about doing this?
Member 12292743
4-Oct-16 4:57am
View
yeah to get the actual value, subtract 1000 from 1213 and then divide by 10
Member 12292743
4-Oct-16 4:28am
View
okay, I want to know how to get 1213 in TExtbox1, then i can get the temperature from there
Member 12292743
29-Sep-16 8:22am
View
okay finally ive got something in the textbox! however i want it to be the case that each time you press the connect button a new reading appears. At the moment, I select the comport, press the connect button, a reading appears, then I have to press the disconnect button and then repeat for my second reading.
Also the previous reading does not get replaced by the current reading, in fact they appear alongside each other in the textbox, which is not what I want
Member 12292743
27-Sep-16 4:25am
View
what do you reckon it should be initialised as? what data type?
Member 12292743
27-Sep-16 3:52am
View
urgrnt - hopefully will see something meaningful to me in the textbox in a (roughly) couple of hours time?
Member 12292743
27-Sep-16 3:49am
View
When copying the code over and checking the question for submission, I think I introduced that mistake. But in my code, all q's are lower case.
So thats not it I'm afraid
Member 12292743
21-Sep-16 4:58am
View
is it possible for you to show me an example of what you mean?
Member 12292743
21-Sep-16 4:47am
View
sorry to be a pain guys, but i have implemented your suggestion and still nothing happens.
I noticed something strange, i put a breakpoint in the scrolldata function and when and step through and go line by line, an error message appears on this line:
SerialPort1.Write(outData, 0, 1)
telling me the port is closed.
I tried inserting SerialPort1.open() before but another error message appeared saying that the port was already open?
What do I do
Member 12292743
20-Sep-16 16:14pm
View
how do i check if BytesToRead has the right value?
Member 12292743
20-Sep-16 8:39am
View
if i am right about the reading of more than 1 byte, how do i implement that into my code
Member 12292743
20-Sep-16 8:38am
View
but nothing changes in tbRx in which I want a temp value to be seen
Member 12292743
15-Sep-16 11:12am
View
also there is a discrepancy between what i want to write (bytes) and what i want to read( also bytes). How do I go about fixing that?
Member 12292743
15-Sep-16 9:33am
View
also there is a discrepancy between what i want to write (bytes) and what i want to read( also bytes). How do I go about fixing that?
Member 12292743
15-Sep-16 8:07am
View
will try to understand the fundamentals of debugging, thanks
Member 12292743
15-Sep-16 8:07am
View
ahh right that makes sense, thanks
Member 12292743
15-Sep-16 6:36am
View
yeah i typed the code in, dont ask why, it is "IsOpen" in the actual editor
Member 12292743
15-Sep-16 6:34am
View
haha no problem
Member 12292743
15-Sep-16 6:28am
View
its the comment in btn Connect sub
Member 12292743
1-Sep-16 9:55am
View
2 errors have appeared now.
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
‘When our form loads, auto detect all serial ports in the system and populate the cmbPort Combo box.
myPort = IO.Ports.SerialPort.GetPortNames() ‘Get all com ports available
cmbBaud.Items.Add(9600) ‘Populate the cmbBaud Combo box to common baud rates used
cmbBaud.Items.Add(19200)
cmbBaud.Items.Add(38400)
cmbBaud.Items.Add(57600)
For i = 0 To UBound(myPort)
cmbPort.Items.Add(myPort(i))
Next
cmbPort.Text = cmbPort.Items.Item(0) ‘Set cmbPort text to the first COM port detected
cmbBaud.Text = cmbBaud.Items.Item(0) ‘Set cmbBaud text to the first Baud rate on the list
btnDisconnect.Enabled = False ‘Initially Disconnect Button is Disabled
End Sub
Option strict on disallows late binding (port(i) has been highlighted
SECOND ERROR
Private Sub ReceivedText(ByVal [text] As String)
‘compares the ID of the creating Thread to the ID of the calling Thread
If Me.rtbReceived.InvokeRequired Then
Dim x As New SetTextCallback(AddressOf ReceivedText)
Me.Invoke(x, New Object() {(text)})
Else
Me.rtbReceived.Text &= [text]
End If
End Sub
ReceivedText has been underlined and this error message is shown
Option Strict on doesnt allow narrowing in implicit type conversions between PRivate Sub receievedtext(text as String) and delegate delegate Sub SetTextCallback(text as Byte)
Member 12292743
1-Sep-16 8:40am
View
sorry I meant to say hex not integer
Member 12292743
31-Aug-16 4:42am
View
yeah haha i doubt it, havent compiled. WHat do I need to add/change?
Member 12292743
31-Aug-16 3:54am
View
So would this work??
Imports System.IO.Ports
Public Class Form1
Dim ComPort As New SerialPort("COM1", 9600, Parity.None, 8, 1)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComPort.Open()
End Sub
Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
Dim sendArray() As Byte = New Byte() {&H01, &H0, &H0, &H0, &H0, &H0, &H0, &H0}
ComPort.Write(sendArray, 0, 8)
End Sub
Public Function Read (
buffer As Byte(),
offset As Integer,
count As Integer
) As Integer
End Class
Member 12292743
31-Aug-16 3:44am
View
awesome, one more question. How do I get the data recieved from the port to be written in a textbox?
Member 12292743
30-Aug-16 11:18am
View
okay i understand. However how do I go about writing the function to receive hex?
Member 12292743
30-Aug-16 11:03am
View
is the cmdSend Sub looking okay?
Member 12292743
30-Aug-16 11:03am
View
yeah i've edited the question
Member 12292743
25-Aug-16 5:34am
View
Many thanks
Member 12292743
25-Aug-16 4:15am
View
I've put up a link to info about the sensor (it's a list of commands)
Member 12292743
25-Aug-16 4:15am
View
I've put up a link to info about the sensor (it's a list of commands)
Member 12292743
25-Aug-16 4:15am
View
I've put up a link to info about the sensor (it's a list of commands)
Member 12292743
31-Jan-16 10:48am
View
Okay a different question
Which of those are related to databases
Member 12292743
28-Jan-16 16:40pm
View
Don't use DEFINE when you don't have to. Use constants instead or better yet enumeration.
Member 12292743
28-Jan-16 16:39pm
View
Deleted
int solution (int N)
{
int max = 0;
int mask = 0x80000000;
int i = 0;
// Find the first 1.
for (; i
Member 12292743
28-Jan-16 16:38pm
View
Deleted
int solution (int N)
{
int max = 0;
int mask = 0x80000000;
int i = 0;
// Find the first 1.
for (; i
Member 12292743
28-Jan-16 13:51pm
View
Wow many thanks for your reply. I know other users aren't supposed to do my work for my nor did I expect them to do it, but I appreciate you going out of your way to do it. Thanks
Member 12292743
28-Jan-16 8:26am
View
What is the reason behind using the shift operator when skipping bits 'N>>=1'?
Member 12292743
28-Jan-16 8:19am
View
Oh my bad I was mixing up two problems.
Member 12292743
28-Jan-16 8:11am
View
One number as opposed to an array of numbers
Member 12292743
28-Jan-16 7:43am
View
Okay so I read up on bit masking and it's starting to make sense.
Let's look at a simpler problem: how would I find the largest binary gap for one number?
I appreciate your help btw
Member 12292743
28-Jan-16 6:15am
View
How does one apply a mask to a value?
Show More