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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Access to send commands to a device.

Status
Not open for further replies.

smuthcrmnl777

Technical User
Jan 16, 2006
104
US
Does anyone know if it is possible to send a command to an RS-232 device such as a scale? The command I would like to send would tare the scale weight.

 
By Rs-232 are you saying the device is connected to an old school serial port?

If so, I then yes, I think so, even if you use a shell command, like you have a text file with some instructions in it, and in your shell command you call something like "Copy MyDoc.Txt Com1" or what ever the appropriate Com port is.

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
here you have some code that i use to query a scale with mscomm control
Dim a As String, b As Integer
we = Format(0, "0.00")
a = ""
msca.PortOpen = True
msca.Output = "W"
Do Until a > "" Or b = 20000
a = msca.Input
b = b + 1
Loop
msca.PortOpen = False
If b > 19999 Then
getweight = "No response from scale!"
Else
getweight = Mid(a, 2, Len(a) - 2)
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top