刘工您好,遇到了新问题
用VB往卡里面写数组,但是下位机数组第0位总是写不进去,
函数如下:
Response = Space(256)
ResponseLength = 256
Mywidth = Picture2.ScaleWidth
Myheight = Picture2.ScaleHeight
RC = DMCCommand(hDmc, "DA COLOR1【】;DM COLOR1【145】", Response, ResponseLength)
RC = DMCCommand(hDmc, "DA SIZE【】;DM SIZE【2】", Response, ResponseLength)
i = 0
Data = ""
Data1 = ""
Data1 = str(Mywidth) + Chr$(13) + str(Myheight)
For j = 0 To Mywidth - 1
Data = LTrim(Data) + Chr$(13) + Trim(str(col_place(j, i)))
Next j
RC = DMCArrayDownload(hDmc, "SIZE", 0, 1, Data1, Len(Data1), BytesWritten)
RC = DMCArrayDownload(hDmc, "COLOR1", 0, Mywidth, Data, Len(Data), BytesWritten)
If RC = 0 Then
MsgBox "Array downloaded successfully"
End If
数组发送成功了,但是在Terminal里面查询 COLOR1【0】=0(实际上应该等于1)
数组里面的数全部后退了一位,也就是从COLOR1【1】开始记录了
这是什么原因呢?
但是SIZE数组就正常,查询SIZI【0】得到的是正确的
楼主最近还看过