Category Archives: number

PLC Bits Numbers and Position

People often ask “What is a PLC?” and “PLC Meaning”. A programmable logic controller (PLC) is a piece of hardware that isolates inputs from outputs. Programs are written to look at the inputs solve logic and set the outputs to perform work. Today we are going to look at the basic fundamental way we program. Every PLC company will do this…

Everything in the programmable logic controller actually boils down to bits in the memory.

It is these bits that we manipulate in order to accomplish the work that we need done by the PLC. The instruction set is the method we use to do this. In general, there are several ways to view the bits. Discrete input and output, Numbers and Position of bits will be covered. Understanding the different ways in which we can view these bits will help in developing programs.
Bits are part of the memory of all PLC systems. The memory can be retentive or non-memory retentive. Memory retentive means that if power is lost to the PLC, the status of the bit remains the same when power is restored. If the bit is non-memory retentive, and power is lost the bit returns to the off state. Addressing refers to how the controller understands what memory location to look at. When we address memory in the PLC we can do this in two different ways:
Direct Addressing: Specify a location of the memory location
Indirect Addressing: Specify a location that contains a value to point to the memory location required.

Refer to the manual of the specific PLC that you are using for the way in which memory is addressed and if it is memory retentive or not.

Discrete bits are the basic building blocks in the PLC. When we talk of digital I/O this is referring to the individual bits that you can wire switches, pushbuttons, proximity sensors, or any other device that is either on or off. (1 or 0) They can be usually wired to the PLC as a normally open or normally closed contact. The ladder logic is written in a way that you examine the bit as either on or off.
HOW PLC INPUTS WORK

HOW PLC OUTPUTS WORK
We also must look at the frequency (rate of change from off to on) of the input bits or output in some cases. The maximum frequency that we can read an input to the PLC will be determined by the scan of the PLC.
Example:
A 2 ms Scan (0.002 second) means that we can read the inputs and solve the logic in 2 ms. In order to ensure that the input is read in both states (on / off) we have to ensure that the input is off or on for at least 2 ms. The maximum frequency (Switching / Second) that the input could switch would be 2 ms = 1/.002 times per second = 500hz

Numbers in the PLC are all based on binary. Analog inputs and outputs are based upon the number of bits put together in order to display the range for the input. (12 bit or 16 bit) The values from the analog 12bit input will go from 000 to FFF base 16 (Hex). Hexadecimal is used to display the binary bits in the word or register. Some of the more common numbering systems in the PLC are binary, hexadecimal, BCD (binary coded decimal) and octal (based on 8 bits)

Additional Information on understanding numbering systems in the PLC:
What Everybody Ought to Know about PLC (Programmable Logic Controller) Numbering Systems

Position of the bits within the word, stack or accumulator can be very useful. Usually we can use this to track items. The typical example of this is to track items on a conveyor belt. The belt movement is usually a pulse input from an encoder. A sensor indicates the item on the conveyor.
PLC PROGRAMMING EXAMPLE – SHIFT REGISTER (CONVEYOR REJECT)

Bits are the basic building blocks that we use to program programmable logic controllers. The three ways to view bits (Discrete, Number and Position) will help use to understand the different ways to program.
Here are some additional links that you may find helpful:
Five Steps to PLC Program Development
PLC Programming Example – Process Mixer
PLC Programming Example – Shift Register (Conveyor Reject)
PLC Programming Example – Paint Spraying

The Secret of Using Counters
The Secret of Using Timers

Watch on YouTube : PLC Bits Numbers and Position
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.

Implementing the Omron CX Server DDE and Excel

Utilizing the CX Server DDE Manager will allow us to provide a link to the information in the Omron PLC. This link can be placed on an Excel spreadsheet. Charts, graphs, etc. can be made from the data. We will create links on an excel spread sheet from a CQM1H and a CP1L PLC. The information will then be displayed as a bar graph comparing the first ten memory areas.

Dynamic Data Exchange (DDE) is a channel through which correctly prepared programs can actively exchange data and control other applications within Microsoft Windows. The DDE manager will allow us to set up all of the links.

