SysIdentify

Public Member Functions | Public Attributes | Properties | Events | Private Member Functions | Private Attributes | List of all members
TwinCatIdent.TwinCatExtGen Class Reference

Class for control of external generator in PLC More...

## Public Member Functions
| TwinCatExtGen ()
| Constructor More...
void | Connect (string AdsNetId, int AdsPort, string PathExtGen)
| Connect to PLC(create handles) More...
void | LoadInputSignal ()
| Load input signal from Files\InputSignal.xml More...
void | InitializeInputSignal (int SelectInSignal)
| Initialize external generator - send input signal to PLC More...
void | Start (DataProperties iDataProp)
| Start external generator More...
void | Stop ()
| Stop external generator More...
void | OnNotification (object sender, AdsNotificationEventArgs e)
| Event read data from PLC More...
void | EnableTimeout ()
| Enable check timeout More...
void | DisableTimeout ()
| Disable check timeout More...
void | Disconnect ()
| Disconnect from PLC More...
void | LoadData (string Path)
| Load data from file to class More...
void | ResetErrorState ()
| Reset error state to Offline state More...

## Public Attributes
Collection< InputIdentSignal > | ListInputIdentSignal = new Collection<InputIdentSignal>()
| List of input identification signal More...
List< MeasureData > | MeasuredData = new List<MeasureData>()
| Storage data More...

## Properties
double | ActCycleTime`[get]`
| Get cycle time of actual measurement (task). If var is 0 -> it is uninitialized. More...
eStateExtGen | GetActStateExtGen`[get]`
| Get actual state of external generator More...

## Events
StateEventHandler | ChangedState
| Event for changing of actual generator state. More...
ActionEventHandler | DataArrived
| Data arrived from IPC More...
ActionEventHandler | CurrentArrived
| Values of current arrived from IPC More...
ActionEventHandler | ErrorOccured
| Occured error in some event More...

## Private Member Functions
void | WatchdogTimer_Tick (object sender, EventArgs e)
| Timeout elapsed - error More...

## Private Attributes
const Int32 | MaxNumberItemsInBuffer = 10000
| Maximal number of item in one part of buffer More...
const Int32 | MaxNumberPartsOfBuffers = 3
| Maximal number parts of buffer More...
const Int32 | MaxNumberItemsInCurrentBuffer = 1000
| Maximal number of item in one part of current buffer More...
const Int32 | MaxNumberPartsOfCurrentBuffers = 3
| maximal number parts of current buffer More...
eStateExtGen | ActStateExtGen = eStateExtGen.Offline
| Actual state of External Generator in PLC More...
int | h_bInit
| Handlers of variables in PLC More...
int | h_bStart
int | h_bStop
int | h_bIdentDone
int | h_bStepResDone
int | h_nLengthInputSignal
int | h_nNumberRepeat
int | h_nPeriodInputSignal
int | h_nAmplitudeInputSignal
int | h_eModeControl
int | h_aBufferInputSignal
int | h_nAmplAuxMove
int | h_fFreqAuxMove
int | h_aFullBuffer
int | h_aWriteFullBuffer
int | h_nIndexItemBuffer
int | h_bSendFinished
int | h_aFullCurrentBuffer
int | h_aWriteFullCurrentBuffer
int | h_nIndexItemCurrentBuffer
int | h_bError
int | h_nErrorId
int | h_nStepResPreTrigger
int | h_nStepResTime
int | h_nStepResInitLevel
int | h_nStepResFinalLevel
int | h_fCycleTimeTask
int | h_bCycleTimeDone
int | h_nAllowPosRange
int | h_bEnablePosRangCheck
int | h_nAllowTorqueRangeIdent
int | h_bEnableTorqueRangCheckIdent
int | h_nAllowTorqueRangeStRes
int | h_bEnableTorqueRangCheckStRes
int | h_StatePlc
int | h_bWatchdogIn
int | h_bWatchdogOut
int | h_tTimeout
int | h_bEnableTimeout
int [] | h_aBufferCommandValue
| Handlers of buffers(arrays) in PLC More...
int [] | h_aBufferFeedbackValue
int [] | h_aBufferCurrentValue
TcAdsClient | tcClient
| ADS TwinCAT Client for connection to PLC More...
AdsStream | dataStreamaFullBuffer
| ADS streams for event driven reading More...
AdsStream | dataStreamaFullCurrentBuffer
AdsStream | dataStreambIdentDone
AdsStream | dataStreambStepResDone
AdsStream | dataStreambCycleTimeDone
AdsStream | dataStreambError
AdsStream | dataStreamStatePlc
AdsStream | dataStreambWatchdogIn
BinaryReader | binReadaFullBuffer
| Auxiliary readers for ADS streams More...
BinaryReader | binReadaFullCurrentBuffer
BinaryReader | binReadbIdentDone
BinaryReader | binReadbStepResDone
BinaryReader | binReadbCycleTimeDone
BinaryReader | binReadbError
BinaryReader | binReadStatePlc
BinaryReader | binReadbWatchdogIn
string | ActExePath
| Path to external generator in PLC More...
bool [] | FullBuffer
| Flags for full/empty buffers in PLC More...
bool [] | FullCurrentBuffer
UInt16 | ActualNumberReadBuffer
| Actual number of part of buffer for reading [0..2] More...
UInt16 | ActualNumberReadCurrentBuffer
| Actual number of part of current buffer for reading [0..2] More...
bool | IdentificationDone = false
| If identification is done so var = true (only for internal use during Running state) More...
double | iActCycleTime = 0
| Cycle time of actual measurement (only for internal use during Online->Running state). If var is 0 = it is uninitialized. More...
DispatcherTimer | WatchdogTimer = new DispatcherTimer()
| Watchdog - timer More...
TimeSpan | Timeout = new TimeSpan(0)
| Timeout for comunication between App and PLC More...

