Hi.
Im pretty new to the mscomm controll and my problem is.
Im trying to connecting a weighbridge to Com1 and when i try read the weight on the scale i get a mass of garbage coming trough.
but when i unplug the loadcell and the indicator reads Error-02, it displays in the application but its not fixed it rolls through
Iv bin batteling with this for a long time
Any help or input would b much appreciated.
Thanks
G.Masson
4 8901
Hi. Is there an API that comes with this device? Is there an interface that comes with it? Is there a guide that comes with it to let you know how to format the data?
Hi. Is there an API that comes with this device? Is there an interface that comes with it? Is there a guide that comes with it to let you know how to format the data?
hi.
There are no manuals or anything that come with the device, or anything, when the mscomm reads from the device the data comes through scrambled and unreadable, as text, symbols, and numbers mixed.
Thanks
I received the following information from the scale manufacturer. and i cannot make heads or tails of whats going on. as i said b4 i am totally new to the mscomm and serial communicaton. if you could please help me set up the code so the input goes into a text box via the oncomm facility. i really am green to all this.
Merav – communication Protocol
1. Shekel Merav models 1000, 2000, 3000, 3001, 4000 and Caesar 2000, 3000,
3001,5000/1/3.
Models use digital board ‘Tiger’, ‘Arnav’.
2. The Merav has serial communication RS-232 to computer and printer.
3. The communiction is bi directional from indicator to computer and vice versa.
4. There are three communication modes:
4.1 Response to weight request – “W” 57 H from host.
4.2 Continuous weight transmmision.
4.3 Manual transmmision – (Print).
5. The indicator has additional 2 features.
5.1 Zero the display in response to – Z – 5A
5.2 Set the Tare in response to – T – 54.
6. Programmable Baud Rate: Tiger 600 – 9600 Arnav 600 – 2400
7. Programmable Parity: 0 - space
1 - EVEN
2 - Mark
3 - ODD
8. 7 or 8 data bits, 1 stop bit.
9. The data is transmitted in ASCII code.
10. Data String:
10.1 Positive weight (+) XXX.XXX CR
10.2 Negative weight (-) XXX.XXX CR
11. Connector D type 25 : Pinout: Pin 2 - Data in
Pin 3 - Data out
Pin 7 - GND
12. Commector D type9: Pinout Pin 2 - Data out
Pin 3 - Data in
Pin 5 - GND
Hi
I sum1 directed me to a sample on the microsoft web. and received the following code:
Const Xon = &H11
Const Xoff = &H13
Private Sub Form_Load()
Form1.Caption = "App2"
With MSComm1
.CommPort = 2
.Handshaking = 2 - comRTS
.RThreshold = 1
.RTSEnable = True
.Settings = "9600,n,8,1"
.SThreshold = 1
.PortOpen = True
End With
Text1.Text = ""
Label1.Caption = "No input yet"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub
Private Sub MSComm1_OnComm()
Dim InBuff As String
Select Case MSComm1.CommEvent
' Handle each event or error by placing
' code below each case statement.
' This template is found in the Example
' section of the OnComm event help topic
' in VB help.
' Errors
Case comEventBreak ' A Break was received.
Case comEventCDTO ' CD (RLSD) Timeout.
Case comEventCTSTO ' CTS Timeout.
Case comEventDSRTO ' DSR Timeout.
Case comEventFrame ' Framing Error
Case comEventOverrun ' Data Lost.
Case comEventRxOver ' Receive buffer overflow.
Case comEventRxParity ' Parity Error.
Case comEventTxFull ' Transmit buffer full.
Case comEventDCB ' Unexpected error retrieving DCB]
' Events
Case comEvCD ' Change in the CD line.
Case comEvCTS ' Change in the CTS line.
Case comEvDSR ' Change in the DSR line.
Case comEvRing ' Change in the Ring Indicator.
Case comEvReceive ' Received RThreshold # of chars.
Label1.Caption = "Input"
InBuff = MSComm1.Input
Call ParseChars(InBuff)
Case comEvSend ' There are SThreshold number of
' characters in the transmit
' buffer.
Case comEvEOF ' An EOF character was found in
' the input stream.
End Select
End Sub
Sub HandleInput(InBuff As String)
' This is where you will process your input. This
' includes trapping characters, parsing strings,
' separating data fields, etc. For this case, you
' are simply going to display the data in the text
' box.
Text1.Text = Text1.Text & InBuff
End Sub
Sub ParseChars(ByVal InString As String)
Dim temp As String
Dim x As Long
Dim OutString As String
For x = 1 To Len(InString)
temp = Mid$(InString, x, 1)
If temp = Chr$(Xoff) Then
Label1.ForeColor = vbRed
Label1.Caption = "Xoff received"
temp = ""
ElseIf temp = Chr$(Xon) Then
Label1.ForeColor = vbGreen
Label1.Caption = "Xon received"
temp = ""
End If
OutString = OutString & temp
temp = ""
Next x
Call HandleInput(OutString)
End Sub
Would this work for what am doing or are there sum modifications i need to make. i understand the basics behind the coding but im still not sure i know what im doing.
Any help appreciated
Thanks
G Masson
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John Bonds |
last post by:
I'm looking for some sort of usb digital scale kinda like ones used for
weighing mail. Can anyone recommend anything?
Thanks,
John
|
by: John Bonds |
last post by:
I'm looking for some sort of digital scale to integrate into .NET.
Does anybody know of anything (like a postal scale) that attaches to USB,
serial or whatever that comes with a DLL or an API...
|
by: David |
last post by:
I am having trouble with "ACCESS DENIED" error messages in a VB.NET 2003
application when attempting to open
serial comms ports.
The application has 2 ports that connect via serial cable to 2...
|
by: ken |
last post by:
Hello everyone,
I'm new to visual VB and I am trying to setup communications using the
Function ReceiveSerialData() As String example found in the help
section of Microsoft Visual Basic 2005...
|
by: tchitra1 |
last post by:
I am using VB programme to communicate to PLC. I am able to communicate using hyper terminal for 'n' no. of cycles (sending and receiving) but thru the VB application using MS COMM, the communication...
| |
by: chapeau_melon |
last post by:
Hello,
I'm basicly not a programmer...
I found some C++ codes on the net that almost satisfy me needs, wich
is to communicate with an other device that sends data to me, wich I
have to receive...
|
by: hemant kamble |
last post by:
Hi all,
I am hemant , I am new for VB.
Can sombody help to access serial port in VB on windows XP.
I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial...
|
by: hemant kamble |
last post by:
Hi all,
I am hemant , I am new for VB.
Can sombody help to access serial port in VB on windows XP.
I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial...
|
by: hamidd66 |
last post by:
hello dear
i have some problems about working with serial port
would you please send me an tutorial or an article about serial port and its functions in c#
thanks
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |