Resetting the DMM by transmitting *RST command through MSComm control error
-
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.
-
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.
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 -
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, 2008Hi 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
-
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.
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
-
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
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 -
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, 2008Dave 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
-
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
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 -
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, 2008If 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