Automatic VB6 to pic serial connection


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    I think that the new IDE can accept the old DLL's from the VB6 for example and use the old controls too. A friend of mine said he just open the libraries and workd ok.

    I cannot test this as I got rid off the monster!

    Also said that the old syntax is acceptable too (may be with some trick though).

    By the way, Steve, is there a way to access a bit in a variable array in PBP? I meen for example like this: array[7].4=1

    I know the link of Melanies that is accessing as an array of bits the whole byte array, but is not easy to remember the 267th bit!

    I overcome this by reloading the array byte to a variable and then back to array again.

    Ioannis

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    is there a way to access a bit in a variable array in PBP? I meen for example like this: array[7].4=1
    If you're really using constants as shown, then you can alias the location and access the individual bit
    Code:
    TheByte  VAR array(7)
    
    TheByte.4 = 1
    But you probably want variables for both the byte and bit index's ...
    Code:
    ByteIDX  VAR BYTE
    BitIDX   VAR BYTE
    
    ByteIDX = 7
    BitIDX = 4
    
    array.0((ByteIDX<<3)+BitIDX) = 1
    DT

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    Hey, look ma, how we can things more complicate!!!

    OK, thanks for the tips Darrel. The second is clever, but I suppose it is cpu power hungry.

    I 'll take the first, thank you!

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    I know the link of Melanies that is accessing as an array of bits the whole byte array, but is not easy to remember the 267th bit!
    It's simple enough to keep track of bytes & bits using the Division (/) and Modulus (//) operators.

    267 / 8 = 33
    267 // 8 = 3

    33 * 8 + 3 = 267

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    Thanks for the tip Dave.

    Ioannis

Similar Threads

  1. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  3. PIC to serial with visual basic
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 31st March 2007, 16:06
  4. PIC to PIC serial resistor?
    By RYTECH in forum Serial
    Replies: 0
    Last Post: - 5th September 2006, 15:46
  5. serial comm from Pic to STAMP
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th April 2004, 23:58

Members who have read this thread : 2

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