TcoElements is a collection of components for accessing and managing I/O primitives, such as Digital Inputs, Digital Outputs, Analog Inputs, Analog Outputs etc.
For detailed documentation, see the TcOpen Documentation site
TcoDi provides access to digital input, with a series of functions to read the state of the input, with built-in diagnostics functions.
TcoDo provides access to digital output, with a series of functions to read the state of the input, with built-in diagnostics functions.
TcoAi provides access to analog input, with a series of functions to read the state of the input, with built-in diagnostics functions.
TcoAo provides access to analog input, with a series of functions to read the state of the input, with built-in diagnostics functions.
TcoCarousel used in manufacturing or production environments to move and position items between different workstations. It typically consists of a circular table that rotates to bring items to different positions around the table, along with a robotic arm or other mechanism to pick up and move the items as needed.
Picture below is default view for carousel. A view provide us sates informations such as : In position,In precise position,and general safety condition to turn table. The circle the middle is information about direction, and background of this circle signalize information that table(carousel) is InPosition(Warning color is not (Yellow), Notification(Green) color is in position.) see TcoCore.Wpf.TcoColors
Preconditions:
Nothig. It is control by single input/output
{attribute addProperty Name "A1"}
A1 : InputsBase_8;
{attribute addProperty Name "A2"}
A2 : OutputsBase_8;4. Inside the declaration part of the function block created, add an instance of the TcoElemnts.TcoCarousel function block with the initialization according to the example
FUNCTION_BLOCK TcoElementsSandbox EXTENDS TcoCore.TcoContext
VAR
{attribute addProperty Name "Carousel"}
_carousel : TcoElements.TcoCarousel(THIS^);
END_VAR6. Add the Main method to the function block created in the step 5, and insert the TcoElemnts.TcoCarousel instance call with passing the mapped hardware structure
7. Add call of the method Service() according to the example. By calling this method, all control elements of this component are accessible later in the visualization
_carousel.Config.ErrorTime:=T#10S;
_carousel.Config.InfoTime:=T#2S;
_carousel.Config.Direction:=eTcoCarouselDirection.Cw;
_carousel.Config.NumberOfPositions:=8;
_carousel.Config.Offset:=1;
_carousel(
inoInPosition:=IO.A1._1 ,
inoInPrecisePosition:=IO.A1._2 ,
inoEnableTurn:= IO.A2._1,
inoStartTurn:= IO.A2._2,
inSafetyCondition:=IO.A2._3 ,
inBasePositionNumber:=codedPosition );
_carousel.Service();8. In the declaration part of the MAIN(PRG) create an instance of the function block created in the step 5 according to the example
PROGRAM MAIN
VAR
_tcoElementsSandbox : myVeryFirstTcoContext;
END_VAR9. Into the body of the MAIN(PRG) add the call of the Run() method of the instance created in the previous step, according to the example
_tcoElementsSandbox.Run();Preconditions: All neccessary packages are installed, all neccessary references are set, connector to the target PLC is set. MainWindow.xaml has its view model declared and its DataContext is set to this view model, according to the example
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>Preconditions: All neccessary packages are installed, all neccessary references are set, connector to the target PLC is set. MainWindow.xaml has its view model declared and its DataContext is set to this view model, according to the example
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>- Run the Vortex Builder
- Into the MainWindow.xaml insert any kind of container, for example StackPanel and bind its DataContext to the MAIN of the EntryPointToYourPlc
<StackPanel DataContext="{Binding TcoElementsTestsPlc.MAIN._tcoElementsSandbox}">
</StackPanel>- Into the container added, insert the RenderableContentControl and bind its DataContext to the TcoElementsSandbox._carousel, using the PresentationType of the value Service
<vortex:RenderableContentControl DataContext="{Binding _carousel}" PresentationType="Service"></vortex:RenderableContentControl>The presentation Type of the value can be used also Base
<vortex:RenderableContentControl DataContext="{Binding _carousel}" PresentationType="Service"></vortex:RenderableContentControl>- After starting the application and expanding the view, final view should look as follows
Collapsed Service view
Expanded (detailed info) view
Service view report an error notification
Default view
Default view turning is active
Default view turning is in error
Default view turning is in position not axtive , but safety condision are not met.
_carousel.Config.ErrorTime:=T#10S;
_carousel.Config.InfoTime:=T#2S;
_carousel.Config.Direction:=eTcoCarouselDirection.Cw;
_carousel.Config.NumberOfPositions:=8;
_carousel.Config.Offset:=1;
_safetyOk := true; //
_carousel(
inoInPosition:=IO.A1._1 ,
inoInPrecisePosition:=IO.A1._2 ,
inoEnableTurn:= IO.A2._1,
inoStartTurn:= IO.A2._2,
inSafetyCondition:=_safetyOk ,
inBasePositionNumber:=codedPosition );In code above is assigned by variable _safetyOk
This input is a condition that prevents the rotation of the table, possibly due to collisions with cylinders, axes, or other objects.
Note:
Do not use signal from Light Curtain here.
An example below showing constrain for turning table. By calling method Suspend means turning task is still active, but outputs are off (physically not rotating ) and is also produced alarm notification. There is another option Abort. By calling this method is turning task is aborted
Note:
Typical signal for suspend method as input might be signal from Light curtain
Important:
This methods must be called after initialization of function block!!!
_carousel(
inoInPosition:=IO.A1._1 ,
inoInPrecisePosition:=IO.A1._2 ,
inoEnableTurn:= IO.A2._1,
inoStartTurn:= IO.A2._2,
inSafetyCondition:=_safetyOk ,
inBasePositionNumber:=codedPosition );
_carousel.Suspend(inoDisableCondition:= _disableSignal1 ,Invert:=FALSE); //this might be signal from Light Curtain (safety is inerupted)
_carousel.Suspend(inoDisableCondition:=_disableSignal2 ,Invert:=TRUE);