Start the DDE Manager by clicking Start/Programs/Omron/CX-Server/DDE Manager

This will start the DDE Manager and place an icon on your toolbar at the bottom of your screen. The application will run minimized.

Right-click on the minimized DDE Manager icon and select Project/New.

Assign a filename (ACC DDE.cdm) to the CX-Server project that you will create, and save it.

The create project will minimize to the taskbar. Right-click on the minimized DDE Manager icon and select Project/Edit.

This will call up the DDE Manager Project Editor. We can now add the PLC’s (Devices) and Points that we want to display.

Select File/New/PLC, or hit the PLC Icon on the taskbar.

Under Change PLC, we can now enter the information about how we are communicating to the programmable logic controller.

Device Name: – Name in which the DDE Manager will call the PLC
Device Type: – The model of PLC that will be connected
Network Type: – This is the communication method that we will be talking with the device.

In our example we will use the following two Omron PLCs.

  • CQM1H – SYSMAC WAY (Omron Host Link Protocol) Communication Port  11, 9600, E, 7, 2. Unit #00
  • CP1L – USB

 Once we have the PLC information, we can now add points that will contain the information that we wish to retrieve from the units. Select File/New/Point  or select the point editor icon to start the point editor.

On the Logical tab you can give a name (Or Change) to the point in the PLC to get. Select the Physical tab.

On the physical tab we set the following information:
PLC: – This is the list of PLCs entered in the previous step
Data Location: – The memory location that we want to read from
Internal Data Type: – This is the interpretation of the data that we are reading. (Example: Bit, Word, BCD, etc.)
Command Modifier: – This is used if we need to Force Set / Reset the data location. This can be used to override the PLC program. Use with caution.
Press OK when finished setting the address.

 Our point is now programmed. You will notice the symbols before the name of the point. This tells us at a quick glance what type of data we are looking at. Please refer to the CX Server Runtime manual for all of the symbol meanings.

Fill out the remaining points for our example.
CP1L – D0 to D9
CQM1H – DM0 to DM9

Start Microsoft Excel.

Go back to the DDE manager and the points under the Project Editor. We can now select the first ten items in the list. Click the first one and then move to the last item. Hold the shift while clicking the last item will select all of them between.
Hit the DDE Link icon.

In Excel, we now paste the information onto the worksheet. (Ctrl + V) Right click the cell and select paste.

The information will now be displayed and updated  on your worksheet.
The update time will depend on the interval set in the DDE Manager. Right-click on the minimized DDE Manager icon and select Update Interval…

We can also set individual point update times in the DDE link item. The default update time is set via the DDE Manager but we can also set the time in the individual points on the spreadsheet.
DDE Update Default Link:
=CDMDDE|’C:\ACC DDE.cdm’!’\CP1L D0′
5 Second Update Link:
=CDMDDE|’C:\ACC DDE.cdm’!’\CP1L D0,5′

In the Project Editor of the DDE Manager you can see the first 10 memory areas are being used. This is the yellow triangle with the lightning bolt symbol. (You will not be able to delete the point if it is in use.)

Calling up an excel file with the links embedded, will give you a Security Alert – Links warning. Select ‘Enable the content’ and then hit OK.

Here is an example of the finished excel file. We have 10 memory locations from each PLC listed. We have inserted a graph that will dynamically change when the values are read.
Download the excel file here.

 As you can see implementing the CX Server DDE Manager is not a difficult task. It provide a quick and efficient way to view the information that we need.

Additional Information:
Excel – Conditional Movement of Data

Watch on YouTube : Implementing the Omron CX Server DDE and Excel
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.

Building a PLC Program That You Can Be Proud Of – Part 4

In part 1 we looked at writing PLC programs to control a traffic light using discrete bits and then using timed sequencing using indirect addressing. Part 2 used indirect addressing for inputs as well as output to control the sequence of pneumatic (air) cylinders in the program. Part 3 returned to the traffic light application and expand our program significantly. We looked at the sequence of operation using Input, output and mask tables. Part 4 will now continue with the programming of the logic in the PLC.

