Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weght Scale Interface 2

Status
Not open for further replies.

hsugiyama

Programmer
May 18, 2000
6
US
I will need to write a VB program to interface with a weight scale through a COM port for a customer. The scale to use is either NCI or Toledo. I've never done this before, but from what I learned, I will use MSCOMM, and send out a command to the scale to get the weight from it.

Does anybody have experince with this sort of application? Can anybody show me a sample code to achieve this?

Thanks,
 
I played with this for a while and never finished. but i was able to interface with the sacle. I have a NCI 6720-15 that i was using to test.

basicaly involves opening the com port that the scale is attached to and sending a "prompt" character to it and and then reading that port for a response. the prompt i used was "W chr(13)" there are other prompts that force it to zero out or do a self test etc.

as I remember the biggest problem i had was making sure that the settings on the scale were right. (port speed, parity etc)

this is the entire code from the first interface i played with. the form has an mscomm control, 4 command buttons and 2 text boxes.

I got quite a bit of information from

(I think i downloaded some of the spec manuals)

hope this helps :)


Robert



Private Sub Command1_Click()

MSComm1.PortOpen = True


End Sub

Private Sub Command2_Click()
MSComm1.InputLen = 0
DataRec.Text = MSComm1.Input
End Sub

Private Sub Command3_Click()
MSComm1.PortOpen = False

End Sub

Private Sub Send_Click()
MSComm1.Output = DataSend.Text
MsgBox "data Sent"
End Sub
 
Hi hsugiyama:

I wrote an ActiveX control that provides full serial RS-232 interface to the NCI scale. You are welcome to have a copy. Just send me your e-mail address and mention 'tek-tips' in the subject box.

ballard@wt-nci.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top