400分悬赏SATO DR360 条形码打印命令
目前我在SATO DR360用CODE128来打印条形码,已经CODE128的编码已经完成了,但是不知道如何用什么命令向SATO DR360发送打印命令,
已经知道CODE39在SATO DR360是怎么工作的。
付上CODE39的打印命令。
Dim STX, ETX, ESC, CHR127
Dim i As Integer
Dim J As Integer
STX = Chr(2)
ETX = Chr(3)
ESC = Chr(27)
CHR127 = Chr(127)
mscommpbc.CommPort = comportn
mscommpbc.PortOpen = True
Dim prtxt(20) As String
Dim tsize As Integer
J = 1
tsize = Len(labeltitle)
If tsize <= 12 Then
prtxt(J) = "L01" & "1020031" & Trim(Str(Int(383 + 24 * (12 - tsize) / 2))) _
& "001" & IIf(tsize < 10, "0" + Trim(Str(tsize)), Trim(Str(tsize))) _
& "1100000000000000000000000000000000000000000000000000"
Else
prtxt(J) = "L01" & "1010031" & Trim(Str(Int(399 + 12 * (25 - tsize) / 2))) _
& "001" & Trim(Str(tsize)) _
& "2100000000000000000000000000000000000000000000000000"
End If
prtxt(J + 1) = "D01" & labeltitle
J = J + 2
Select Case btype:
Case "CODE39":
prtxt(J) = "L02" & "7010063390001" & IIf(Len(sBarcodeData) < 10, "0" + Trim(Str(Len(sBarcodeData))), Trim(Str(Len(sBarcodeData)))) _
& "0106400000000000000000000000000000000000000000000000"
prtxt(J + 1) = "D02" & "*" & sBarcodeData & "*"
prtxt(J + 2) = "L03" & "1010128420003" & IIf(Len(sBarcodeData) < 10, "0" + Trim(Str(Len(sBarcodeData))), Trim(Str(Len(sBarcodeData)))) _
& "1100000000000000000000000000000000000000000000000000"
prtxt(J + 3) = "D03" & sBarcodeData
J = J + 4
Case "EAN13":
prtxt(J) = "L02" & "7030063390003" & IIf(Len(sBarcodeData) < 10, "0" + Trim(Str(Len(sBarcodeData))), Trim(Str(Len(sBarcodeData)))) _
& "0206410000000000000000000000000000000000000000000000"
prtxt(J + 1) = "D02" & sBarcodeData
prtxt(J + 2) = "L03" & "1010128420003" & IIf(Len(sBarcodeData) < 10, "0" + Trim(Str(Len(sBarcodeData))), Trim(Str(Len(sBarcodeData)))) _
& "1100000000000000000000000000000000000000000000000000"
prtxt(J + 3) = "D03" & sBarcodeData
J = J + 4
Case Else:
End Select
prtxt(J) = "L04" & "1010144380001202105300000000000000000000000000000000000000000000000"
If chkPrefix.Value = vbChecked Then
prtxt(J + 1) = "D04" & txtPrefix.Text
Else
prtxt(J + 1) = "D04"
End If
J = J + 2
prtxt(J) = "L05" & "2020146" & IIf(prtxt(J - 1) = "D04", "400", "420") & "001201105300000000000000000000000000000000000000000000000"
If checkprice.Value = Checked Then
prtxt(J + 1) = "D05" & PAD(Trim(sPrice), 20)
Else
prtxt(J + 1) = "D05"
End If
J = J + 2
prtxt(J) = "L06" & "1010174390003301100000000000000000000000000000000000000000000000000"
If checkdesp.Value = Unchecked Then
sInvDescription = ""
End If
prtxt(J + 1) = "D06" & sInvDescription
J = J + 2
mscommpbc.Output = STX
WaitTime 0.01
mscommpbc.Output = ESC & "A"
WaitTime 0.01
mscommpbc.Output = ESC & "M" & "0240000020+00+000000137"
WaitTime 0.01
For i = 1 To J - 1
If prtxt(i) <> "" Then
mscommpbc.Output = ESC & prtxt(i)
WaitTime 0.01
End If
Next i
mscommpbc.Output = ESC & "Q" & Trim(Str(CInt(qty)))
WaitTime 0.01
mscommpbc.Output = ESC & "Z"
WaitTime 0.01
mscommpbc.Output = ETX
WaitTime 0.01
mscommpbc.PortOpen = False