Jump to content
Xtreme .Net Talk

mach278

Members
  • Posts

    4
  • Joined

  • Last visited

Personal Information

  • Visual Studio .NET Version
    Visual Basic .NET Enterprise

mach278's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for all the help guys, I got it to work! Nerseus, if you can provide any extra info, it would be great. Since I'm learning VB on my own through this forum and the couple of books I have, any extra info would be great! Thanks again!
  2. Hey guys, I was wondering if you could provide any tips for the following code I want to write. Basically, I'm building a serial interface with a microcontroller. The interface will read strings from the microcontroller and place the value in the appropriate status box. For example, the microcontroller will send 'A=100' telling me that 100 goes in the 'Amp' textbox. Right now, my code (located below) is capable of sending the right value to the right textbox, but only one string at a time. While values aren't going to be sent constantly, there may be times when the buffer may have more than one string. Say the buffer has "A=100, V=12, P=T, A=121, V=10, ....". How would I read the buffer and separate all the values between the commas? I would then need the separated terms to be put into a new variable for further parsing. I would appreciate any help you guys can provide. Thanks for all the help, this forum has really helped me learn VB on my own! Xavier Private Sub AxMSComm1_OnComm(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxMSComm1.OnComm Dim a() As String Dim Temp1, Temp2 As String Dim String1 As String If (AxMSComm1.CommEvent = 2) Then String1 = AxMSComm1.Input 'Save buffer into String1 'Split String1 where '=' is present a = Microsoft.VisualBasic.Split(String1, "=") Temp1 = a(0) 'Right side of '=' Temp2 = a(1) 'Left side of '=' If (Temp1 = "A") Then TextBox1.Text = Temp2 'Send to Amps TextBox ElseIf (Temp1 = "V") Then TextBox2.Text = Temp2 'Send to Volts TextBox ElseIf (Temp1 = "P") Then If (Temp2 = "T") Then 'If power is on... '...Put checkmark on Power status box CheckBox1.CheckState =CheckState.Checked ElseIf (Temp2 = "F") Then 'If power is off... '...Remove checkmark from Power status box CheckBox1.CheckState = CheckState.Unchecked End If End If End If
  3. Hey guys, I was hoping you could help me with the algorithm/code for what I want to do. Basically, I�m building an interface that will communicate with a microcontroller through the serial port. I already have serial communication working and can send and receive strings. However, I�m not sure how to do the following. Basically, let�s say the interface has two text boxes, TextBox A and TextBox B. Here�s my question: the microcontroller will be sending strings, such as �A=100� telling the program to put the value 100 in TextBox A and �B=105� to put 105 in TextBox B. Can anyone offer any tips on how to program the VB project to do this, send the string to its appropriate TextBox? Any help will be greatly appreciated. Thanks!
  4. Hey guys, I'm trying to learn visual basic.net on my own for a school project I'm doing. I've been reading some online tutorials but can't find an example of this. What I'm trying to do is make a very simple user interface. Here is one of the functions I need to do that I can't figure out: I have two text boxes, Box A and Box B. Under the boxes I have two buttons, Button A and Button B. I want to click on Button A, open an Input Box, enter a value, and have that value passed and displayed to Text Box A. So far I have the input box working fine and able to store the variable. How do I display this variable in the Text Box? Any help will be greatly appreciated! Thanks!
×
×
  • Create New...