Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Resetting the DMM by transmitting *RST command through MSComm control error

Resetting the DMM by transmitting *RST command through MSComm control error

Scheduled Pinned Locked Moved Visual Basic
help
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gopalraja
    wrote on last edited by
    #1

    Hi, Actually I want to Communicate the DMM through the computer Comport. So I have created one MSComm control and did following setting and code. Private Sub Form_Load() MSComm1.Settings="9600,N,8,1" MSComm1.CommPort=2 MSComm1.InputLen=0 MSComm1.PortOpen=True MSComm1.Rthreshold =1 End Sub I have send the *RST command to reset the DMM by the following code Private Sub CmdSend_Click() MSComm1.Output = "*RST"+Chr$(13) End Sub When I run this program, The DMM showing errors as -101, -102, -103. All these error are related to characters. But, When I was running in Hyper terminal mode, DMM communication was perfect. Moreover, the DMM RS-232 setting (Baudrate and all) same as our computer setting. Still I could not communicating with DMM. Pls help me to found out solution.

    D L 2 Replies Last reply
    0
    • G gopalraja

      Hi, Actually I want to Communicate the DMM through the computer Comport. So I have created one MSComm control and did following setting and code. Private Sub Form_Load() MSComm1.Settings="9600,N,8,1" MSComm1.CommPort=2 MSComm1.InputLen=0 MSComm1.PortOpen=True MSComm1.Rthreshold =1 End Sub I have send the *RST command to reset the DMM by the following code Private Sub CmdSend_Click() MSComm1.Output = "*RST"+Chr$(13) End Sub When I run this program, The DMM showing errors as -101, -102, -103. All these error are related to characters. But, When I was running in Hyper terminal mode, DMM communication was perfect. Moreover, the DMM RS-232 setting (Baudrate and all) same as our computer setting. Still I could not communicating with DMM. Pls help me to found out solution.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Well, somewhere, you've got at least one of the communication parameters wrong. It would be parity, handshaking, ..., any of them. BTW, what's a "DMM"? And if you're using Visual Studio 2005 or above, why are you using the old MsComm control instead of the SerialPort class in the .NET Framework?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Well, somewhere, you've got at least one of the communication parameters wrong. It would be parity, handshaking, ..., any of them. BTW, what's a "DMM"? And if you're using Visual Studio 2005 or above, why are you using the old MsComm control instead of the SerialPort class in the .NET Framework?

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi Dave, the only DMM I know would be a Digital MultiMeter, an electronic device measuring voltages, currents, impedances, and the like. Handheld DMMs normally don't have a computer interface, desktop models often do, either a serial one or more often an IEEE-488 one (that is a rather old byte-wide bus for measurement equipment, not to be confused with IEEE-1394 aka FireWire). :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


        D 1 Reply Last reply
        0
        • G gopalraja

          Hi, Actually I want to Communicate the DMM through the computer Comport. So I have created one MSComm control and did following setting and code. Private Sub Form_Load() MSComm1.Settings="9600,N,8,1" MSComm1.CommPort=2 MSComm1.InputLen=0 MSComm1.PortOpen=True MSComm1.Rthreshold =1 End Sub I have send the *RST command to reset the DMM by the following code Private Sub CmdSend_Click() MSComm1.Output = "*RST"+Chr$(13) End Sub When I run this program, The DMM showing errors as -101, -102, -103. All these error are related to characters. But, When I was running in Hyper terminal mode, DMM communication was perfect. Moreover, the DMM RS-232 setting (Baudrate and all) same as our computer setting. Still I could not communicating with DMM. Pls help me to found out solution.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, some guessing is required here. your DMM probably wants some hardware handshaking (=data flow control), i.e. it needs you to set some control lines high or low, before it wants to listen to you (that would not explain the error conditions you mentioned); or it wants you to not send stuff when it is not ready, as indicated by some control lines it is setting high or low. I don't remember how handshaking and control lines work in Win32 or VB6; I do know for .NET FYI: HyperTerminal by default chooses Hardware Handshake, Win32 does not. So try setting your COM port to hardware handshake. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


          1 Reply Last reply
          0
          • L Luc Pattyn

            Hi Dave, the only DMM I know would be a Digital MultiMeter, an electronic device measuring voltages, currents, impedances, and the like. Handheld DMMs normally don't have a computer interface, desktop models often do, either a serial one or more often an IEEE-488 one (that is a rather old byte-wide bus for measurement equipment, not to be confused with IEEE-1394 aka FireWire). :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            I figured that's what it was, but now-a-days, he could have been talking to a synthesizer or a toaster oven! I always ask just to make sure. You know what they say about "assume", right? :laugh:

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            L 1 Reply Last reply
            0
            • D Dave Kreskowiak

              I figured that's what it was, but now-a-days, he could have been talking to a synthesizer or a toaster oven! I always ask just to make sure. You know what they say about "assume", right? :laugh:

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Dave Kreskowiak wrote:

              he could have been talking to a synthesizer or a toaster oven

              I like a synthesizer with an interface, OTOH I wouldn't connect to a toaster. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


              D 1 Reply Last reply
              0
              • L Luc Pattyn

                Dave Kreskowiak wrote:

                he could have been talking to a synthesizer or a toaster oven

                I like a synthesizer with an interface, OTOH I wouldn't connect to a toaster. :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Luc Pattyn wrote:

                OTOH I wouldn't connect to a toaster.

                What?! You don't want to put a webcam in a toaster to get your English muffin's toasted to the perfect golden brown every time? :-D

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                L 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Luc Pattyn wrote:

                  OTOH I wouldn't connect to a toaster.

                  What?! You don't want to put a webcam in a toaster to get your English muffin's toasted to the perfect golden brown every time? :-D

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  If the toaster contains a camera, that is OK, but I am not interested in those pictures. I want it to be smart enough to deliver on its promises all by itself. That is what embedded systems are supposed to do, not bother me, just deliver the results. Now if the manufacturer needs an interface to service the device, he can do so; but again, I'm not interested in it. Oh wait, I might want to include it in my next domotica infrastructure. Have to rethink. If so, it won't be a serial port I'm afraid. :)

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups