dealing with different aspects of weighing devices
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Well,
I have to read the comm port and the output has to be something like 45200 kg.
I really don't have any idea how to do that.
I know something about the Mscomm control but do i have to test it first and then tell you what the result is ?
There is a sample in MSDN called 'dialer.vbp' which is a nice place to get you started in using mscomm. But i think you won't need the dialing(sending) part. Here is a simple example on most probably what u need:
Set your MsComm1 properites:
MSComm1.CommPort = 1
MSComm1.InputMode = comInputModeText
MSComm1.InputLen = 0
MSComm1.RThreshold = 20 ' No. of character to recevie.
MSComm1.Settings = 9600,n,8,1
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Dim MyData As String
Select Case MSComm1.CommEvent
Case comEvReceive ' Receive event.
MyData = MSComm1.Input
End Select
Today i tried the code from toyumail but i don't receive any signal from the device.
I changed the number of the commport but no result.
It's a Philips PR1613 weighing device.
Can somebody please help me out ??
P.S. the program we're using now is written in cobol but i don't know anything about this language.
First thing you'll want to check is that the weighing device serial output matches the baud rate, the data bits, stop bits and parity settings you have fot the com port.
Thanks for your reply !!
I will try this tommorow Vampire and give you an answer.
Please stay in touch with me.
I really have to find a solution !!!
Thanks again.
I found some information about the weighing device
Electrical specification
DUART controlled, usable for current loop-,RS232-,RS422/485-interface modules, ASCII coded, full duplex,asynchronous
Data rate : adjustable for 300,600,1200,4800 or 9600 b/s
Bits/character : settable for 7 or 8 bit
Start bits : one
Stop bits : one
Parity : settable for even, odd, none
Time out : no time limiting
Address Range : 26 addresses (A...Z)
So, what you have to do is match the settings you want to use for the COM port to the settings on the device. The device settings are probably done by DIP switches or the like.
After you've got that done, you have to send the appropriate command to the device to get it to send back a response. Something like this in the event for a command button click.
Private Sub Command1_Click()
MSCOMM1.Output = "WGA" & vbCrLf
End Sub
If everthing is set up correctly, when you click on the command button you should get a string in response to this ( in the OnComm event ) , in the format you listed above.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.