5.7 - Pulseout [U12 Datasheet]
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 ).
Table 5.7-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/C1 – Period of first half cycle is ~100+5C+121BC or about BC*20µs
B2/C2 – Period 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(debug=True)
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': ...
}