EasyManua.ls Logo

LabJack U12 - 5.4 - Counter;AO;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...
Command
Byte #
Description
0
Bits 7-2: XXXXXX
Bit 1: Strobe Enabled
Bit 0: Reset Counter
1
XXXXXXXX
2
XXXXXXXX
3
XXXXXXXX
4
XXXXXXXX
5
01X1XX10 (Counter)
6
XXXXXXXX
7
XXXXXXXX
Response
Byte #
Description
0
01X1XX10 (Counter)
1
Bits for D15 though D8 State ( 0 = Low, 1 = High )
2
Bits for D7 though D0 State ( 0 = Low, 1 = High )
3
Bits 7-4 = IO3 through IO0 State
Bits 3-0 = XXXX
4
Most Significant Byte of Counter
5
Bits 23-16 of Counter
6
Bits 15-8 of Counter
7
Least Significant Byte of Counter
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.rawCounter()
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0x0, 0x0]
Received: [0x52, 0x0, 0x0, 0x0, 0xbb, 0x10, 0x0, 0xef]
{
'IO3toIO0States':
<BitField object: [ IO3 = Low (0), IO2 = Low (0),
IO1 = Low (0), IO0 = Low (0) ] >,
'Counter': 3138388207,
'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) ] >,
'D15toD8States':
<BitField object: [ D15 = Low (0), D14 = Low (0),
D13 = Low (0), D12 = Low (0),
D11 = Low (0), D10 = Low (0),
D9 = Low (0), D8 = Low (0) ] >}
[/textile]
5.4 - Counter/AO/DIO
This command controls all 20 digital I/O, and the 2 analog outputs (AO0 & AO1). The response provides the state of all I/O and the
current counter value. If Reset Counter = 1, the counter is reset after reading.
48

Other manuals for LabJack U12