NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
LarryL
Posts: 24
0 Kudos

X series DDK digital output

I have been working on the X series DDK digital output example dioex1.cpp. It seems working but not exactly what I expected. I have set it up for digital output and sent out the value on specific bit (pin) in dioex1.cpp and I did see the pin turned ON. However, it didn't hold ON all the time instead of toggling the bit On/Off all the time.

 

Any ideas why ?  Thanks.

 

Larry

Active Participant
Steven_T
Posts: 543
0 Kudos

Re: X series DDK digital output

Hello,

 

Exactly what behavior are you seeing?

 

The expected behavior of the example is that it resets the dio subsystem, briefly outputs the expected state, and then resets the dio subsystem back to the default state as the application exits.  If you want the outputs to remain set after running the example, you can set the tristateOnExit to kFalse instead of kTrue.  However, when the example is run again, it will briefly reset the dio subsystem before outputting the next state that you want.

 

I would recommend creating a loop in the example so that it doesn't exit until it receives input to exit (and resetting the dio subsystem of the board).  This would make the output stay on the port as long as you need it there.

 

I hope this helps,

Steven T.

Member
LarryL
Posts: 24
0 Kudos

Re: X series DDK digital output

Hi Steven,

 

Thanks for the reply. It helps a lot. I got better understanding the example and got it working as I wanted.

 

Thanks again.

Larry 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page