Assistance Required with VB.net


Closed Thread
Results 1 to 33 of 33
  1. #1
    malc-c's Avatar
    malc-c Guest

    Default Assistance Required with VB.net

    Guys, I'm looking for someone who has good knowledge of VB.net (2008 Express version). I've downloaded VB Express 2008 edition from MS but haven't really got a clue how to get an application to read and write via the RS232 port.

    Designing a form was simples (the boxes are simple typed values on how I would like the end result to look)


    I've managed to send the values from the list of variables to a terminal app in MCS via the EasyPIC5 serial port, but can't get my head round any example from the web on serial communications.

    If anyone can point me to some easy to understand tutorials, or would be willing to work with me via e-mail on this part of my project please feel free to drop me a PM.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This came up the other day and Darrel pointed to this
    http://www.rentron.com/VisualBasic.htm
    Maybe it works the same with VB Net?
    Dave
    Always wear safety glasses while programming.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave,

    I'll have a look at it in some detail in a moment, but on first glance it looks like VB6 rather than the (dot)net version. From my googling sessions it seems that earlier versions of VB had a serial comms module or connection to variables that is somewhat missing in the dotnet version !

  4. #4


    Did you find this post helpful? Yes | No

    Default can vb.net be discussed here ?

    nice interface you made.
    just for general discussion,
    I have made a vb.net form to rcv assorted stuff from pic, you may know more about microsoft .net than me, I have just read books and watched on-line learning vids.
    as a start, you use a serial port object, a stream object, I used a timer to check for rcvd chars 10 or 50 times/sec then looped through data for a key-value situation. then displayed to appropiate box. was able to use a blue-tooth module set up as virtual com port to rcv just like a direct connect.
    also, with serial port set up, it is easy to send stuff back to my PIC ckt as settings or commands. i have further ideas floating in my head (mabye sinking in my head) web stuff etc.
    not sure if the forum wants this subject matter here but my initial interest was and is PIC interfacing .
    don f
    [email protected]

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I moved this thread to the "Off Topic" area.
    As long as this discussion is about interfacing to a MCU I think it is "OK" to discuss VB here.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I moved this thread to the "Off Topic" area.
    As long as this discussion is about interfacing to a MCU I think it is "OK" to discuss VB here.
    Are there limits to the "off topic" topics?

  7. #7
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    I could understand if I was after help with writing a VB application to read a database or something equally obscure, but this is related to sending and receiving data to and from a PIC, or more importantly how to formulate VB code and PBP code so that the two work together.

    Don, what you have mentioned has given me some idea as to what I need. If you have any links to those tutorials it would be appreciated

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tenaja View Post
    Are there limits to the "off topic" topics?
    It has always been my understanding that the "Off Topic" area is for forum "things", electronics questions, and any other "thing" not specific to PB or PBP but in a round about way related to PB or PBP or the forum.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi;

    I think i can help, however you need to be more clear about your issue.
    I I'll put here some code,

    VB2008 Net Code;
    First you need to add the serilport class to your project.
    Code:
    Public Class Form1
        Dim WithEvents SerialPort1 As New IO.Ports.SerialPort
    Then, at Form Load, you need to configure and open your SerialPort;
    Code:
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            SerialPort1.PortName = "COM1"
            SerialPort1.Parity = IO.Ports.Parity.None
            SerialPort1.BaudRate = 19200
            SerialPort1.DataBits = 8
            SerialPort1.StopBits = 1
            SerialPort1.Open()
            SerialPort1.Write(Chr(13) & "Hugo Oliveira" & Chr(13))
        End Sub
    This handles the recetion from the buffer of the com port, and then i have a If statment to do the actions that need to be perfomed acording with the received data.
    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)
            ElseIf recepcao = "%TD" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X + 1, rect.Y)
            ElseIf recepcao = "%TC" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y - 1)
            ElseIf recepcao = "%TB" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y + 1)
            ElseIf recepcao = "%TE1" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X - 10, rect.Y)
            ElseIf recepcao = "%TD1" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X + 10, rect.Y)
            ElseIf recepcao = "%TC1" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y - 10)
            ElseIf recepcao = "%TB1" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y + 10)
            ElseIf recepcao = "%TE2" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X - 20, rect.Y)
            ElseIf recepcao = "%TD2" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X + 20, rect.Y)
            ElseIf recepcao = "%TC2" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y - 20)
            ElseIf recepcao = "%TB2" Then
                GetCursorPos(rect)
                SetCursorPos(rect.X, rect.Y + 20)
            End If
        End Sub

    With this piece of code in VB, you must with 100% sure, receive data from Com Port.

    Where is a part of code, from sendinf the data out of the pic, in PBP. I use the Debug command, but you can use Hserout, if you are using te Uart of the PIC, or Serout, Serout2 command.
    Code:
    Main:
    if JX>70 and JX<=100 then
       DEBUG "%TE"
       pause 20
      endif
      
       if JX>0 and JX<=70 then
       DEBUG "%TE1"
       pause 20 
      endif 
      
      if Jx>180 and Jx<210 then
       DEBUG "%TD"
       pause 20
      endif 
      
      if Jx>=210 then
       DEBUG "%TD1"
       pause 20
      endif
    '                             JoyStick Eixo Y
    ' ====================================================================  
      if JY>70 and JY<=100 then
       DEBUG "%TB"
       pause 20 
      endif
      
      if JY>0 and JY<=70 then
       DEBUG "%TB1"
       pause 20 
      endif  
      
      if Jy>180 and Jy<210 then
       DEBUG "%TC" 
       pause 20
      endif
      
      if Jy>=210 then
       DEBUG "%TC1" 
       pause 20
      endif    
    '                             Axis -  Eixo X
    ' ====================================================================
      if Ax<100 then
       DEBUG "%TE2"
       pause 20 
      endif
      
     if Ax>140 then
       DEBUG "%TD2" 
       pause 20
      endif
    '                             Axis -  Eixo Y
    ' ====================================================================  
      if Ay<110 then
       DEBUG "%TB2" 
       pause 20
      endif
      
      if Ay>140 then
       DEBUG "%TC2" 
       pause 20
      endif
    '                             Botões
    ' ====================================================================    
      IF BE = 0 then
       DEBUG "%RL1" 
       pause 80
      endif
    
      IF BD = 0 then
       DEBUG "%RD1" 
       pause 80
      endif    
    goto Main
    Hope it can hep.

  10. #10
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Here are two additions from me:

    Code:
    ComboBox1.Items.AddRange(SerialPort1.GetPortNames())
    This way, you can get the available comports (port list) from your PC hardware directly into a combo box.

    Then,
    Code:
    SerialPort1.PortName = ComboBox1.SelectedItem
    This way, you can select a com port (if there is one).

    Try all of these operations in try/catch so that if a comport is not available, you can prompt a message to the user.
    Also, if there is comport but not selected in combobox, you can also catch it and prompt to the user.


    ----------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  11. #11
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default Thanks.

    Guys, thanks for the assistance, I'll have a play when I get home from work

    Much appreciate

  12. #12
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I'm trying to send data from PIC - PC using the program mackrackit pointed to earlier in this thread.

    http://www.rentron.com/receiving_data.htm

    When I compile it I have this error message: Name 'comEvReceive' is not declared.

    Does anyone have an idea of a fix (with as much of an explaination as you can spare please, I'm new to this). I've done lots of Googling with various answer from 'Select Case' to it can't be done in the 2008 VB-Version.

    Code:
     Private Sub MSComm1_OnComm()
    Dim sData As String ' Holds our incoming data
    Dim lHighByte As Long   ' Holds HighByte value
    Dim lLowByte As Long    ' Holds LowByte value
    Dim lWord As Long       ' Holds the Word result
    
    ' If comEvReceive Event then get data and display
    If MSComm1.CommEvent = comEvReceive Then
    
        sData = MSComm1.Input ' Get data (2 bytes)
        lHighByte = Asc(Mid$(sData, 1, 1)) ' get 1st byte
        lLowByte = Asc(Mid$(sData, 2, 1))  ' Get 2nd byte
        
        ' Combine bytes into a word
        lWord = (lHighByte * &H100) Or lLowByte
        
        ' Convert value to a string and display
        lblRCTime.Caption = CStr(lWord)
        
    End If
    End Sub
    I guess I should add I'm using Visual Basic 2008 Express Edition.

    Any help much appreciated.

    Dave
    Last edited by LEDave; - 27th August 2010 at 16:13.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LEDave View Post
    Hi,

    I guess I should add I'm using Visual Basic 2008 Express Edition.

    Dave
    Hi,

    The code posted is VB6 and you are using VB2008.
    Try the code in the post 9, of this thread!
    Thanks and Regards;
    Gadelhas

  14. #14
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Here's my attempt to modify the code from gadelhas's post above. My FORM has two push buttons, one opens the COM1 PORT the other closes it. I can't get it to show any data in the ListBox1 though from the PIC. The PIC code (shown below) outputs a RANDOM BYTE.

    Any Ideas? Anyone?

    Code:
    Public Class Form1
        Dim WithEvents SerialPort1 As New IO.Ports.SerialPort
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            SerialPort1.PortName = "COM1"
            SerialPort1.Parity = IO.Ports.Parity.None
            SerialPort1.BaudRate = 2400
            SerialPort1.DataBits = 8
            SerialPort1.StopBits = 1
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If SerialPort1.IsOpen = False Then SerialPort1.Open()
            If SerialPort1.IsOpen = True Then MsgBox("com1 port opened sucessfully")
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            If SerialPort1.IsOpen = True Then SerialPort1.Close()
            If SerialPort1.IsOpen = False Then MsgBox("com1 port closed sucessfully")
    
        End Sub
    
        Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
            Dim recepcao As String
    
            recepcao = SerialPort1.ReadExisting
    
    
    
        End Sub
    
    
        Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
            SerialPort1.Write(ListBox1.Text)
    PIC code:

    Code:
    A VAR WORD
    X VAR WORD
    Y VAR WORD
    Z VAR BYTE
    
    main:
    Random A
    Y = A * 100
    X = DIV32 25700
    LET Z = X
    
    SEROUT2 PORTC.3, 16780, [DEC z, 10, 13]
    pause 4000
    GOTO MAIN

  15. #15
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Here's another program which does receive the same data from the PIC. Only it displays it vertically instead of in BYTES across the ListBox. Anyone know how to modify this to display the BYTES properly?

    This is how the data appears in the ListBox v's the serial Communicator which displays them properly.

    Code:
    VB has the numbers
    1
    3
    5
    *
    *
    2
    0
    3
    *
    And Serial Communicator has them
    135
    203
    Here's the program, this maybe the one to adapt / work on as it's nearly there:

    Code:
    Imports System
    Imports System.ComponentModel
    Imports System.Threading
    Imports System.Windows.Forms
    
    
    Public Class Form1
    
    
        'Buffer for receievd data***
    
        Private Delegate Sub AddListBoxItemInvoker(ByVal item As Object)
    
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            SerialPort1.PortName = "COM1"
            SerialPort1.Parity = IO.Ports.Parity.None
            SerialPort1.BaudRate = 2400
            SerialPort1.DataBits = 8
            SerialPort1.StopBits = 1
    
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            If SerialPort1.IsOpen = False Then SerialPort1.Open()
            If SerialPort1.IsOpen = True Then MsgBox("com1 port opened sucessfully")
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            If SerialPort1.IsOpen = True Then SerialPort1.Close()
    
            If SerialPort1.IsOpen = False Then MsgBox("com1 port closed sucessfully")
    
        End Sub
    
        
    
        Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
    
            Me.AddListBoxItem(SerialPort1.ReadExisting)
    
    
        End Sub
    
        Private Sub AddListBoxItem(ByVal item As Object)
    
            If Me.ListBox1.InvokeRequired Then
                'We are on a secondary thread so delegation is required.
                Me.ListBox1.Invoke(New AddListBoxItemInvoker(AddressOf AddListBoxItem), (item))
    
            Else
                'We are on the primary thread so add the item.
                Me.ListBox1.Items.Add(item)
            End If
        End Sub
    End Class
    Thanks for any help.

    Dave

  16. #16
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,
    When you use something like this (and z is 135):
    Code:
    SEROUT2 PORTC.3, 16780, [DEC z, 10, 13]
    The PIC actually sends 5 bytes, not one (or three). It sends "1", "3", "5", (CR), (LF) that's why your VB program displays them one by one (because you read them from the serial buffer one by one).

    What is being sent is the ASCII codes for the digits 1,3,5 so what is actually being transmitted is 49, 51, 53, 10, 13 where 49 means the digit 1, 51 means the digit 3 and so on.

    If you remove the DEC modifer what is being sent is three bytes ie. 135,10,13 but now it's likely the VB program will fill the listbox with a little c with a hook below it (the character that corresponds to ASCII code 135).

    If you want the number (135) to be a "value" in VB (and not one or more text strings) then you need to read it as such - or convert it. My VB isn't up to speed (never has been) but I think there's something like
    Code:
    DIM myValue as Integer
    myValue = SerialPort1.ReadByte
     ' OR
    myValue = SerialPort1.ReadChar
    Then you populate your listbox with something like
    Code:
    Me.AddListBoxItem(myValue.ToString)
    In this case the ToString basically does for VB what the DEC modifer does for PBP, ie. it converts the value of 135 (a single byte) into the ASCII representation of each digit, "1", "3", "5".

    My VB syntax may not be correct in this example but I think you get the gist of it.

    /Henrik.

  17. #17
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    Thanks for that as ever.

    Really good explanation there. I'll have a look at it this evening and try and get it working properly.

    Again many thanks.

    Dave

  18. #18
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    Success, but..........!

    First of all the success. I changed the PIC code to:

    Code:
    SEROUT2 PORTC.3, 16780, [ z]
    Then changed this line in the VB program:

    Code:
     Me.AddListBoxItem(SerialPort1.ReadExisting)
    To:

    Code:
    Me.AddListBoxItem(SerialPort1.ReadByte)
    And away it went reading and displaying Random Bytes, brilliant

    Now for the but part. I actually want the VB program to read a WORD sent from the PIC (a short in VB?) however for the AddListBoxItem(SerialPort1.Readxxxx there is:

    ReadByte
    ReadChar
    ReadExisting
    ReadLine
    ReadTo

    No ReadShort

    Now I'm thinking somehow it's send a High Byte from the PIC then a Low Byte and join them together in VB, unless there's a 'ReadShort' option.

    Dave
    Last edited by LEDave; - 9th September 2010 at 23:01.

  19. #19
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,

    Nope, a word is two bytes and you have to treat like that.

    The serial port object has a RecevieThreshold property that you can use to fire the Receive event only when so many characters has arrived. If you set it to 2 it will fire every time there's two bytes in the buffer, then you can do something like:
    Code:
    myHighByte = SerialPort1.ReadByte
    myLowByte = SerialPort1.ReadByte
    Then you have to put them back together with something like
    Code:
    Me.AddListBoxItem((myHighByte * 256 + myLowByte).ToString)
    That's ONE way and it'll probably work if "all" your doing is sendning a word over at certain intervals.

    /Henrik.

  20. #20
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    Thanks for that, Ill get on it tonight.

    Good to get the program receiving and displaying Bytes correctly though.

    Dave

  21. #21
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    Quick question:

    The serial port object has a RecevieThreshold property
    In VB6 it does but does it in VB2008?

    Dave

  22. #22
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi,Mine does....but it's called ReceivedBytesThershold, by default it's set to 1.

    I told you my syntax might be off ;-)

    /Henrik.
    Attached Images Attached Images  
    Last edited by HenrikOlsson; - 10th September 2010 at 17:09. Reason: I don't get this new editor....

  23. #23
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    So does mine and I've set it to two

    How did you copy yours and make it an attachment?

    Dave

  24. #24
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  25. #25
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Me too

    A really useful little program

    Dave
    Attached Images Attached Images  

  26. #26
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Not sure what happened then. I went to edit and ended up posting twice, sorry.

    Dave

  27. #27
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Well the VB program now displays WORD size output, see attachment

    I'm not sure about what I'm going to type next (nothing new there then they all shout ) But I'm outputting a Random WORD from the PIC, however do I need to send the WORD out as HighByte - LowByte so the VB program reads it correctly? Or is the WORD sent in the right order from the PIC (Byte-wise) for the VB program to read it properly.

    As ever thanks for your help you two.

    Almost forgot, my 'Greenshot' seems to have gone a bit mad on the resolution front, any ideas? (Correction the resolution on my pc has gone mad, it looks fine on here).


    Dave
    Attached Images Attached Images  
    Last edited by LEDave; - 10th September 2010 at 23:41.

  28. #28
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,
    You must send the WORD one byte at the time. Doing HSEROUT [myWORD] will only send the low byte.

    If you send the high or the low byte first doesn't really matter - it's up to you - as long as you write the VB code to match.

    As for the screenshot thing, Win7 have screencapture tool built in, you just drag a box around the area you want to capture and you're done.

  29. #29
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    If you send the high or the low byte first doesn't really matter - it's up to you - as long as you write the VB code to match.
    That'll be an interesting exercise to do it both ways, Ill have a go.

    As for the screenshot thing, Win7 have screencapture tool built in, you just drag a box around the area you want to capture and you're done.
    I'm still on Xp. Interesting point / question, does PBP only work on a 32bit machine? Al ot of new laptops run 64bit so maybe PBP wouldn't work on one anyway?

    Dave

  30. #30
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    One of my machines is Win7 64 bit.
    No problems here.
    Dave
    Always wear safety glasses while programming.

  31. #31
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,
    I don't think you should have any trouble figuring out how reverse the order of the bytes...

    PBP runs fine on 64bit versions of Windows but you must use MPASM as the assembler, PM does not work. MicroCodeStudio needed a little convincing before it ran here, Charles Leo and Darrel helped me figure out what was going on and I see that Darrel wrote up a nice Wiki article about it too!

    /Henrik.

  32. #32
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    PBP runs fine on 64bit versions of Windows but you must use MPASM as the assembler, PM does not work. MicroCodeStudio needed a little convincing before it ran here, Charles Leo and Darrel helped me figure out what was going on and I see that Darrel wrote up a nice Wiki article about it too!
    Good to know. Ill have to track the article down.

    Win7 and 64bit.....Mmm...I like the sound of that....One day

  33. #33
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Well I'll stick my neck out ans say it works

    I made a word - Byte test program (code below) to test for a word and byte being sent from the PIC and received by the VB program.

    Code:
    DEFINE OSC 4
    
    X VAR WORD
    Y VAR WORD
    Z VAR WORD
    A var byte
     
     main
    
     For a = 1 to 10
     
     let x  = 65000
     let y  =  101
     let z  =  255
    
    
    Serout2 PORTC.3,16780,[ x.HighByte, x.LowByte]
    PAUSE 50
    Serout2 PORTC.3,16780,[ Y.HighByte, Y.LowByte]
    PAUSE 50
    Serout2 PORTC.3,16780,[ z.HighByte, Z.LowByte]
    pause 1500
    next a
    STOP
    Here's what the VB Form received, what do you think?:
    Attached Images Attached Images  

Members who have read this thread : 1

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