Alex_Webster
FabulaTech Forum Senior Member
Gender: Posts: 257
|
|
Re: WriteArray troubles in VBScript
Reply #1 on: Feb 5th, 2010, 5:40am |
Quote Modify
|
Here is your code with a couple of remarks ( they are marked with !!!): ----------------------------------------------------------------------- Dim objFTPort 'Dim arrCmd 'arrCmd = array(CByte(0), CByte(16), CByte(2), CByte(0), CByte(1)) Dim Arr(4) Arr(0) = 0 Arr(1) = 16 Arr(2) = 2 Arr(3) = 0 Arr(4) = 1 Set objFTPort = CreateObject("FTSPC.FTSPCControl") objFTPort.PortName = "COM1" objFTPort.BaudRate = 2400 objFTPort.DataBits = 8 objFTPort.StopBits = 0 '!!! <--- =0 - one stop bit, =1 - 1.5stop bits, 2 - two stop bits objFTPort.Parity = 0 objFTPort.FlowControl = 0 call objFTPort.Open() If objFTPort.IsOpened Then call objFTPort.WriteArray(arr, 5) '!!! Use "call" if you want to use "( )" End If 'call objFTPort.Close()
|