Gettting the status of Digital I/O ports on UE9
Posted 28 June 2012 - 08:19 AM
Posted 28 June 2012 - 08:42 AM
LJ_ioGET_DIGITAL_BIT_DIR LJ_ioGET_DIGITAL_BIT_STATE LJ_ioGET_DIGITAL_PORT_DIR //x1 is number of bits. LJ_ioGET_DIGITAL_PORT_STATE //x1 is number of bits.
You use them just like the other iotypes as shown in the pseudocode at the end of Section 4.3.5. So if you do an Add/Go/Get or an eGet with LJ_ioGET_DIGITAL_BIT_DIR, you will get back a value of 0 for input and 1 for output. With LJ_ioGET_DIGITAL_BIT_STATE you will get back a 0 for low and 1 for high.
Note that when you use LJ_ioGET_DIGITAL_BIT_STATE or LJ_ioGET_DIGITAL_PORT_STATE on a line set to output, it leaves it set as output, but it is doing an actual state read based on the voltage(s) on the pin(s). So if you set a line to output-high, but then something external is driving it low, it might read low.
Posted 09 July 2012 - 03:22 PM
I am trying to determine what the states of the lab jack pins are (input, output-high, output-low) when my application starts. This is important because those states will persist if my program is killed and restarted. I couldn't find this explained in the labjack192.pdf file. In section 4.3.5, there is a LJ_ioGET_DIGITAL_BIT_STATE that can be used as a parameter to AddRequest, but I don't find any documentation on what this means, nor on how to interpret the returned values from GetResult from this request.
Any help would be appreciated, thanks.
Thanks, that worked perfectly.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users