Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Poll

Is better to programming in:

Perl
0 (0%)
Oracle
0 (0%)

Total Members Voted: 0

Author Topic: Command for Com Port  (Read 3962 times)

0 Members and 1 Guest are viewing this topic.

evilmanu

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Unknown
    Command for Com Port
    « on: March 28, 2011, 07:04:30 AM »
    Hi,
    I'm writing a program for counting bills in VB.net. I'm using L70 of CTS Electronic device for read the bills (OCR scanner) and it's connected over Com Port. I need to find a command to start "read". It can be reprogrammed to read automatically when sensor recognize a bill, but, for a external proprietary software, cannot do that.

    Thanks
    Manuel

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Command for Com Port
    « Reply #1 on: March 28, 2011, 10:50:49 AM »
    I did not vote because I do not understand why you can not do it all inside of VB.net,
    - am I missing something?
    I do believe there is a method of dealing with COM port events in VB.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Command for Com Port
    « Reply #2 on: March 28, 2011, 01:20:17 PM »
    http://www.dreamincode.net/forums/topic/37361-serial-port-communication-in-vbnet/

    Should work for .NET 2.0, 3.0, 3.5, or 4. I haven't had to use Serial Port communications ever, let alone in .NET and particularly not in VB.NET since I haven't used it more then a few minutes for a few general questions elsewhere on the forum.

    I did not vote because I do not understand why you can not do it all inside of VB.net,
    I didn't vote because the poll is pointless and probably not intentional. But of course they can do it all outside VB.NET. they could also write the program in python without wearing any pants or without using the JVM. Absolutely none of those arbitrary constraints helps them achieve their goal of  reading bills via OCR.
    Quote
    - am I missing something?
    you missed this piece:

    Quote
    I'm writing a program for counting bills in VB.net.
    Therefore, assistance should be provided for VB.NET, and not you rambling about your inability to understand why they don't use assembly or some nonsense.
    I was trying to dereference Null Pointers before it was cool.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Command for Com Port
    « Reply #3 on: March 28, 2011, 04:27:45 PM »
    I was not going to suggest assembly. For control of the serial port it can be a DOS program like QBASIC. The commercial version of QBASIC would handle com port events in real time. I used it to parse a X.25 feed feed from  a communications Satellite many years ago.  The current version of VB should have the equivalent thing.

    I am guessing here, but I think he wants a program to respond in real time. So it has to be event-driven, not just any sort of program to read data from the port. Of course, you can use port-polling, but that means the CPU will suffer a big performance hit. It may not mufti task well with port polling. Instead, it should be interrupt driven.
    Maybe the OP will clarify.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Command for Com Port
    « Reply #4 on: March 28, 2011, 04:42:41 PM »
    I was not going to suggest assembly. For control of the serial port it can be a DOS program like QBASIC.
    It could also be VB.NET. or C#. or Python, or VBScript. What is it with you and suggesting they use antiquated tools?

    Quote
    The commercial version of QBASIC would handle com port events in real time.
    There was no commercial version of QBASIC. there was QuickBASIC. I hope you aren't suggesting they pirate a  copy?

    VB.NET is hardly even close to QuickBASIC, except that it has some similar syntax. It's like comparing C to Javascript at this point.


    I was trying to dereference Null Pointers before it was cool.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Command for Com Port
    « Reply #5 on: March 28, 2011, 04:55:05 PM »
    You say Tomato,
    I say Eggplant.  ;D
    Here is common usage:
    Quote
    For some people...
    "QuickBasic is a product of Microsoft Corporation. It contains quite a lot of commands that can help in creating software programs and games. The only limit is your imagination. These commands, like any other languages, are typed in QB environment line by line to be compiled by the compiler and then executed... thus creating an output. QB Programs are made out of many many lines of commands or codes that are typed inside QB to be executed."

    And for others...
    "QBasic is Microsoft's version of the popular BASIC programming language. BASIC stands for Beginners' All-purpose Symbolic Instruction Code. The Q in QBasic stands for Quick. There are many different versions of BASIC but most have become obsolete. GW-BASIC and BASICA are two examples."

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Command for Com Port
    « Reply #6 on: March 28, 2011, 06:04:23 PM »
    QuickBASIC is the commercial product.

    QBASIC is the free interpreter provided with MS-DOS 5 and later to replace GW-BASIC and BASICA from previous versions.

    QBASIC & QuickBASIC are both obsolete. There is no commercial version of QBASIC, just as there is no commercial version of DIR or SORT.

    And no, the ability to use OPEN "COM" statements is not in VB.NET, since you don't open files using file numbers and OPEN statements anymore.
    I was trying to dereference Null Pointers before it was cool.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Command for Com Port
    « Reply #7 on: March 28, 2011, 06:41:45 PM »
    I did not vote because I do not understand why you can not do it all inside of VB.net,
    - am I missing something?
    I do believe there is a method of dealing with COM port events in VB.
    This was my original post. Still I would like to know why he wants to use some program tool outside of what you can do with some version of VB. Either VB NET or VB 2005. The is an event handler for the serial port (com port)  in VB. And it has been thee for awhile. Current syntax is something about a delegate of an event.  8)

    One of many references...
    http://forums.asp.net/t/1132953.aspx/1

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Command for Com Port
    « Reply #8 on: March 28, 2011, 07:04:21 PM »
    oh, apologies, I read your original reply as outside, rather then inside.
    I was trying to dereference Null Pointers before it was cool.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Command for Com Port
    « Reply #9 on: March 28, 2011, 07:09:40 PM »
    Thank you.  :-*

    evilmanu

      Topic Starter


      Newbie

      • Experience: Beginner
      • OS: Unknown
      Re: Command for Com Port
      « Reply #10 on: April 01, 2011, 06:12:02 AM »
      From Port Monitor program I got a HEX from monitoring com port device on command "read". How can I use that HEX in vb.net button? need to convert it?

      will attach LOG of port monitor

      [recovering disk space - old attachment deleted by admin]