×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

A question for VB serial port COM1 programming

who have ever used hyper terminal? It is installed on all the
computer which has a windows system. Start->program->accessory-
>communication->hyper terminal.
This is usually used to send out data to COM port and receive data.Just
set the port to the suitable port such as COM 1.etc.

I typed 8 characters on hyper terminal "01A00000" by hand, it will send
out to RS232 port which has a device there to receive the data(16F87?
microchip). There is a program in the chip to receive the data.(It uses getc
() of PIC C language). Then I try to send the data one by one by using Visual Basic:
MSCOMM1.output="0"
MSCOMM1.output="1"
MSCOMM1.output="A"......
But it sounds that the data format sent out is different for Hyper
terminal and Visual Basic.

Do you know what kind of difference it is for the data sent out by
hyper terminal and VB:MSCOMM1.output?
Actually I am making a program by VB to send out data same as hyper
terminal.
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / A question for VB serial port COM1 programming
    who have ever used hyper terminal? It is installed on all the
    computer which has a windows system. Start->program->accessory-
    >communication->hyper terminal.
    This is usually used to send out data to COM port and receive data.Just
    set the port to the suitable port such as COM 1.etc.

    I typed 8 characters on hyper terminal "01A00000" by hand, it will send
    out to RS232 port which has a device there to receive the data(16F87?
    microchip). There is a program in the chip to receive the data.(It uses getc
    () of PIC C language). Then I try to send the data one by one by using Visual Basic:
    MSCOMM1.output="0"
    MSCOMM1.output="1"
    MSCOMM1.output="A"......
    But it sounds that the data format sent out is different for Hyper
    terminal and Visual Basic.

    Do you know what kind of difference it is for the data sent out by
    hyper terminal and VB:MSCOMM1.output?
    Actually I am making a program by VB to send out data same as hyper
    terminal.
    • hyper terminal中的是ASCII的0,1,。。。和HEX 的0 ,1,2--F不一样。我不知道你到底想输出的是什么,如果是HYPER的那么把数字转换成ASCII先。
      • I think that MSCOMM1.output="0" is also in ascii format, the output should be same as typing "0" in hyper terminal?
        Actually I just want to get the same resulting output as hyper terminal. If I type "0" in hyperterminal, I think maybe the output will be the ascii of "0", but if I use MSCOMM1.output="0", it should be the same result.
        "A" is the same also with I typing "A" in hyper terminal. Do you think the output of hyper terminal is also ascill format? The same as ANSI format?Thanks.
        • ANSI我不是很熟悉那个格式,不过我想基本上是差不多的。如果你能够更加具体说明你需要什么我可能能够给你看看一些例子。VB做串口通信还是不错的。很方便。
          • 我只是要作个程序,发出的数据和Hyper Terminal发出的数据为同一个格式。 多谢。