Category Archives: sensor

BRX PLC Shifting Instructions

PLC shifting instructions will move bits in memory areas a fixed amount when instructed. Bits are on/off, 1 or 0 and are usually associated together to form a memory location. The memory location can be used for numbers or positions.
PLC BITS NUMBERS AND POSITION is a post that will review the different methods that the PLC will interpret the information in memory
We will be looking at the shifting (moving) of the bits within the memory location in several different ways. ROTL rotate left, ROTR rotate right, Math shift left operator, Math shift right operator, Math unsigned shift right operator and SR shift register are some of the instructions in our BRX PLC that will shift bits.
Let’s look at some samples of each of the above mentioned instructions. Continue Reading!

BRX PLC Math Instructions

Math instructions are used to perform mathematical calculations. The BRX PLC has math instructions that can be used in a wide variety of applications. We will be looking at the INC increment, DEC decrement, LERP linear Interpolation, RANDSEED Random Number Seed and the MATH Calculated Expression instructions. Your automation system that you implement may involve some or all of these instructions. As a system integrator you will require the use of these instructions in your commissioned programs.
Let’s get started with the BRX PLC Math Instructions. Continue Reading!

BRX PLC High Speed IO

The BRX series of programmable logic controllers has built in high speed inputs and outputs. Every CPU will have either 6 or 10 high speed inputs (HSI) available depending on the model. These inputs can be used for input frequencies from 0 to 250Khz. 250Khz represents 250000 input counts per second that can be coming from devices connected to your PLC like an encoder. Every BRX CPU unit also has 2, 4 or 8 high speed outputs (HSO) available depending on the model. The outputs can send a frequency of pulses out up to 250Khz. Due to the speed of the IO, these functions available on the BRX PLC will operate asynchronous with the PLC scan time.
We will be looking at sending an output of pulses at different frequencies from our BRX PLC and inputting these back into the high speed inputs of the PLC. So our output will be wired back into our input. We will then display the frequency of the input pulses and the count. As a system integrator, this ability to send and receive high speed inputs and outputs can prove very useful to you in the field when commissioning your automation system.
Let’s get started with the BRX PLC High Speed IO. Continue Reading!

Create an Analog Voltage Input Tester for a PLC

We will create a simple and inexpensive analog voltage tester for a PLC using a potentiometer and a 9VDC battery. The potentiometer will be 5K ohms. This should be enough impedance for most analog inputs of the programmable logic controller. (PLC) Voltage impedance for analog voltage inputs are in the mega ohm range where current input is typically 250 ohms. Our tester will be for analog voltage inputs (0-10 VDC). Check your input specifications before wiring anything to your PLC. I have used this tester for other voltage inputs along with a meter to ensure that the voltage levels do not get out of range for the input signal.
Analog inputs to the PLC are continuous and can come in a variety of signals. These signals can come from temperature, flow rate, pressure, distance, etc. Continue Reading!

Wiring Interposing Relays

Interposing relay means a device that will separate two different circuits. The isolation can be for current consumption, voltage differences, voltage references or a combination of both current and voltage. We can use these relays to help connect our inputs and outputs on our programmable logic controller. (PLC) Continue Reading!

The 7 Essential Parts of a PLC System

When I was in school PLC’s were just in their infancy. We were taught that the PLC consisted of the central processing unit (CPU), analog and digital inputs and outputs. Everything was programmed with dedicated handheld devices and/or software devices on specialized hardware. We now have modern PLC systems that are capable of so much more. Let’s look at how we can now break up these modern PLC system into the seven essential components.

CPU
Inputs and Outputs (I/O)
Analog I/O
Specialty I/O
Programming Tools
HMI
Networking Continue Reading…

AdvancedHMI to Solo Process Temperature Controller

Modbus RTU will be the serial (RS485) method in which we will communicate between the AdvancedHMI Screen and the Automation Direct Solo Process Temperature Controller.
We can address up to 247 (Solo 1 to 247) devices on this master – slave protocol. A maximum of 32 devices (Nodes) on the network can communicate to the master. A review of the Modbus RTU protocol can be seen at the following URL.
http://www.rtaautomation.com/technologies/modbus-rtu/

