Click PLC to Stride Field IO Modbus TCP

The Click PLC can use remote inputs and outputs from Stride. The Stride Field I/O Modules are simple and compact. They provide an economical means to connect inputs and outputs to an Ethernet Modbus TCP communication network. Every module operates as a standalone Modbus TCP server and can be configured via a built-in web server.

Previously we looked at the Stride Field Remote IO Modules Modbus TCP Ethernet wiring and configuration.
Stride Field Remote IO Modules Modbus TCP Ethernet|
– Unboxing SIO MB12CDR and SIO MB04ADS Video
Powering and Configuring Video
We will be connecting two Stride remote inputs and outputs to the Click PLC. Modbus TCP will be the protocol over Ethernet to communicate to the SIO-MB12CDR and SIO-MB04ADS units.
SIO-MB12CDR
– STRIDE discrete combo module, Input: 8-point, 12-24 VDC, sinking, Output: 4-point, relay, (4) Form C (SPDT) relays, 2A/point, (1) Ethernet (RJ45) port(s), Modbus TCP server.
SIO-MB04ADS
– STRIDE analog input module, 4-channel, current/voltage, 16-bit, isolated, input current signal range(s) of +/- 20 mA, input voltage signal range(s) of +/- 10 VDC, (1) Ethernet (RJ45) port(s), Modbus TCP server.
We will be reading an analog voltage into the Click PLC from the remote IO unit. We will then set an output to pulse on and off at a time range indicated by this analog signal. The output will be on the other remote IO unit and will trigger the input to signal. We will look at the Frequency, Count, and Status of this input. Our Click PLC program will also take into consideration watchdog (communication time out) and power-up events for the Stride remote input and output units.
Let’s get started.

Previously in this series, we have discussed:
System Hardware – Video
Installing the SoftwareVideo
Establish CommunicationVideo
Numbering System and AddressingVideo
Timers and Counters
Counter Video
Timer Video
Compare and Math InstructionsVideo
Program Control InstructionsVideo
Shift RegisterVideo
Drum InstructionVideo
Send and Receive InstructionsVideo
AdvancedHMI CommunicationVideo
Firmware UpdateVideo
HMI Rotary Encoder Dial InputVideo
High Speed Counters Part 1
High-Speed Count Mode Video
– Interval Measurement Mode Video
Duration Measurement Mode Video
Frequency Measurement Mode Video
High Speed Counters Part 2
– External Interrupt Mode Video
Pulse Catch Mode Video
Filter Pulse Mode Video
Frequency Measurement and High-Speed Count Mode Video
Wiring Stack Light to Click PLCVideo
Wiring Push Buttons and Selector Switch to Click PLCVideo
Test and Assembly of Push Buttons and a Selector Switch – Video
Wiring an Inductive Proximity NPN PNP Sensor to the Click PLCVideo
Wiring a Capacitive Proximity NPN PNP Sensor to the Click PLCVideo
Wiring an Ultrasonic Proximity Sensor to the Click PLCVideo
Unboxing our UK1F Ultrasonic Proximity Sensor – Video
Analog Dusk to Dawn ProgramVideo
PID using Factory IOVideo
PID Instruction and Autotuning using Factory IOVideo
Logging Data with Time and Date StampVideo
Stride Field Remote IO Modules Modbus TCP Ethernet
Unboxing SIO MB12CDR and SIO MB04ADS Video
Powering and Configuring Video

Our entire series can be found here.

The programming software and manuals can be downloaded from the Automation Direct website free of charge.
Watch the video below to see Click PLC controller control analog and digital inputs and outputs remotely.

Click PLC System IP Addresses
Our click plc will act as the Modbus Client (Master). It will communicate to the stride remote I/O which are Modbus Servers (Slaves).
Call up the COM Port Setup window by using the main menu | Setup | Com Port Setup…

Select the Setup button on Port 1. This is the Ethernet port on the PLC.

Here is where we can set our IP address for the Click PLC Ethernet port.
We will set the Stride SIO-MB12CDR and Stride SIO-MB04ADS to 131 and 132 respectfully. This is shown in the configuration of the Stride remote IO above.

System Wiring

The first relay output of the Stride SIO-MB12CDR will be wired to the input of the first 24-volt sourcing input. This will allow us to see the input working and view the frequency and count values of the unit.

Using the voltage input tester that we created previously, we will be wiring this up to the first voltage input on the Stride SIO-MB04ADS unit.
Create an Analog Voltage Input Tester for a PLCVideo

Click PLC Program

Main Program
The main program will control the call to the communication subroutines and handle the main logic.

The first rung of code will call the communication subroutine for the SIO-MB12CDR. The watchdog timer event and the power-up event flags from the remote input and output unit will increment DS130 and DS131 respectfully.

Rung four will call the communication subroutine for the SIO-MB04ADS. The watchdog timer event and the power-up event flags from the remote input and output unit will increment DS132 and DS133 respectfully.

The analog input will control the on and off timer delay. This delay will control the first relay output.

The following lines of code will count the number of scans based on the relay output for the remote turning on and then the acknowledgment that the output is on from the remote IO unit. This will give users a good idea of the throughput of the system.
Watch the video below to see this program in action.

SIO-MB12CDR Program Subroutine

