1 BRX Technical TrainingHigh-Speed I/O (Counters & Timers)
2 High-Speed I/O BX10 BX10E 6 discrete IN (all high-speed)4 discrete OUT (2 high-speed) No analog IN No analog OUT No Ethernet port BX10E 1 analog IN 1 analog OUT Ethernet port
3 High-Speed I/O BX18 BX18E 10 discrete IN (all high-speed)8 discrete OUT (4 high-speed) No analog IN No analog OUT No Ethernet port BX18E 1 analog IN 1 analog OUT Ethernet port
4 High-Speed I/O BX36 BX36E 20 discrete IN (10 high-speed)16 discrete OUT (8 high-speed) No analog IN No analog OUT No Ethernet port BX36E 4 analog IN 2 analog OUT Ethernet port
5 High-Speed I/O High-Speed Inputs High-Speed Outputs Counter TimerAxis/Pulse Out Step/Direction CW/CCW Quadrature PWM Outputs Table Driven Outputs
6 High-Speed Inputs (Up Counter)Default Device 2 & 3 Default Structure: $HsCtrTmr1, 2 & 3 Up Counter – increments on edge Rising, falling, both Requires 1 onboard input Regular-speed inputs can be used here but most counting would require high-speed inputs
7 High-Speed Inputs (Up Counter)Up Counter ($HsCtrTmr1, 2 & 3) Structure members: .Acc (signed double-word; RO) – count value .AtResetValue (bit; RO) – indicates .Acc is at reset value .ResetLevel (bit; R/W) – set ON to hold .Acc to the reset value .InhibitCount (bit; R/W) – set ON to stop .Acc from counting pulses .ResetEdge (bit; R/W) – rising edge resets .Acc to the reset value .ResetValue (signed double-word; R/W) – reset value .ScaledValue (real; RO) – only relevant if scaling is configured (next slides) .EnableCapture (bit; R/W) – set ON to enable a capture (requires Capture signal input configuration) .CountCaptured (bit; RO) – indicates a count has been captured (requires Capture signal input configuration) .CapturedValue (signed double-word; RO) – captured count value (requires Capture signal input configuration)
8 High-Speed Inputs (Up Counter)Up Counter ($HsCtrTmr1, 2 & 3) other features: Reset Input – hardware reset signal Inhibit Input – hardware inhibit signal Position scaling – scales Min/Max raw counts to desired engineering Min/Max units .ScaledValue (real; RO) – contains scaled engineering units as configured
9 High-Speed Inputs (Up Counter)Up Counter ($HsCtrTmr1, 2 & 3) other features: Rate scaling – scales raw counts/time base to get a rate Unit Defintion Raw Counts/Unit – how many counts per unit Unit Time Base – how many units per time base Scale Offset – added to the calculated value Calc Options Calc Interval – how often to calculate the value (i.e. how many counts were there in this time?) Data Filter – number of seconds over which the calculated scaled values will be averaged (smoothing effect)
10 High-Speed Inputs (Up Counter)Up Counter ($HsCtrTmr1, 2 & 3) Rate structure members: .ScaledValue (real; RO) – contains scaled engineering units as configured .FilterTimeConst (real; R/W) – how often (in seconds) the rate scale is calculated
11 High-Speed Inputs (Up Counter)Rate Scaling Example 𝑹= 𝑈 𝑃𝐶 +𝑆 Let’s say we are calculating RPM & we know if we receive 800 counts in 1 minute that is 1 RPM Let’s say we received 2 counts in 100ms: P = 0.1/2 = 0.05 𝑹= 60 (0.05)(800) +0=1.5 RPM R: Rate U: “Unit Time Base” (in sec) P: (time of sample)/(counts in sample) C: “Raw Counts/Unit” S: “Scale Offset”
12 High-Speed Inputs (Down Counter)Down Counter – decrements on edge Exactly like the Up Counter
13 High-Speed Inputs (Quad Counter)Quad Counter – increments/decrements according to A/B signals 1X, 2X or 4X Requires 2 onboard inputs Regular-speed inputs can be used here but most counting would require high-speed inputs
14 High-Speed Inputs (Quad Counter)Quad Counter ($HsCtrTmr1, 2 & 3) Structure members: Same as Up & Down Counter with the addition of: .QuadError (bit; RO) – indicates both A & B inputs came on at the same time Inputs are not actual quadrature signals Frequency of A & B signals is too fast
15 High-Speed Inputs (Quad Counter)Quad Counter other features: Same as Up & Down Counters with the addition of: Rotary Mode – pulses coming from a rotary source that wrap back to a count of 0 at a certain value (specify the total number of counts in the rotary range) E.g. Rotary Count of 3600 yields count values from 0 to 3599
16 High-Speed Inputs (Quad Counter)Quad Counter Position & Rate Scaling: Position & Rate scaling – exactly same as Up & Down Counter
17 High-Speed Inputs (Bidirectional Counter)Bidirectional Counter – increments/decrements count based on pulses on Count Input according to state of Direction Input All other functions are exactly the same as Quad Counter
18 High-Speed Inputs (Up/Down Counter)Up/Down Counter – increments count for pulses on Count Up Input and decrements count for pulses on Count Down Input All other functions are exactly the same as Quad Counter
19 High-Speed Inputs (Edge Timer)Default Device 2 & 3 Default Structure: $HsCtrTmr1, 2 & 3 Edge Timer – measures time (µsec) between edges Rising-rising, rising-falling, falling-rising, falling-falling Requires 1 onboard input Regular-speed inputs can be used here but most counting would require high-speed inputs
20 High-Speed Inputs (Edge Timer)Edge Timer ($HsCtrTmr1, 2 & 3) Structure members: .Acc (signed double-word; RO) – current time value (µsec) .LastTime (signed double-word; RO) – last measured time (µsec) .TimerStarted (bit; RO) – indicates .Acc is timing (i.e. 1st edge seen) .TimerComplete (bit; RO) – indicates .Acc has new time in it (i.e. 2nd edge seen) .Timeout (bit; RO) – indicates Timeout time has past (requires Enable Timeout & Timeout value to be configured) .EnableTimer (bit; R/W) – if Free Run is not enabled, this bit must be set ON for the Edge Timer to begin looking for 1st edge .ScaledValue (real; RO) – only relevant if scaling is configured (next slides) .FilterTimeConst (real; R/W) – how often (in seconds) the interval scale is calculated (next slides)
21 High-Speed Inputs (Edge Timer)Edge Timer other features: Interval scaling – converts µsec time values to units per time period (e.g. calculating RPM from the time between gear teeth on a rotating shaft) Unit Defintion Timed Intervals/Unit – ratio of timed edges to desired unit (e.g. 20 gear teeth = 1 revolution; thus 20) Unit Time Base – how many units per time base (e.g. for 1 revolution per minute, RPM, choose “units per minute”) Calc Options Data Filter – number of seconds over which the calculated scaled values will be averaged (smoothing effect)
22 High-Speed Inputs (Edge Timer)Rate Scaling Example 𝑺= 𝑈 𝑇×𝐸 +𝑂 Let’s say we are calculating RPM & there are 20 teeth on our gear, thus: Timed Interval/Unit = 20 teeth (edge times)/RPM Unit Time Base = “units per minute” (1 RPM per minute) Let’s say we received an Edge Time of 151,555 µsecs (time between teeth): 𝑺= 60 20× = RPM S: Scaled unit U: “Unit Time Base” (in sec) T: “Timed Intervals/Unit” E: Edge Time measured (in sec) O: “Scale Offset”
23 High-Speed Inputs (Dual-Edge Timer)Dual-Edge Timer – measures time (µsec) between edges of 2 different pulses Requires 2 onboard inputs Regular-speed inputs can be used here but most counting would require high-speed inputs Otherwise identical to Edge Timer