Software design, development, installation, test and support services for industrial automation |
|
Home | About | News | Products and Services | Downloads | Contact us | Resources |
Unified IO is based on concept of IO Tracks. IO Track is a logical group of consecutive IO point controlled by the same IO interface card. There are 6 types of IO points:
Object of class inherited from abstract class IOCard is created for each IO card in the system. Then IO tracks have to be associated with IO cards. Then program control loop:
#ifndef _SOMEDIGITALIOCARD_ #include "somedigitaliocard.hpp" #endif #ifndef _SOMEQUADRATURECARD_ #inclue "somequadraturecard.hpp" #endif #ifndef _IOTRACK_ #include "iotrack.hpp" #endif #ifndef _OSIFACE_ #include "osiface.hpp" #endif using namespace Uniio; void main () { // create digital IO card object SomeDigitalIOCard aDigitalCard (1); // create 2 tracks consisting of digital IO // and associate tracks with the card IOTrack track1 ( aDigitalCard , 0 , "IIIIIIIIIIIIOOOO" // track consisting of 12 inputs and 4 outputs ); IOTrack track2 ( aDigitalCard , 16 , "OOOOOOOOOOOOOOOO" // track consisting of 16 outputs ); // Create quadrature counter card object SomeQuadratureCard anEncoderCard (0xD800); // create track consisting of counters and associate track with the card IOTrack track3 ( anEncoderCard , 0 , "CCCC"); // track consisting of 4 quadrature counters while (1) { // read current state of all inputs track1.updateInputs (); track3.updateInputs (); // do control logic if ( track1[5] && track3[1]>1000 ) { track2[9] = 1; track1[14] = 0; . . . } // endif // activate/deactivate outputs track1.updateOutputs (); track2.updateOutputs () // sleep for 10 milliseconds = 10000 microseconds OSInterface::sleep (10000); } // endwhile } // end main ()
Go back to Unified IO general description...
Copyright © 2000-2007 UAB "Midpoint Systems". All Rights Reserved.
All brand names and products names are trademarks or registered trademarks of their respective companies. |