Here is the Modbus address chart for the remote IO unit.
Note: We have included all of the addresses and features of the card in our sample program. Your program may not need all of these features.
We will map the following with our program:
System Flags:
C110 – WatchDog Event – Communication timeout.
C111 – Power up Event – Power is first applied to the unit.
Digital Relay Outputs:
Output 1 – C141 – Status – C181 – Control
Output 2 – C142 – Status – C182 – Control
Output 3 – C143 – Status – C183 – Control
Output 4 – C144 – Status – C184 – Control
Digital Input Addresses:
Input 0 – C151 – Rising Edge – C161 – Falling Edge – 171
Input 1 – C152 – Rising Edge – C162 – Falling Edge – 172
Input 2 – C153 – Rising Edge – C163 – Falling Edge – 173
Input 3 – C154 – Rising Edge – C164 – Falling Edge – 174
Input 4 – C155 – Rising Edge – C165 – Falling Edge – 175
Input 5 – C156 – Rising Edge – C166 – Falling Edge – 176
Input 6 – C157 – Rising Edge – C167 – Falling Edge – 177
Input 7 – C158 – Rising Edge – C168 – Falling Edge – 178
Input 0 Frequency – DS105
Input 1 Frequency – DS106
Input 2 Frequency – DS107
Input 3 Frequency – DS108
Input 0 – 32-bit Counter – DD1
Input 1 – 32-bit Counter – DD2
Input 2 – 32-bit Counter – DD3
Input 3 – 32-bit Counter – DD4


Upon the first scan of the PLC or when the communications have completed for both units, we will start our communication. We will read the system flags, power up / safe and watchdog timer.

After a successful read, we will unpack the system flags and power up / safe bits. The watchdog timer will be transferred to the writing area.

If the watchdog event is enabled then keep it enabled with the write data to the system flags. This will also clear the power-up and watchdog event flags.

Power Up / Safe Bits for Outputs
Upon power-up, the four outputs automatically are either on / off according to Bits 08, 09, 10, or 11 in DH5. Upon the watchdog event happening the four outputs automatically are either on/off according to Bits 00, 01, 02 or 03.

Write the following information:
System Flags – Clearing any watchdog or power-up event flags.
Power up / Safe – Status of outputs on the remote IO when the unit powers up or when the watchdog event happens.
WatchDog Timer – Set the watchdog timer.

Read the status of the SIO-MB12CDR remote IO.

If the read is successful then separate the input and output bits. The registers are outputs, inputs, rising inputs, and falling inputs. See the list above.

Take the two registers (16 bits) for each of the inputs and combine them to form the 32 bit counter register for the first four inputs.

Determine if there are rising or falling edge inputs that need to be reset.

Reset the rising and falling edge flags for each input.

Write the outputs to the four relays.

Set the output relays.

A flag is set to indicate that the update for the SIO-MB12CDR is now complete.

SIO-MB04ADS Program Subroutine

Here is the Modbus address chart for the remote IO unit.
We will map the following with our program:
System Flags:
C210 – WatchDog Event – Communication timeout.
C211 – Power up Event – Power is first applied to the unit.
Analog Input Types:
Disabled = 00h, Volt = 02h, mA = 03h
Input Type CH0 – DH27 – #1 #0
Input Type CH1 – DH28 – #3 #2
Input Type CH2 – DH29 – #5 #4
Input Type CH3 – DH30 – #7 #6
Analog Input Addresses:
Analog Input #0 – DS201
Analog Input #1 – DS202
Analog Input #2 – DS203
Analog Input #3 – DS204
Analog Input #4 – DS205
Analog Input #5 – DS206
Analog Input #6 – DS207
Analog Input #7 – DS208

The first Modbus read will read the system flags and watchdog timer.
These registers will be placed in DH21 and DH23.

After a successful read, we will unpack the system flags. The watchdog timer will be transferred to the writing area.

If the watchdog event is enabled then keep it enabled with the write data to the system flags. This will also clear the power-up and watchdog event flags.

Write the following information:
System Flags – Clearing any watchdog or power-up event flags.
WatchDog Timer – Set the watchdog timer.

Read the input type of the SIO-MB04ADS remote IO.

Read the status of the SIO-MB04ADS Analog Signals remote IO.

A flag is set to indicate that the update for the SIO-MB04ADS is now complete. This will trigger the communication for the first unit again.

Monitoring the Communication (Program)
Using the data view we can view our program parameters.


Watch the video below to see the Stride remote inputs and outputs in action on our Click PLC.

Download the Click PLC program here.

Click PLC Support Links
The Click PLC can be programmed using free Click programming software from Automation Direct. Here is a link to the software.
https://support.automationdirect.com/products/clickplcs.html
The following links will help you to install the software and establish communication.
https://accautomation.ca/click-plc-installing-the-software/
https://accautomation.ca/click-plc-establish-communication/
The entire Click PLC series can be found at the following URL:
https://accautomation.ca/series/click-plc/

Stride Field Remote IO Modules Modbus TCP Ethernet Links:
Stride Remote Field IO Overview
Stride Field IO Modules Specifications

SIO-MB12CDR – Discrete Combination Module
SIO-MB12CDR User Manual

SIO-MB04ADS – Analog Input Module
SIO-MB04ADS User Manual

Modbus Learning Links:
Simply Modbus Frequently Asked Questions
Modbus TCP/IP Overview – Real Time Automation
All You Need to Know About Modbus RTU – Video

Watch on YouTube: Click PLC to Stride Field IO Modbus TCP
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.




Leave a Reply

Your email address will not be published. Required fields are marked *