Hello,
I am trying to send and receive data between MS Access and a weigh scale. I am using a liitle code that calls a dll file to send ASCII characters to the scale. This works fine. However, I also am trying to receive data from the scale. Sending the number one and a carriage return triggers the scale to send the displayed weight value back to the computer. I know it sends because a confirmation displays on the scale when I send it <49,13>. I figure I need to specify in Access or the dll file where to send this info. Any ideas on how to do this? I have attached the code in the form I'm using to send the data to the scale. Any help with this would be extremely appreciated.
Option Compare Database
Private Declare Function SER_OPEN& Lib "SERSEN04.DLL" (ByVal commPort&, ByVal baudRate&)
Private Declare Function SER_CLOSE& Lib "SERSEN04.DLL" ()
Private Declare Sub SER_SEND Lib "SERSEN04.DLL" (theString$)
Private Declare Sub SER_RAWSEND Lib "SERSEN04.DLL" (theString$)
Private Declare Function SER_VERSINFO$ Lib "SERSEN04.DLL" ()
Private Sub Command1_Click()
' Code for the "Send" button.
Me!Text1.SetFocus
Call SER_OPEN(1, 9600)
SER_SEND (Text1.Text)
Call SER_CLOSE
End Sub
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
'Code for the "Version" button.
Me!Text1.SetFocus
Me!Text1.Text = SER_VERSINFO$()
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
Thanks
Jeremy
I am trying to send and receive data between MS Access and a weigh scale. I am using a liitle code that calls a dll file to send ASCII characters to the scale. This works fine. However, I also am trying to receive data from the scale. Sending the number one and a carriage return triggers the scale to send the displayed weight value back to the computer. I know it sends because a confirmation displays on the scale when I send it <49,13>. I figure I need to specify in Access or the dll file where to send this info. Any ideas on how to do this? I have attached the code in the form I'm using to send the data to the scale. Any help with this would be extremely appreciated.
Option Compare Database
Private Declare Function SER_OPEN& Lib "SERSEN04.DLL" (ByVal commPort&, ByVal baudRate&)
Private Declare Function SER_CLOSE& Lib "SERSEN04.DLL" ()
Private Declare Sub SER_SEND Lib "SERSEN04.DLL" (theString$)
Private Declare Sub SER_RAWSEND Lib "SERSEN04.DLL" (theString$)
Private Declare Function SER_VERSINFO$ Lib "SERSEN04.DLL" ()
Private Sub Command1_Click()
' Code for the "Send" button.
Me!Text1.SetFocus
Call SER_OPEN(1, 9600)
SER_SEND (Text1.Text)
Call SER_CLOSE
End Sub
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
'Code for the "Version" button.
Me!Text1.SetFocus
Me!Text1.Text = SER_VERSINFO$()
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
Thanks
Jeremy