Private Sub GenerateCommand (Command As a String, the Paramater As String)
'note:
'when this function is called, pass REL to Command parameters, the same pass "1 1000 G" Paramater parameters used to generate the Command REL 1 1000 G, the back of the str1 str2 as the Enter key, is don't have to manually press Enter, but in the program implementation)
Dim str1, str2 As String
Str1=Asc (13) 'linefeed ASCII is 13
Str2 enter=Asc (10) 'ASCII is 10
Sendstring=Command + "" + Paramater + str1 + str2
End Sub
At present, the MSComm control has been initialized, the need to communicate to drive command has also written sendstring (variable), the question is how to send this command in the program, let drive start work?????? Consult everybody! Thank you first!
CodePudding user response:
The Enter key that consists of the following code:Dim str1, str2 As String
Str1=CRH (13) 'linefeed ASCII is 13
Str2=CRH (10) 'enter ASCII is 10
Send command characters use MsComm controls the Output properties, such as sending the Enter key, the code is:
MSComm1. The Output=str1 + str2
CodePudding user response:
MSComm1. The Output=sendstring