OBIOPulseTrainOutput (FB)
FUNCTION_BLOCK OBIOPulseTrainOutput EXTENDS OBIOBasePulseTrainOutput
Access the pulsetrain output functionality for AC500 eco CPU.
- precondition
the respective channel is configured as PTO channel.
2 binary outputs are used for 1 PTO channel, up to 2 PTO channels are possible.
Note
This block should just be called once per cycle otherwise inconsistent values could be send to PRU, if send twice in short time.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
EnableBOOLFALSE
A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. Execution will continue forever until a falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.
AbbLConC3
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConC3
ErrorBOOLFALSE
Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.
AbbLConC3
Input
ChannelBYTE0
Channel number, for encoder 0/1, for forward counter 0..3, for PulseTrainOutput 0/1
OBIOBaseCounter
SetBOOLSets counter value to CounterValueSet on rising edge
OBIOBaseCounter
CounterValueSetUDINTCounter value to set
OBIOBaseCounter
EnableLimitBOOLUse limits, FALSE: counts ‘endless’, TRUE: counts from 0 to LimitValueMax, starts again with 0 on overflow. A new value will be used with rising edge on Enable
OBIOBaseCounter
LimitValueMaxUDINT0
Upper limit, will count from 0 to < LimitValueMax-1 (with EnableLimit=TRUE), so the range for counting is LimitValueMax. The value has to be set while CounterValue < LimitValueMax. A new value will be used with rising edge on Enable
OBIOBaseCounter
Output
ErrorID0
Error code
OBIOBaseCounter
CounterValueUDINTActual counter value
OBIOBaseCounter
Input
StartBOOLStart pulses and initialize counters on rising edge (if NumberOfPulses>0 is used)
HaltBOOLHalt pulses, counter be preserved
CwCCwBOOLif true, Clockwise/Counterclockwise, else Pulse/Direction mode, can be changed with Start=FALSE
InvertBOOLInvert the moving and counting direction
DirectionBOOLdirection to be used for the next movement, can be changed with Start=FALSE
EnableFinestepsBOOLin case the frequency value is changed, a 100us update to reach the target frequency is enabled
FrequencyLREALfrequency min = (30 Hz or MaxFrequency/655) / max = 200 kHz. The input can be changed any time. With Frequency=0, the pulses will be stopped. Any value >0 will result in minimum value to be used.
NumberOfPulsesUDINTnumber of pulses, just values >=0 allowed, >0 means: issue a certain NumberOfPulses after rising edge of Start, =0 means: issue a endless number of pulses
MaxFrequencyUDINT200000
[Hz] max allowed value = 200kHz. Deviation with max frequency is 1%, slowest possible frequency is MaxFrequency/655, deviation for slowest frequency is 0.002%,, new value just used with Enable=FALSE
CycleTimeLREAL1
Cycle of plc task time in ms, just used when EnableFinesteps=TRUE, , new value just used with Enable=FALSE