08-27-2009 06:42 AM
Hello, i have the two examples of the Eseries for the digital outputs
and they seem to work but when i change the value i want to set in the dig output 1 it doesn't change .
More exactly i changed the example digex1 this way:
//Write 0x00 to 0xFF to the digital lines, can be checked by putting a break point.
//for(i=0;i<=255;i++)
theSTC->DIO_Output.writeDIO_Parallel_Data_Out(0);
but i always get 5V in the output.
So i want to be able to set a different value in each dig output.
how can i do so?
thanks
Solved! Go to Solution.
08-28-2009 03:06 AM
I recommend you test the NI-DAQmx build-in examples. These examples are installed with the driver and you can find them in a path like this:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital
A good example can be this:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Write Dig Chan
At the same time, you must dismiss a hardware problem. Have you test in MAX the digital lines? (using test panel).
Regards,
08-28-2009 03:24 AM
08-28-2009 06:14 AM
Hello again I managed to change the values i set to the output pin.
Now i'm using the function
DIO_Output.writeDIO_Parallel_Data_Out(0xff);
but i don't know how can i set a value in a particular pin and not in all of them.
If anyone knows something it will be very helpful.
thanks
08-31-2009 03:03 PM
The DDK and chip objects do not provide a specific function for setting the state of a single digital line. The best way to do this is using a bit mask with boolean logic and updating the whole port.
To set a bit, use a logical OR with a '1' in the bit you want to set. To clear a bit, use a logical AND with a '0' in the bit you want to clear.
Joe Friedchicken
NI Configuration Based Software Get with your fellow OS users
[ Linux ] [ macOS ]Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)