VB Help


Closed Thread
Results 1 to 36 of 36

Thread: VB Help

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Quote Originally Posted by cncmachineguy View Post
    Are you sure?.
    Yeah - while patiently waiting for the long-promised Tibbo EM500/GA1000 firmware, I'm filling the time adding one more ConnectOne WiFi module to the Amicus18/Arduino/Xino shield. Any of three modules - 2 WiFi, 1 NoFi can be plugged into it. (I hope I have room for the EEPROM mackrackit's going to fill with AT codes.)
    Last edited by dhouston; - 30th May 2011 at 18:26.

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Dave, did you check your spam folder? Sometimes when I am long awaiting stuff, I find it went there. Hahahaha.

    Group- I feel like my interpretation of Walters post is prolly the best overall solution, but my root problem remains.

    How to setup a timer trigger? Maybe it is in the control toolbox? I will check there next.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Quote Originally Posted by cncmachineguy View Post
    ....How to setup a timer trigger? Maybe it is in the control toolbox? I will check there next.
    Select the TIMER control from the toolbox and drag it into your project. Click on the control to display its properties. Enable the TIMER and set its interval to whatever you want (in mS) - see below.

    Name:  TEST-6H.jpg
Views: 1514
Size:  27.6 KB

    Then code whatever you want to happen whenever a trigger occurs as in the example below.

    Code:
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            count = Val(Label1.Text) * 100
            count = count + 1
            HScrollBar1.Value = count
            Label1.Text = Format$(count / 100, "#0.00")
            NumericUpDown1.Value = count / 100
    
            count = Val(Label3.Text) * 100
            count = count + 1
            HScrollBar2.Value = count
            Label3.Text = Format$(count / 100, "#0.00")
        End Sub
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  4. #4
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Oh thank you rmteo! I had just found the timer, but didn't get the interval part. That works awesome!!

    Ok, now to convert those 2's complimented numbers to show negative values instead of 65533 and such.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  5. #5
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Hi cncmachineguy;

    To receive data from the serial port you should always use SerialPort Event Trigger like the one i posted.

    Code:
    Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
            Dim recepcao As String
     
            recepcao = SerialPort1.ReadExisting
     
            If recepcao = "%TE" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X - 1, rect.Y)
            End IF
    End Sub
    Don't use timers to poll the serial port, it is not very efficient!!

    If you want to send data to PIC, like a press of a button, then you can use the timer. just put the code that you have inside the button, inside of the timer, and choose the interval!

    I wrote this post in a little hurry, later i have more time and i came back here!
    Thanks and Regards;
    Gadelhas

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    Thanks gadelhas, point taken. Right now the pic is not allowed to send data unless asked for it. The pic side code is modified from the CDC for dummies thread. This part is working great. Thanks to all of you.

    Now for the next part (this seems like it should be easy, but of course not). The 18 bytes sent from the pic represent 9 words. From here on, I will just refer to 1 word. The rest will be the same action.
    Let's call them data(0) and data(1). To put them together I did this:
    Code:
    detain =(data(0)*256)+data(1))
    this works fine with 1 problem. It is really a signed number, so 65533 should read -2.
    I have tried all sort of ways to get here, but continue to fail. I am sure it has to do with dim as or the way I am putting the word back together, but I am at a loss.

    Anyone know how?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  7. #7
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    What do you receive from PIC, and what do you want to do, can you give me a full example, its just because english is not my native language, and perhaps i'm not understand something
    Last edited by gadelhas; - 30th May 2011 at 22:42.
    Thanks and Regards;
    Gadelhas

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: VB Help

    I never had any purpose to justify the use of signed<->unsigned conversion myself, but you may have a look at
    http://support.microsoft.com/kb/189323

    It's all about how you interpret/display the numbers... like Floating point in PBP... or show decimal on a LCD
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts