Overview
This is the documentation on the SPT Vision Library objects.
The vision process takes some time, so there will be another Task seperate from the PLC Task. A good name for this can be VisionMain. In this task, there will be an instance of the vision process type you choose (see further documentation). In the PLC task under the machine module or equipment module you will have an instance of the FB_PLCTask. Together these components will communicate by using the TwinCAT Process data space and linking variables.
Block Diagram
Process Data
Name | Type | Output From | Description |
---|---|---|---|
RunVision | BOOL | PLC Task | This will run the vision to aquiring when high and stop the aquiring when low |
SoftwareTrigger | BOOL | PLC Task | This will software trigger the camera to take an image |
Reset | BOOL | PLC Task | This is used to reset vision system when under error |
CameraState | ETcVnCameraState | Vision Task | This is a status of the camera's state |
ResultsAvailable | BOOL | Vision Task | This will let the PLC task know that there are results |
NumberOfResults | UDINT | Vision Task | This is the number of elements found in the results |
Results | ARRAY[1..MAX_BUFFER_BYTES] of BYTE | Vision Task | The data type that is put into buffer will be decided at application time from the process of analysis. Each side will have to define the structure of results needed for PLC task to function |
Error | BOOL | Vision Task | This is set when there is an error |
ErrorID | UDINT | Vision Task | This is the value of the Alarm when one is set |
Global Parameter List
This list can be edited in the Library references for your project to be the size needed for your application.
1 2 3 4 |
|
Typical Flow Diagram Software Trigger
sequenceDiagram
participant plc as PlcApp
participant plctask as PlcTaskComponent
participant visiontask as VisionTaskComponent
participant c as Camera
plc->>plctask: Run Vision
plctask->>visiontask: RunVision
loop Get to acquire
visiontask->>c: Initialize,open,acquire
c->>visiontask: Camera States
end
visiontask->>plctask: Camera State(acquire)
plctask->>plc: Camera State(acquire)
loop vision cylce
plc->>plctask: Software Trigger
plctask->>visiontask: SoftwareTrigger
visiontask->>c: Trigger
c->>c: Capture Image
c->>visiontask: Image
visiontask->>visiontask: Process the Image
visiontask->>plctask:Results
plctask->>plc:Results
Note over plc: Copy Results
end