EasyManua.ls Logo

LabJack U12 - 5.7 - Pulseout

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...
Mux Settings – 0b0000 = 0-1 (Differential), 0b0001 = 2-3 (Differential), 0b0010 = 4-5 (Differential), 0b0011 = 6-7
(Differential). Single-Ended readings = 0b1000 + AI Number.
5.7 - Pulseout
This command creates pulses on any to all of D0-D7. The desired D lines must be set to output with some other function. For best
accuracy, when using the BC*20us approximation, keep C as small as possible. B and C must be >= 1, and must do at least 1
pulse ( LSB >= 1 ).
Command
Byte #
Description
0
B1
1
C1
2
B2
3
C2
4
Bits for D7 through D0 ( 1 = Pulse the D line )
5
011XX100 (Pulseout)
6
Bit 7: Clear First?
Bits 6-0: MSB Number of Pulses
7
LSB Number of Pulses
Response
Byte #
Description
0
Echo of byte 0 of Command
1
Echo of byte 1 of Command
2
Echo of byte 2 of Command
3
Echo of byte 3 of Command
4
Bits of direction errors for D7 through D0
5
011XX100 (Echo of byte 5)
6
Echo of byte 6 of Command
7
Echo of byte 7 of Command
B1/C1Period of first half cycle is ~100+5C+121BC or about BC*20µs
B2/C2Period of second half cycle is ~70+5C+121BC or about BC*20µs
LabJackPython Example
Connect a jumper wire from D0 to CNT.
>>> 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(D7toD0Directions = 0, UpdateDigital = True)
>>> d.rawCounter(ResetCounter = True)
>>> d.rawPulseout(ClearFirst = True)
>>> print d.rawCounter()
{
'IO3toIO0States': ... ,
'Counter': 5,
'D7toD0States': ... ,
'D15toD8States': ...
}
5.8 - Reset
Sits in an infinite loop until micro watchdog timeout after about 2 seconds.
52

Other manuals for LabJack U12