## Detailed Description

Class for control of external generator in PLC

## Constructor & Destructor Documentation

## ◆ TwinCatExtGen()

TwinCatIdent.TwinCatExtGen.TwinCatExtGen | ( |  | ) |

Constructor

## Member Function Documentation

## ◆ Connect()

void TwinCatIdent.TwinCatExtGen.Connect | ( | string | AdsNetId,
|  | int | AdsPort,
|  | string | PathExtGen
| ) |  |

Connect to PLC(create handles)

Parameters

  AdsNetId |
  AdsPort |
  PathExtGen | path to external generator in PLC

## ◆ DisableTimeout()

void TwinCatIdent.TwinCatExtGen.DisableTimeout | ( |  | ) |

Disable check timeout

## ◆ Disconnect()

void TwinCatIdent.TwinCatExtGen.Disconnect | ( |  | ) |

Disconnect from PLC

## ◆ EnableTimeout()

void TwinCatIdent.TwinCatExtGen.EnableTimeout | ( |  | ) |

Enable check timeout

## ◆ InitializeInputSignal()

void TwinCatIdent.TwinCatExtGen.InitializeInputSignal | ( | int | SelectInSignal | ) |

Initialize external generator - send input signal to PLC

Parameters

  SelectInSignal | Number of selected input signal from ListInputSignal

## ◆ LoadData()

void TwinCatIdent.TwinCatExtGen.LoadData | ( | string | Path | ) |

Load data from file to class

Parameters

  Path |

## ◆ LoadInputSignal()

void TwinCatIdent.TwinCatExtGen.LoadInputSignal | ( |  | ) |

Load input signal from Files\InputSignal.xml

## ◆ OnNotification()

void TwinCatIdent.TwinCatExtGen.OnNotification | ( | object | sender,
|  | AdsNotificationEventArgs | e
| ) |  |

Event read data from PLC

## ◆ ResetErrorState()

void TwinCatIdent.TwinCatExtGen.ResetErrorState | ( |  | ) |

Reset error state to Offline state

## ◆ Start()

void TwinCatIdent.TwinCatExtGen.Start | ( | DataProperties | iDataProp | ) |

Start external generator

Parameters

  iDataProp |

## ◆ Stop()

void TwinCatIdent.TwinCatExtGen.Stop | ( |  | ) |

Stop external generator

## ◆ WatchdogTimer_Tick()

void TwinCatIdent.TwinCatExtGen.WatchdogTimer_Tick | ( | object | sender,
|  | EventArgs | e
| ) |  |
| private

Timeout elapsed - error

Parameters

  sender |
  e |

## Member Data Documentation

## ◆ ActExePath

string TwinCatIdent.TwinCatExtGen.ActExePath
| private

Path to external generator in PLC

## ◆ ActStateExtGen

eStateExtGen TwinCatIdent.TwinCatExtGen.ActStateExtGen = eStateExtGen.Offline
| private

Actual state of External Generator in PLC

## ◆ ActualNumberReadBuffer

