- Pull up the Dashboard (View --> Dashboard). This creates a tab called Dashboard.
- Click on the HSIO tab on the top left of your BRX PLC image. This pulls up the "Setup BRX High Speed I/O" dialog.
- The top box is labeled "Input Functions (Counter/Timer/Pulse Catch)". Your encoder will use one of these 3 customizable Functions. Press one of the <Function> buttons. This pulls up the "Setup BRX High Speed Input Function" dialog.
- By default the "Disabled" tab is displayed. On this tab are various Help buttons that you can press to read about the 3 kinds of custom settings available; Counter, Timer, or Pulse Catch. Also notice the tabs across the top corresponding to these 3 kinds of custom settings. In your case, you'll probably want to use the Counter. Click on the Counter tab at the top to enable this setting and display the Counter configuration dialog.
- The first thing to notice is the Device Name. By default it is "HsCtrTmr1." But you can change it to something that makes a bit more sense. This name is going to be used in your ladder program. Here, in the use of this function, you can use as many as 5 input pins to accomplish various things. By default "Up Counter" is selected as using the first HS Input 1 (X1) of your BRX. The button to the right highlights in red showing you that it will count the rising edges of the encoder pulse. Pressing this button will change whether you want to count rising, falling, or both edges of your pulse. If you choose a quadrature encoder, then this button will then show you 1X, 2X, or 4X, again, telling it how you want to count the edges of your quadrature encoder pulses.
At this point, it is up to you to configure your hardware the way you want. You choose which high-speed input pin(s) you want to use on your BRX PLC. Also, if your encoder is a quadrature (requiring at least two inputs), then you can choose that as well ("Quad Counter"). If you choose that, then you'll now have two inputs available to designate for wiring (Count A, and Count B). Also, you can hardwire a reset pulse by clicking "Enable Reset Input" and choosing an input on your BRX PLC. You can also enable scaling and have the count represented in scaled values instead of raw pulses by clicking the "Enable Scaling."
After setting up the hardware in this manner, you <OK> out of the dialogs and write the configuration down to the PLC.
When you program you ladders, you can reference the asynchronous counter using the name you have it as a structure that has individual members like:
- $HsCtrTmr1.Acc (signed double-word) - the raw count
- $HsCtrTmr1.ResetLevel (bit) - when ON holds the raw count at Reset Value, OFF lets it count
- $HsCtrTmr1.ResetEdge (bit) - a transition to ON resets the raw count to the Reset Value (normally zero unless you told it otherwise).
- ...etc.
Hope this gets you off to a good start. Feel free to ask questions here, or email me at support@hosteng.com