Download LabJack U3 User's Guide (-LV & -HV)
Transcript
5.2.5 Feedback A flexible function that handles all command/response functionality. One or more IOTypes are used to perform a single write/read or multiple writes/reads. Note that the general protocol described in Section 4.1 defines byte 2 of an extended command as the number of data words, which is the number of words in a packet beyond the first 3 (a word is 2 bytes). Also note that the overall size of a packet must be an even number of bytes, so in this case an extra 0x00 is added to the end of the command and/or response if needed to accomplish this. Since this command has a flexible size, byte 2 will vary. For instance, if a single IOType of PortStateRead (d26) is passed, byte 2 would be equal to 1 for the command and 3 for the response. If a single IOType of LED (d9) is passed, an extra 0 must be added to the command to make the packet have an even number of bytes, and byte 2 would be equal to 2. The response would also need an extra 0 to be even, and byte 2 would be equal to 2. Command: Byte 0 1 2 3 4 5 6 7-63 Checksum8 0xF8 0.5 + Number of Data Words (IOTypes and Data) 0x00 Checksum16 (LSB) Checksum16 (MSB) Echo IOTypes and Data Response: Byte 0 1 2 3 4 5 6 7 8 9-63 • • Checksum8 0xF8 1.5 + Number of Data Words (If Errorcode = 0) 0x00 Checksum16 (LSB) Checksum16 (MSB) Errorcode ErrorFrame Echo Data IOTypes & Data: One or more IOTypes can be passed in a single command, up to the maximum packet size. More info about the available IOTypes is below. In the outgoing command each IOType is passed and accompanied by 0 or more data bytes. In the incoming response, only data bytes are returned without the IOTypes. Echo: This byte is simply echoed back in the response. A host application might pass sequential numbers to ensure the responses are in order and associated with the proper command. 99