Hi again, the following line works perfectly:
device.QBCrig.Poll(ChrA({1, 1, 0, 0, 0, 0, 0, 100, 102}))
Even though the output, as you said, is just control characters:
? ChrA({1, 1, 0, 0, 0, 0, 0, 100, 102})
But using the function as you suggested (I changed 'out' to 'tosend' as I thought that might be conflicting somehow with the 'out' in the poll function but it isnt...):
function Cmdcopy(address, instruction, type, motor, valuein)
private tosend
tosend[0] = address
tosend[1] = instruction
tosend[2] = type
tosend[3] = motor
tosend[4] = from.urbLong(to.uLong(from.urwLong(valuein)))
private cks = sum(tosend) & 0xff
return(chra(concat(tosend, cks)))
I get this:
device.QBCrig.Poll(Cmdcopy(1, 1, 0, 0, 100))
C1136 Timeout: Cmdcopy Line 20: Cmdcopy Line 28: Line 1
and the actual output its trying to send is this:
? concat(tosend, cks)
{{1, 0, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 100}, {2, 0, 0, 100}}
...which isnt correct, as there should always be 9 bytes sent and received. I'm confused as C1136 isnt in the user guide, and there are only 9 lines in the function above, so I assume lines 20 (Write(out)) and 28 (throw())refer to the poll function (basically the same as the given one), and there's a problem with the format from the function above.
A little more help please?