Let’s look at the sequence that we are controlling:
Note that I have colour coded the outputs that will be on in the sequence. This makes it easier to read how the lights will behave. All bits without ‘1’ are assumed to be ‘0’. The pedestrian walk signals flash before they change to the do not walk signals.

The weekend sequence looks like this. We have overlap of the red signal lights. The arrows are not used.

The weekday off peak times sequence looks like this. We have an advanced flashing green light for the north and west traffic.

The weekday peak times sequence is as follows. The turn arrows have been added for the north/south and west/east directions.

It is important to note that the sequencing and information contained in these charts must be understood fully before programming can begin. Take the time to review and understand the following tables. Here is a copy of the excel table complete with the inputs, mask and outputs.

This method of programming can have vast number of applications. Here are some of the advantages of using this method:

  • Modification of the program without extensive rewriting
  • Integration with a Human Machine Interface (HMI) to control, modify and/or troubleshoot
  • Ability to sequence forward and backward
  • Easily understood logic to follow. Looking at he pointers can the on compare instruction will quickly tell you what sensor is not being made.
Troubleshooting this method of programming is easily done. Compare the bits in the input pointed word to the actual bits form the input in binary format. The difference is the input/output that is not working.

The program is basically broken down into three sections:

  • Inputs – Setting bits in the input channel based upon actual and internal conditions.
  • Control  – Control of the pointers, mask and setting the output channel.
  • Outputs – Using the output channel to activate the actual and internal actions required.

 Inputs:

The program is all controlled by one on-delay timer. This sets the minimum time between each step.

Control:

This section of the control will tell the PLC what to do when the unit is first powered on. It resets the pointers and moves the initial output setting to the output word. You will see that since we have three different sequences running, there are three different reset rungs in parallel. The table input pointer is compared to the last value +1 of the sequence running.

The mask calculation is next. This is used to ignore the inputs that we do not want to see or may not know the status during the execution of the program.  

You will notice that the first three sequences are all the same. On this step we then determine if the pointers need to be changed for the other two. The first is for weekday off peak times.  

This is for the weekday peak times.  

We now compare the actual inputs after the mask with the input table word. If they are equal then move the output table word to the output channel and increment the pointers to the next step.  

Outputs:

The actual outputs are set using the output word bits. You will note that the flashing green lights are done when both green outputs are not on. This way will give me the greatest flexibility when developing different sequences. The do not walk signal is not part of the sequence but is controlled when the flashing walk or walk is not on.

The program will not change much for completely different sequences.

This program and the data tables can be downloaded here. Note that in order to run this program you must call up the input, mask and output tables and write them to the simulator or PLC.

In Part 5 will will make a Game of Simon by learning all about bit manipulation and sequencers.

Watch on YouTube : Building a PLC Program that You can be Proud Of – Ultimate Traffic Light Control

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.

Building a PLC Program That You Can Be Proud Of – Part 3

In part 1 we looked at writing PLC programs to control a traffic light using discrete bits and then using timed sequencing using indirect addressing. Part 2 used indirect addressing for inputs as well as output to control the sequence of pneumatic (air) cylinders in the program. We will now return to the traffic light application and expand our program significantly.

Let’s build on the traffic light sequencing used in part one with inputs for pedestrian and car detection. We will also throw in the time of day so that during weekday peak hours an advanced arrow will be used. Advanced green (flashing) will be used when the traffic is detected in the turning lane during the off peak hours.

Programming using this method of sequencing requires allot of time up front before we start the actual PLC program. However this method makes the program easier to understand, troubleshoot and modify in the future.

Remember that the PLC programmer must know everything about the machine and operation before programming.

If we just start writing code, then we will constantly be correcting and modifying based on trial and error. I use a spreadsheet program to plot out the inputs, outputs and mask tables. We will go into the details of this below.

Lets look at the inputs:

We set up the input table in words V0 to V499. Each bit in the table will be compared to the signals coming the actual signals wired or programmed in the PLC.
Bit 0 is the time input which will control the entire program interval. Next we have the Car Detection signals on Bits 1 to 4. The pedestrian signals are pushbuttons coming from Bits 5 and 6. The left turn signals are located in Bits 7 to 10.  The real time clock functions will come from Bits 12 to 15.