AdvancedHMI is a free HMI programming package the runs on Microsoft Visual Studio. It can be downloaded at the following URL.
https://sourceforge.net/projects/advancedhmi/

Connections:
We will be running the AdvancedHMI software on the computer. One of the USB ports will have an USB to RS485 adapter and communicate RS485 to the Solo process temperature controller.

See the following post to install the USB to RS485 adapter.
http://accautomation.ca/usb-to-rs485-pc-adapter-installation/

Solo Controller Settings:
In the Initial Setting Mode we will change the on line configuration to on and make the changes to the Modbus settings as follows: 9600 Baud, Even, 7 Data Bits, 1 Stop Bit, Modbus ASCII Format. We will leave the default unit number as 1. See the following post to set the controller:
http://accautomation.ca/solo-process-temperature-controller/

Modbus RTU (Addresses)
The following address will be used in our project:


AdvancedHMI will use the Modbus Decimal value in the PLCAddressValue to determine the information that you want to get. For a list of all Modbus addresses that can be used in your project, refer to the Solo Manual located a the following URL:
https://www.automationdirect.com/adc/Manuals/Catalog/Process_Control_-a-_Measurement/Temperature_-z-_Process_Controllers

Screen Display: (AdvancedHMI)
Here is what our screen will look like:

We have mimicked the look of the solo process temperature controller. Our PV and SV values are DigitalPanelMeters from the AdvancedHMI toolbar.  The eight output indicators are just labels.

Our ModbusRTUCom1 settings are as follows:

Settings: 9600, 8, Even, One StopBit and Station 1 should all match the settings in the Solo process temperature controller that we did previously.
PollRateOverride will allow us to determine how often the communication will take place to the controller. (250msec)
The PortName will be the same port number that the computer will communicate out of. This will be set when you install the USB to RS485 adapter. It may change if a different USB port is used.

The DataSubsciber1 will be used to determine the status of the controller.

PLCAddressValue = 44139

We read the value of the eight status bits and convert this into a string so we can determine the status of each of the individual bits. Here is the code that is used to do this. It is the only code required for this application.

