Le 16/01/2014 09:27, wally a écrit : > Hello, > > i want to send some data bytes to serialport using below code: > > Public Sub Button2_Click() > > Dim arr As Byte[] > arr = [&Haa, &H15, &H00, &Hfe, &H0a, &H00, &H00, &H00, &Hff, &Hff, > &Hff, &Hff, > &H00, &H00, &H0a, &H00, &H00, &H00, &H10, &H27, &H00, &H42] > > > If SP1.Status = Net.Active Then > SP1.Begin > Write #SP1, arr As Byte[] > SP1.Send > Endif > > End > > Problem is that this code sends all byte but with leading 3 Bytes i do > not want to be sent. > (hex values) > > " 41 02 16 aa 15 00 fe 0a 00 00 00 ff ff ff ff 00 00 0a 00 00 00 10 27 > 00 42 " > > I assume " 41 02 " is identifer for Byte-Array and hex 16 i(dec22) s the > length of array > > > How can i send this array without these leading 3 bytes ? > > Do i need the Begin/ Send Method for a single array to be sent ? > > thx wally >
Use the Write() method of the Byte[] class. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
