Write to Digital Output, C API

8 years 2 months ago #29530075 by beerbot
The RioBoard.h header file has a RioWriteAllDigitalOutput() function, which apparently writes to all digital outputs at the same time, but no function to write to a single digital output. This function takes a single 32 bit word as a parameter.

How does the 32 bit word map to the RIO connector output pins?

Is it intended that each time I want to write a value to one output I have to rewrite to all the outputs?

In contrast there is a function to write an individual analog output, RioWriteAnaOutput(), and it takes two parameters, the channel to be written and the value for that channel.

Please Log in or Create an account to join the conversation.

8 years 2 months ago #29530081 by opal
Replied by opal on topic Write to Digital Output, C API
Hello beerbot,

Thanks for pointing us out at this - you are right, the relation of the connector pins and outputs accessible via our API could be covered better (both, in the source code comments and the documentation we have published) then they currently are (page 4,5 of the "RIO-xxx Datasheet" ).

We will do our best to improve that as soon possible.

In the meantime, please consider using:
void RioSetDigitalOutput(unsigned char ch);  						/* set digital output ch */
void RioResetDigitalOutput(unsigned char ch);						/* clear digital output ch */

Where the "ch" stands for "Chanel Number" of the digital output you intend to modify.

If you have more questions/suggestion - please don't hesitate to share them here on forum.

Best regards and good luck with your project

Please Log in or Create an account to join the conversation.

Moderators: opal
Time to create page: 0.055 seconds