UInt16 TwinCatIdent.TwinCatExtGen.ActualNumberReadBuffer
| private

Actual number of part of buffer for reading [0..2]

## ◆ ActualNumberReadCurrentBuffer

UInt16 TwinCatIdent.TwinCatExtGen.ActualNumberReadCurrentBuffer
| private

Actual number of part of current buffer for reading [0..2]

## ◆ binReadaFullBuffer

BinaryReader TwinCatIdent.TwinCatExtGen.binReadaFullBuffer
| private

Auxiliary readers for ADS streams

## ◆ dataStreamaFullBuffer

AdsStream TwinCatIdent.TwinCatExtGen.dataStreamaFullBuffer
| private

ADS streams for event driven reading

## ◆ FullBuffer

bool [] TwinCatIdent.TwinCatExtGen.FullBuffer
| private

Flags for full/empty buffers in PLC

## ◆ h_aBufferCommandValue

int [] TwinCatIdent.TwinCatExtGen.h_aBufferCommandValue
| private

Handlers of buffers(arrays) in PLC

## ◆ h_bInit

int TwinCatIdent.TwinCatExtGen.h_bInit
| private

Handlers of variables in PLC

## ◆ iActCycleTime

double TwinCatIdent.TwinCatExtGen.iActCycleTime = 0
| private

Cycle time of actual measurement (only for internal use during Online->Running state). If var is 0 = it is uninitialized.

## ◆ IdentificationDone

bool TwinCatIdent.TwinCatExtGen.IdentificationDone = false
| private

If identification is done so var = true (only for internal use during Running state)

## ◆ ListInputIdentSignal

Collection<InputIdentSignal> TwinCatIdent.TwinCatExtGen.ListInputIdentSignal = new Collection<InputIdentSignal>()

List of input identification signal

## ◆ MaxNumberItemsInBuffer

const Int32 TwinCatIdent.TwinCatExtGen.MaxNumberItemsInBuffer = 10000
| private

Maximal number of item in one part of buffer

## ◆ MaxNumberItemsInCurrentBuffer

const Int32 TwinCatIdent.TwinCatExtGen.MaxNumberItemsInCurrentBuffer = 1000
| private

Maximal number of item in one part of current buffer

## ◆ MaxNumberPartsOfBuffers

const Int32 TwinCatIdent.TwinCatExtGen.MaxNumberPartsOfBuffers = 3
| private

Maximal number parts of buffer

## ◆ MaxNumberPartsOfCurrentBuffers

const Int32 TwinCatIdent.TwinCatExtGen.MaxNumberPartsOfCurrentBuffers = 3
| private

maximal number parts of current buffer

## ◆ MeasuredData

List<MeasureData> TwinCatIdent.TwinCatExtGen.MeasuredData = new List<MeasureData>()

Storage data

## ◆ tcClient

TcAdsClient TwinCatIdent.TwinCatExtGen.tcClient
| private

ADS TwinCAT Client for connection to PLC

## ◆ Timeout

TimeSpan TwinCatIdent.TwinCatExtGen.Timeout = new TimeSpan(0)
| private

Timeout for comunication between App and PLC

## ◆ WatchdogTimer

DispatcherTimer TwinCatIdent.TwinCatExtGen.WatchdogTimer = new DispatcherTimer()
| private

Watchdog - timer

## Property Documentation

## ◆ ActCycleTime

double TwinCatIdent.TwinCatExtGen.ActCycleTime
| get

Get cycle time of actual measurement (task). If var is 0 -> it is uninitialized.

## ◆ GetActStateExtGen

eStateExtGen TwinCatIdent.TwinCatExtGen.GetActStateExtGen
| get

Get actual state of external generator

## Event Documentation

## ◆ ChangedState

StateEventHandler TwinCatIdent.TwinCatExtGen.ChangedState

Event for changing of actual generator state.

## ◆ CurrentArrived

ActionEventHandler TwinCatIdent.TwinCatExtGen.CurrentArrived

Values of current arrived from IPC

## ◆ DataArrived

ActionEventHandler TwinCatIdent.TwinCatExtGen.DataArrived

Data arrived from IPC

## ◆ ErrorOccured

ActionEventHandler TwinCatIdent.TwinCatExtGen.ErrorOccured

Occured error in some event

The documentation for this class was generated from the following file:

- C:/Users/matusa.BECKHOFF/Documents/Indentifikacia sustav/System Identification WPF/SysIdentifi/SysIdentifi/TwinCatExtGen.cs