EasyManua.ls Logo

LabJack U12 - 5.2 - DIO

LabJack U12
61 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
>>> d = u12.U12()
open called
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0]
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
>>> d.rawAISample()
Writing: [0x8, 0x9, 0xa, 0xb, 0x1, 0xc0, 0x0, 0x0]
Received: [0x80, 0x0, 0x99, 0xb, 0x28, 0x99, 0x2c, 0x5]
{
'IO3toIO0States':
<BitField object: [ IO3 = Low (0), IO2 = Low (0),
IO1 = Low (0), IO0 = Low (0) ] >,
'Channel1': 1.4453125,
'Channel3': 1.2744140625,
'Channel2': 1.46484375,
'PGAOvervoltage': False,
'Channel0': 1.3037109375,
'EchoValue': 0
}
5.2 - DIO
This commands reads the direction and state of all the digital I/O. If Update Digital = 1, this function also sets the directions and
states before reading.
Command
Byte #
Description
0
Bits for D15 through D8 Direction ( 0 = Output, 1 = Input)
1
Bits for D7 through D0 Direction ( 0 = Output, 1 = Input)
2
Bits for D15 through D8 State ( 0 = Low, 1 = High)
3
Bits for D7 through D0 State ( 0 = Low, 1 = High)
4
Bits 7-4: Bits for IO3 through IO0 Direction
Bits 3-0: Bits for IO3 through IO0 State
5
01X10111 (DIO)
6
Bits 7-1: XXXXXXX
Bit 0: Update Digital
7
XXXXXXXX
Response
Byte #
Description
0
01X10111 (DIO Response)
1
Bits for D15 through D8 State ( 0 = Low, 1 = High)
2
Bits for D7 through D0 State ( 0 = Low, 1 = High)
3
Bits 7-4: Bits for IO3 through IO0 State
Bits 3-0: XXXX
4
Bits for D15 through D8 Direction ( 0 = Output, 1 = Input)
5
Bits for D7 through D0 Direction ( 0 = Output, 1 = Input)
6
Bits for D15 through D8 Output Latch States
7
Bits for D7 through D0 Output Latch States
LabJackPython Example
>>> import u12
>>> d = u12.U12()
open called
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0]
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
>>> d.rawDIO()
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0]
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
{
'D7toD0States':
<BitField object: [ D7 = Low (0), D6 = Low (0),
D5 = Low (0), D4 = Low (0),
D3 = Low (0), D2 = Low (0),
D1 = Low (0), D0 = Low (0) ] >,
'IO3toIO0States':
<BitField object: [ IO3 = Low (0), IO2 = Low (0),
IO1 = Low (0), IO0 = Low (0) ] >,
46

Other manuals for LabJack U12