« Close

Datasheets and User Guides

App Notes

Software & Driver

 

5.2.5.10 - PortStateWrite: IOType=27

Table 5.2.5.10-1.

PortStateWrite, 7 Command Bytes: 
0 IOType = 27
1-3 WriteMask
4-6 State
   
0 Response Bytes: 
  

This IOType writes the state of all digital I/O, where 0-7=FIO, 8-15=EIO, and 16-19=CIO. The direction of the selected lines is forced to output.

The firmware does the actual updates in the following order: FIO4-5, FIO6-7, FIO0-3, EIO0-5, EIO6-7, CIO0, CIO1, CIO2, CIO3. These all happen within 1 microsecond or so, but EIO0-EIO5, for example, are all updated at the exact same time.

  • WriteMask: Each bit specifies whether to update the corresponding bit of I/O.
  • State: Each bit of this value corresponds to the specified bit of I/O such that 1=High and 0=Low. To set all low, State=d0. To set all 20 standard digital I/O high, State=d1048575. To set FIO0-FIO2 high, EIO0-EIO2 high, CIO0 high, and all other I/O low (b000000010000011100000111), State=d67335.

U3 - portstatewrite code example

LabJackPython example session

Automatically extracted from u3.py. Debugging turned on to show the bytes sent and received.