Jump to content

Menavex

Members
  • Posts

    2
  • Joined

  • Last visited

Menavex's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks for your help Martin! I had to fiddle with code a bit to get it to work. One cool thing is that I can char as the array type and directly passing the entire string in one shot. It works pretty well, but I had to use the "align 1" command to get it to work. Without that it would output all kind of garbage on the serial line. Thanks again. What a great UDF! $LastPacketTx = $APIPacket $APIPacketLength = StringLen($APIPacket) _CommSwitch($Port) If _CommPortConnection() == '' Then Output("Error: Comm port error") Return EndIf $ByteArray = DllStructCreate("align 1;char[" & string($APIPacketLength) & "]") DllStructSetData($ByteArray, 1, $APIPacket) ;send the bytes _CommSendByteArray(DllStructGetPtr($ByteArray), $APIPacketLength,1) if @error then output('_CommSendByteArrray failed')
  2. Could someone show an example of _CommSendByteArray? How do you write the array to memory and pass the pointer? Thanks!
×
×
  • Create New...