Using FIO as Digital Output


mkelly

Recommended Posts

I ran out of DIO ports on my two labjacks and I'm looking for other ways out outputting 5v.

I'm already using FIO 4-7 on both jacks for PWM controllers, though I still have FIO 0-3 on both boards available.

I confused as to how to define a FIO port in DAQFactory.

Do I need to specify that the port is output-high using:

AddRequest (lngHandle, LJ_ioPUT_DIGITAL_BIT, 0, 1, 0, 0);
AddRequest (lngHandle, LJ_ioPUT_DIGITAL_BIT, 1, 1, 0, 0);

and then revert it back to low?

or is there a simpler way to do this that I'm missing in the channel configuration? Thus far I have tried setting it as an D to A channel # 2, as well as Dig out channel# 0-2

Link to comment
Share on other sites

Update of progress:

I found this tutorial: http://www.azeotech.com/dl/DF_LJUD_QuickTutorial.pdf but it doesn't seem to register a change in my FIO outputs.

I'm beginning to think my PWM coding is preventing me from using FIO's 0-3 since I have this code:

// configure PWM timer:
//Set the timer/counter pin offset to 4, which will put the first timer/counter on FIO4.
AddRequest (ID,  LJ_ioPUT_CONFIG, LJ_chTIMER_COUNTER_PIN_OFFSET, 4, 0, 0)
AddRequest (ID2,  LJ_ioPUT_CONFIG, LJ_chTIMER_COUNTER_PIN_OFFSET, 4, 0, 0)

Link to comment
Share on other sites

Glad you solved your problem. You can control digital outputs with DF Channels also. The following does an analog output, but should work if you specify digital output and set a value of 0 or 1:

http://labjack.com/support/ud/df-lj-app-guide/3.4

The following also looks useful:

http://labjack.com/support/ud/df-lj-app-guide/7.1

... and the quick tutorial does a digital output:

http://labjack.com/sites/default/files/2009/07/DF_LJUD_QuickTutorialPrintable.pdf

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.