Lets look at the outputs:

The output table will be in words V1000 to V1499. The input word will be compared to the actual inputs and the corresponding output channel will be moved to the actual outputs. All of the output bits control lights. You will notice that there is a green light for each direction. This will give us the greatest flexibility when writing our PLC program. Pedestrian signals have a flashing output bit and just an output bit. There will be only one output but this bit will determine if it is flashing or not.

Masking Inputs:

The masking table will be in words V500 to V999. The masking bits will correspond directly to the input table bits. Using the mask will allow us to ignore the status of certain bits when using the compare instruction and setting the outputs.

The Mask table will be used by using an ‘AND’ word instruction. If the mask bit is on for the input then it will be used in the compare instruction. If the mask bit is off for the input then the value is always off using the compare.
Example:
1 ‘AND’ 1 = 1
1 ‘AND’ 0 = 0
0’AND’ 1 = 0
0 ‘AND’ 0 = 0

Once we have this all laid out in the spreadsheet, we can start filling out our sequence of events. Fill in the events based upon the time frame from input bit 0. I usually start by thinking about what happens when power is applied to the unit the first time. This exercise can be a struggle because you must know exactly what you want the sequence to be in order to fill out the table.

We will continue this next time by writing the code to do what our tables want. A review of the numbering systems can be found on this post. A copy of the spreadsheet can be obtained at the following link: PLC Traffic Sequence

Part 4 will continue with the programming of the logic in the PLC.

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.

How PLC Outputs Work

This post is a further follow up from my original ‘Here’s a Quick Way to Understand PLC Inputs and Outputs’. There are basically two different kinds of PLC outputs, Discrete and analog. Discrete outputs are either ‘ON’ or ‘OFF’; 1 or 0. You can think of them as a single light bulb. Analog outputs have a range to them. They are outputs that usually will control proportional valves, drive speeds, etc. They usually have one of the following signals that are outputted from the PLC: 4-20mA, 0-10VDC, 1-5VDC.

Discrete Outputs

The above diagram has three outputs. A coil, light and motor. The Ladder outputs Y0, Y1 and Y2 control the outputs respectfully. You will notice that when the Ladder output turns on, the corresponding output card bit LED turns on. This then will energise the output hardwired to the device.

The outputs are turned on or off at the end of every PLC Scan. The PLC logic is solved left to right, top to bottom in most PLCs. Physical outputs are not set / reset until an I/O refresh is performed at the end of every scan. This means that if I have a scan of 1msec, then the maximum time it will take to turn on/off the output is 1msec.

PLCs will sometimes have the ability to update the I/O in the middle of a scan. Please refer to your PLC manufacturers manual for this instruction. This can be used for updating the I/O quickly or controlling stepper drives for motors by giving them a pulse train output from the discrete PLC output. A pulse train is just a quick series of on/off states of the output.

Analog Outputs

An analog output converts a digital value to a voltage or current level that can be used to control (vary) physical outputs. In the example above we are controlling the speed of the motor. Words in the PLC will control the analog value.
Example:
4 – 20 mA current Output – 8 bit resolution
4 mA = 00000000 base 2 = 00 base 16
20 mA = 11111111 base 2 = FF base 16
For a review of numbering systems, follow the link below:
What Everybody Ought to Know About PLC (Programmable Logic Controller) Numbering Systems

In the industrial environment noise from variable frequency drives, improper grounding, etc. can interfere with your analog input. The following post will show a quick method to reduce this noise.
The Secret Of Getting Rid Of Noise On Your Analog Signal

Previous Post:
How PLC Inputs Work

Watch on YouTube : How PLC Outputs Work

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.

How PLC Inputs Work

This post is a further follow up from my original ‘Here’s a Quick Way to Understand PLC Inputs and Outputs’. There are basically two different kinds of PLC inputs, Discrete and analog. Discrete inputs are either ‘ON’ or ‘OFF’; 1 or 0. You can think of them as a single switch. Analog inputs have a range to them. They are inputs that usually will sense pressure, temperature, height, weight, etc.  They usually have one of the following signals that are inputted into the PLC: 4-20mA, 0-10VDC, 1-5VDC.