Private Sub DataSubscriber1_DataChanged(sender As Object, e AsDrivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        Dim i As Integer = DataSubscriber1.Value
        Dim Status As String
        Status = Convert.ToString(i, 2).PadLeft(8, "0") '8 bits
        'There are 8 bits that we need to check and account for on our screen. 
        'Modbus Decimal - 44139
        'Bit 0 - ALM3 - Alarm 3
        'Bit 1 - ALM2 - Alarm 2
        'Bit 2 - C degrees
        'Bit 3 - F degrees
        'Bit 4 - ALM1 - Alarm 1
        'Bit 5 - OUT 2 
        'Bit 6 - OUT 1
        'Bit 7 - AT - Auto Tuning

The complete AdvancedHMI code for this application can be downloaded at the end of the post.

The PV and SV indicators are DigitalPanelMeters as mentioned above.


They both have four digits with a decimal position of 1. This will give us a value between 000.0 and 999.9.
The SV includes a keypad to change the set value. KeypadScaleFactor is set to 0.1 to allow for the decimal place.

Included in our display is a BasicTrendChart from the AdvancedHMI toolbar.


You want to make sure that the YMaximum and YMinimum settings are set so the values will not go past these settings. If they do then the graph line will disappear from the chart at that point and time.
This will show a running trend for the last 5 minutes.
Polling rate is 250msec x 1200 points in the chart = 300 000msec
300 000msec / 1000 = 300 seconds
300 seconds / 60 (seconds in minute) = 5 minutes

Notes: Displaying Extended ASCII Symbols in Visual Studio (VB.NET)
You can display any symbol in the visual studio environment by holding the ‘Alt’ key down and typing the decimal number of the symbol that you want. In our example the degrees symbol is Alt 248.
Here are the extended ASCII symbols:

http://www.asciitable.com/

Running the Application:

You will notice that the response rate is very quick. (250msec) As the PV, SV or indication values change, the screen will get updated.

The trend chart will show the last 5 minutes of the PV value. 

As you can see, programming the AdvancedHMI to communicate to the Solo process temperature controller is very easily done.

Download the AdvancedHMI code for this project here.

Watch on YouTube : AdvancedHMI to Solo Process Temperature Controller
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.

Solo Process Temperature Controller

The SOLO Temperature Controller is a single loop dual output process temperature controller that can control both heating and cooling simultaneously. It is available in 1/32, 1/16, 1/8 and 1/4 DIN panel sizes and is UL, CUL and CE approved.

There are four types of control modes:
PID (Auto Tuning (AT) function)
P stands for proportional and accounts for present values of the error – It reacts to the amount of error which is the difference between the SP (Set Point) and the PV (Present Value)
I stands for integral and accounts for past values of the error – It uses math to basically find the approximation of area under the curve.
D stands for derivative and accounts for possible future values of the error, based upon rate of change – It uses math to determine the slop of the error over time and multiply this by the derivative gain.
AT – Auto Tuning as the name implies will automatically cycle your control system through two cycles and set the PID parameters.

ON / OFF
On/Off control is the simplest form of control. In the case of temperature the output will be on when the temperature is below set point. When the temperature gets above the set point of the controller the output will be off. When this cycling occurs frequently, you can add a hysteresis to the output. This will limit the time the output goes on and off by a number of degrees.

Manual
Manual mode is when you need to control the output directly. By entering manual mode the operator can adjust the values of the output(s).

Ramp / Soak control
The Ramp / Soak control mode is used to control the outputs according to the pre-programmed SP patterns with the PID control method. The Solo can have eight programs with eight steps each. Note: This can be increased with the additional use of hardware and software via HMI or PLC.

The available outputs include relay, voltage pulse, current, and linear voltage. There are up to three alarm outputs available to allow seventeen alarm types in the initial setting mode. SOLO can accept various types of thermocouple, RTD, or analog input. This means that cascade control is possible with these controllers.

Cascade (Application)
When you use the output of one of the Solo process controllers as the input to another, this would be cascade control.

It has a built in RS-485 interface using Modbus slave (ASCII or RTU) communication protocol.
The Solo Process Temperature Controller can be configured through the buttons on the front of the unit or by the configuration software. Monitoring of up to four controllers at once can be done thought the same configuration software.

The following is the wiring of the Modbus Serial communication. We will use a USB to RS485 converter from Automation Direct. (USB-485M)
Installation and operation instructions can be found at the following link: USB to RS485 PC Adapter Installation

The solo process temperature controller needs to be setup before we can communicate to it. The default setting is ‘Off’ for the On-Line Configuration. Here is the way to change into the different modes in the Solo.

In the Initial Setting Mode we will change the on line configuration to on and make the changes to the Modbus settings as follows: 9600 Baud, Even, 7 Data Bits, 1 Stop Bit, Modbus ASCII Format. We will leave the default unit number as 1.

Our controller is now set to communicate.

Download the documentation and/or configuration and monitoring software at the following URL link:
http://support.automationdirect.com/products/solo.html

The configuration and monitoring software does not have to be installed. You just need to download the file “slsoft.zip”.
Once downloaded right click on the file and select “Extract All…”. The file ADC1105.exe can now be run.

The recommended screen resolution is 1024 x 768. If you do not have this resolution then there is another program that will allow us to create a shortcut to this program and change our default resolution. After we exit the program, our screen resolution will return to its original state.

Reso is a free application that works well. It can be downloaded at the following URL link:
http://www.bcheck.net/apps/reso.htm

Download the exe file (reso.exe) into the same extracted folder that you have the ADC1105.exe file.

Click on the reso.exe file in the folder to run the application.
Click the Browse… button and select the ADC1105.exe solo configuration software.
Under the Graphics Mode: Resolution: select 1024×768
We can leave the rest to the defaults as shown below. Now Click Create Shortcut.

Put the shortcut in the same directory as the software that was downloaded.

We will receive notification that the shortcut was created. Click OK.

Our folder will now look like this.

Click on our shortcut (ADC1105 (at 1024×768)) to start the Automation Direct Solo Series Configuration Software.

There are six icons on the main menu. Follow these in order from left to right to setup or troubleshoot your system.

Under the Com port setup we configure the serial port of the computer to communicate to the Solo. In our case we will use COM5, 9600, Even, 7 Data Bits, 1 Stop Bit, Modbus ASCII Format.

In the Configuration menu we will select the address of the controller that we will be communicating. This will be the default of the Solo which is 1.

Selecting Connect will then communicate to the Solo process temperature controller and you will see on the screen a picture of the controller with the PV, SV and indicator lights active.

This screen will now allow you to set up all of the parameters in the Solo. Once you enter a value it will be red on the screen. After hitting enter on the keyboard and the value will then be sent to the controller and be displayed in black again.

The recorder screen is used to monitor the temperature over time. You can monitor up to ten Solo Controllers at once.

Command Test is used to send individual Modbus command out. This is done in Hexadecimal.

The software for the Solo Process Temperature Controllers is very functional. Using the Reso software, you will be able to put the Solo Software in the 1024 x 768 that it was created for without manually changing the screen every time.

Watch on YouTube : Solo Process Temperature Controller

Watch on YouTube : Analog Input to a Solo Process Temperature Controller
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.

PLC Programming Example – Paint Spraying

We will look at a PLC basic tutorial of a paint spraying station. Following the 5 steps to program development this PLC programming example should fully explain the procedure for developing the PLC program logic. Ladder will be our PLC programming language.

We will be using the Do-more Designer software which comes with a simulator. This fully functional program is offered free of charge at automation direct.

Define the task:

What has to happen?

Paint spraying system where boxes are fed by gravity through a feeder magazine one at a time onto a moving conveyor belt. Upon the start signal, boxes are pushed towards the conveyor by valve 1. This is a cylinder which extends and retracts which operates switches S1 and S2 respectfully. A spraying nozzle paints each box as it passes under the paint spray controlled by valve 2. A sensor (S3) counts each box being sprayed. When 6 boxes have been painted the valve 2 shuts off (paint spray) and valve 1 (cylinder) stops moving boxes onto the conveyor. Three seconds later the conveyor stops moving and the hopper with its load moves forward (valve 3) where it is emptied. Ten seconds later the hopper returns to the original position. The cycle is then complete and waits for a start signal again.

Define the Inputs and Outputs:

Inputs:
Start Switch – On/Off (Normally Open) – NO
Stop Switch – On/Off (Normally Closed) – NC
S1 – Valve 1 (cylinder retract) On/Off – NO
S2 – Valve 1 (cylinder extend) On/Off – NO
S3 – Box Detected- On/Off – NO
Outputs:
Motor – On/Off (Conveyor Run)
Valve 1- Cylinder to feed boxes – On/Off
Valve 2- Paint Spray – On/Off
Valve 3- Cylinder to move hopper – On/Off

Develop a logical sequence of operation:

Fully understanding the logic before starting to program can save you time and frustration.

Sequence Table: The following is a sequence table for our paint spraying application.


1 – Input / Ouput ON
0 – Input / Output OFF
x – Input / Output Does not Matter
When power goes off and comes on the sequence will continue. This means that we must use memory retentive areas of the PLC. The stop pushbutton will stop the sequence. The start will resume until the end.

Develop the PLC program:

The best way to see the development of the programmable logic controller program is to follow the sequence table along with the following program. You will see the direct correlation between the two and get a good understanding of the process.

This is the main process start and stop bit. V0:0 is used because it is memory retentive.

Control of the Motor (Conveyor) and the paint spray is done with the V0:0 contact in front of the actual PLC output. The conveyor and paint spray will stop when the timer 0 is done. This is the delay after the last box is detected to allow the box to be painted and loaded onto the hopper.

Control of the box movement onto the conveyor. As long as we have the process start and the hopper count is not complete this will allow the cylinder to put boxes on the conveyor.

Count number of boxes in the hopper via S3. The counter is memory retentive.

Timer to stop the conveyor and spray after the last box is detected for the hopper. This will allow time for the box to be sprayed and loaded into the hopper.

Hopper movement to load and unload the boxes.

The hopper unload timer is to unload the boxes and will then trigger the reset conveyor timer, box counter and the process start bit (V0:0).

Test the program:


Test the program with a simulator or actual machine. Make modifications as necessary. Remember to follow up after a time frame to see if any problems arise that need to be addressed with the program.

Watch on YouTube : PLC Programming Example – Paint Spraying
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.

PLC Programming Example – Shift Register (Conveyor Reject)

Allot of times when programming a PLC you need to track what has previously happened. Shift registers allow you to do just that. We will look at a PLC basic tutorial of a conveyor belt and reject station. Following the 5 steps to program development this PLC programming example should fully explain the function of shift registers. Ladder will be our PLC programming language.

We will be using the Do-more Designer software which comes with a simulator. This fully functional program is offered free of charge at automation direct.

Define the task:

What has to happen?

A start pushbutton (NO) is used to start the conveyor and a stop pushbutton (NC) is used to stop. Sensor B detects product on the conveyor belt and sensor A will detect if it is too large and needs to be rejected. The product is tracked along the conveyor belt and when under the reject station the Reject Blow Off will expel the bad product. Product is randomly placed on the conveyor belt, so an incremental encoder is used to track the conveyor movement. The reset pushbutton (NO) will signal that all of the product on the conveyor has been removed between the sensors and reject blow off.

Define the Inputs and Outputs:

Inputs: Start Switch – On/Off (Normally Open) – NO Stop Switch – On/Off (Normally Closed) – NC Reset Switch – On/Off – NO Motor Encoder – On/Off – This will give a discrete signal when the conveyor is moving. It picks up the movement of the free wheel. Sensor A (Part Reject) – On/Off – NO Sensor B (Part Present) – On/Off – NO

Outputs: Motor – On/Off (Conveyor Run) Air Blow Off – On/Off (Reject)

Develop a logical sequence of operation:

Fully understanding the logic before starting to program can save you time and frustration.

Sequence Table: The following is a sequence table for our conveyor reject application.

It is a simple sequence table, but clarifies the following: When power goes off and comes on the sequence will continue. This means that the shift sequencer must be memory retentive. Sensor A and B must be on to get tracked with a shift register.

Shift Registers: The Shift Register (SR) instruction shifts data through a predefined number of BIT locations. These BIT locations can be a range of BITs, a single Word or DWord, or a range of Words or DWords. The instruction has three inputs. Data, Clock and Reset. The data input will load the beginning bit with a ‘1’ if it is on or ‘0’ if it is not. Clock input is used to shift the data through the shift register. In our example, we will be using the encoder on the conveyor to track the reject container. So each pulse of the clock represents a distance on the conveyor. The last input is the reset. It will place ‘0’ in all of the bits within the shift register.

Develop the PLC program:

Start and stop of the conveyor motor.

Shift register to track the rejected parts. This will move the bits with each pulse of the encoder. Note that the ‘V’ memory is used because it is memory retentive.

This will look at the bit in front of the reject station. We can measure and count off the length (conveyor) and then find out what the bit location will be at the reject location.

Test the program:

Test the program with a simulator or actual machine. Make modifications as necessary. Remember to follow up after a time frame to see if any problems arise that need to be addressed with the program.

Notes: Sometimes you can use multiple shift registers in your program. This can be helpful if you want to actually track the container as well as the rejects. You could also use bit shift right (BSR) and bit shift left instructions (BSR) to do the same thing as we did with the shift register instruction. In the Do-more PLC it is rotate left (ROTL) and rotate right (ROTR) instructions. Always check your instruction set of the controller that you are working with before starting to program.

Watch on YouTube : PLC Programming Example – Shift Register (Conveyor Reject)

Additional information on shift registers can be seen at the following URL:
http://accautomation.ca/plc-programming-example-sorting-station-shift-register/
This PLC programming example will look at sorting coloured tags into three different exits. The 3D simulation will use three different shift registers to trigger when to direct the correct colour tag.
Watch the sequence of operation video below.
Watch on YouTube : PLC Programming Example – Sorting Station Testing

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.