Discrete Inputs

The above diagram has two inputs. A normally open (NO)  and a normally closed (NC). When we talk about normally open and close, think of the condition of the input if no one touches anything. A normally open contact will not turn on the input to the PLC card in its ‘normal’ state. The normally closed contact will turn on the input to the PLC card in its ‘normal’ state.

Normally Open Input
The NO contact when activated will complete a circuit and turn on the PLC input. Ladder logic will then turn on if you use a normally open (Examine On) input in your program. See above diagram.

Normally Closed Input
The NC contact when activated will break a circuit and turn off the PLC input. Ladder logic will then turn off if you use a normally open (Examine On) input in your program. See above diagram.

As you can see with the diagram above this can get tricky to determine the on/off condition of the input. PLC logic can convert any signal by using normally closed (Examine Off) inputs in the program. In the field, I usually look at the PLC input lights, and wiring diagrams to determine the current state of the input. This is before diving into the program to troubleshoot.

Here is a link to wiring up discrete 3-wire sensors in the field. Here’s a Quick Way to Wire NPN and PNP devices

Analog Inputs

An analog input converts a voltage or current level into a digital value that can be stored and processed in the PLC. They use words to determine the signal coming from the device.
Example:
4 – 20 mA current Input – 8 bit resolution
4 mA = 00000000 base 2 = 00 base 16
20 mA = 11111111 base 2 = FF base 16
For a review of numbering systems, follow the link below:
What Everybody Ought to Know About PLC (Programmable Logic Controller) Numbering Systems

In the industrial environment noise from variable frequency drives, improper grounding, etc. can interfere with your analog input. The following post will show a quick method to reduce this noise.
The Secret Of Getting Rid Of Noise On Your Analog Signal

Here are some additional posts that you might find helpful.
How to make a Start / Stop / Jog circuit in a PLC
The Secret of Using Timers
The Secret of Using Counters

Watch on YouTube : How PLC Inputs Work

Watch on YouTube : Wiring (Testing) Analog PLC Input Click

Watch on YouTube : Wiring (Testing) Analog PLC Input Omron CP1H

Watch on YouTube : Wiring Contact (Discrete) PLC Inputs

Watch on YouTube : Wiring PNP Sensor to PLC

Watch on YouTube : Wiring NPN Sensor to PLC

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.

Here is a Method That is Helping PLC Programmers to Program Faster

PLC programming involves both direct and indirect addressing. Direct address programming involves writing each ladder logic rung to do the operation required. We often forget about using the powerful indirect addressing to solve our logic.

The below animated picture will show a simple example of using indirect addressing. This will use the MOVE instruction and transfer a word indirectly to output word V100. V[V0] means that the value in V0 will point to the V memory to get the value to move. You can think of this as a pointer for the memory location to move.

Of course we need to monitor V0. Our values are in sequence from V1 to V6. We need to ensure that V0 is always in the range from 1 to 6.

Lets take a look at a program sample using the Do-more Designer Software. We will set up the sequence similar to the animation above, but expand the program.
Just like above we will set up the pointer at V0 and the output at V100 memory locations. V1 to V37 will hold our output data sequence. This is outputs that we want to set on each event and/or time frame. You can see some of the registers and the corresponding values. These are set as a hexadecimal value. The following link will provide a review of the numbering systems in the PLC. (WHAT EVERYBODY OUGHT TO KNOW ABOUT PLC (PROGRAMMABLE LOGIC CONTROLLER) NUMBERING SYSTEMS)

This is the logic to set up the move instruction. The source is V[V0] which means the pointer is V0 in this memory area. The destination will be V100.

An internal timing bit ST5($100ms) is used to increment the pointer V0. This could also be done by an event or series of events. The pointer is then compared to ensure that it is between 1 and 37.

Finally the output word is then transferred to the physical outputs. This is done by using the MAPIO instruction. Each bit can be set independently.

p

This example uses indirect addressing to program a sequence based upon time. We could just as easily used indirect addressing to compare inputs to a table and set the outputs accordingly. You can see how this method can greatly reduce the amount of time to develop your program. This holds especially true if the sequence needs to be changed. It would be just a matter of changing data values in the table.

The following are separate posts that use indirect addressing:

Building a PLC Program You Can Be Proud Of – Part 1
This use the control of an intersection traffic light to demonstrate direct versus indirect addressing.

Building a PLC Program That You Can Be Proud Of – Part 2
A sample program to control valves. This uses indirect addressing for the inputs as well as the outputs.

Now You Can Have Robust Data Logging for Free – Part 1
Using indirect addressing, this sample program will log information in the PLC to be retrieved at a later time.

Indirect addressing is a powerful method of programming to simplify and program faster than you ever thought possible. You can even use indirect addressing in the PLC to scale a non-linear analog input signal. Let me know you thoughts on using indirect addressing. What can you come up with?

Watch on YouTube : Here is a Method That is Helping PLC Programmers to Program Faster

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.

The Secret Of Getting Rid Of Noise On Your Analog Signal

Allot of times in industrial environments we get noise on the analog signal input to PLC’s or other controllers. The noise can be generated by motors, bad wiring, etc.

Placing a 1- 100 uF capacitor on the input signal and ground (common to the cabinet)  will reduce the noise that the input is receiving.

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.

Here’s a Quick Way to Understand PLC Inputs and Outputs

The term I/O means Input/Output. I/O can come in two different types; Discrete or Analog Most people starting out leaning about programmable logic controls (PLC) are taught all about discrete input and outputs. Data is received from devices such as push-buttons, limit-switches etc. and devices are turned on such as motor contactor, lights, etc. Discrete input and output bits are either on or off. (1 or 0) The following program will show a motor control circuit stop start. Motor off:

Motor on:

Analog inputs Common input variables for analog are temperature, flow, pressure, etc. They are converted to an electrical signal into a PLC analog input. Standard electrical signals are 0 – 20 mA, 4 – 20 mA, 0 – 10 volts DC, -10 – 10 volts DC. Note: It is recommended that a 4 – 20 mA signal is best. If voltage is required, a resistor can be added to get a voltage input. Analog outputs Common output variables for analog are speed, flow, pressure, etc. They are converted from a word in the PLC to the output of the analog. The range of signal is then outputted to the device to control the position, rate, etc. Standard electrical signals to the device are 4 – 20 mA, 0 – 10 volts DC, -10 – 10 volts DC. Both Analog Inputs and Outputs use words to determine the signal going to or from the device. Example: 4 – 20 mA current Input – 8 bit resolution 4 mA = 000000002 = 0016 20 mA = 11111111= FF16 Example: 4 – 20 mA current Output – 8 bit resolution 0016 = 000000002 = 4 mA FF16 = 111111112 =20 mA For a review of numbering systems, follow the link below: What everyone should know about PLC numbering systems

 

Let me know if you have any questions or need further information.
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.

Here’s a Quick Way to Convert Grey Code into Binary for PLC

Grey Code
Grey Code is used because only one bit of data will change at a time. The following chart shows the conversion of Grey Code to Binary.

Number Binary Code Grey Code Number Binary Code Grey Code
0 0000 0000 8 1000 1100
1 0001 0001 9 1001 1101
2 0010 0011 10 1010 1111
3 0011 0010 11 1011 1110
4 0100 0110 12 1100 1010
5 0101 0111 13 1101 1011
6 0110 0101 14 1110 1001
7 0111 0100 15 1111 1000

It is important for absolute encoders because if the power is interrupted the encoder will know where it is within the one bit.

Example:
Power is interrupted when the encoder is between 7 and 8. If we are looking at Binary Code all of the bits would be effected and we would not be sure as to what number we are looking at for the encoder. Therefore we have lost position. In Grey Code only one bit changes so we will still be able to tell if we were on 7 or 8 if the power was interrupted.

The following sample PLC program will convert 4 bit grey code into binary code.
This code was written in an Automation Direct PLC software called Do-more Designer.

Do-more Designer Software
How to use video’s for Do-more Designer Software

Contact me for the above program. I will be happy to email it to you.
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.