You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 4th, 2017, 10:01 AM   #1
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
read loops

Hello! I have very little PLC knowledge and I am trying to modify a program. I have an input that used to be a 5V. currently the program looks at the input, see's 5V and passes.
the new software, this input is a pulsed input. I need to verify if the pulse is above a setpoint voltage. (say 2.5V)

I am thinking that I need to monitor the input and if it is above the setpoint, then set a bit true. I have tried to implement this, but I think it is hit and miss if the scan of the program is at the correct point in the pulse?

I was hoping to implement some sort of loop - where I could enter the loop and sit there looking at the input for 200ms or so? I looked at a subroutine - but what "holds" the software in the subroutine - isn't it just one scan and it returns to the main program?
  Reply With Quote
Old December 4th, 2017, 10:10 AM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,458
It would help to know the PLC that you are programming. What is the input card on the PLC? Will it accept analog or digital?

Regards,
__________________
Garry
http://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old December 4th, 2017, 10:15 AM   #3
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
Micrologix 1200
  Reply With Quote
Old December 4th, 2017, 10:26 AM   #4
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,458
Is the input to the PLC analog?

Regards,
__________________
Garry
http://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old December 4th, 2017, 10:35 AM   #5
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
sorry - I had to go check. I think it is coming in an analog card and then passing a SCP command?
  Reply With Quote
Old December 4th, 2017, 10:50 AM   #6
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
previously I was turning this input on and would read a 5V signal on this SCP output. (when the signal was good)
Now when I look at this SCP output, it pulses - it appears to be a square pulse between 0 and 5V.
  Reply With Quote
Old December 4th, 2017, 11:00 AM   #7
BlueAltezza
Member
United States

BlueAltezza is offline
 
Join Date: Nov 2012
Location: Cleveland, OH
Posts: 144
If you want to make sure the input goes to 5V within 200ms then try to set a timer and use the timer's tt bit to look at the input.
  Reply With Quote
Old December 4th, 2017, 11:19 AM   #8
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
I don't need to limit it to 200ms per say - I just need to monitor it for the 200ms. If I use the TT bit, will it monitor for the full 200ms? or just a scan of the plc if it is true, it will look at that bit? so, what I have now, is when I need to verify that input, I look at the bit. But depending on where it is in the pulse, I may get a low reading or it may pass. (think square wave) I need to look at a whole period of the square wave and determine - yes, the max positive pulse was greater than 2.5V - does that make sense?
  Reply With Quote
Old December 4th, 2017, 11:20 AM   #9
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
can I have a rung that says

request to read --- start timer
while TT is true --- check if input is greater than 2.5V --- if true, then pass test

will this constantly monitor - or will it be dependent on the scan timing of the plc?
  Reply With Quote
Old December 4th, 2017, 02:22 PM   #10
saultgeorge
Lifetime Supporting Member
United States

saultgeorge is offline
 
Join Date: Jul 2015
Location: Detroit
Posts: 73
You may have solved this, but from what I can gather that you are asking, I would build a rung with a GRT instruction and have that value say at 2.51. Use a real number for data type. Then I would fire a one shot with that GRT instruction when it came true and use a MOV instruction to send data or a value to other logic that you could monitor. Hope this will at least get you thinking.
__________________
Detroit City Limit: An Automation Alley Community
  Reply With Quote
Old December 4th, 2017, 02:36 PM   #11
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
the problem is that because it is a pulse input, I can't just read it one time. I have to read it continuously over a set period until I receive the input I want or I time out with a failure.

think of a square pulse. I want to ensure the amplitude of the positive side is above 2.5V. When I read the pulse input, I only receive that instant in time. I don't know if it is on the negative side, or positive or someplace in between. I need to take multiple readings over a set time frame to ensure I receive that maximum reading.

in other programming, you could set this to loop for x seconds while monitoring the input. if a voltage above the setpoint is read, a flag can be set.

I want to duplicate this in the plc format. I don't know how to do that? It appears that the entire plc scan time is affecting my readings. Most of the time this works, but occasionally the scan time? is such that the positive amplitude is never captured. I have confirmed on a scope that the pulse is always there, but sometimes (about 10%) it isn't captured by the plc. Is this a limitation of the plc? or am I just not creating the right command to capture it?
  Reply With Quote
Old December 4th, 2017, 02:37 PM   #12
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
then I have to reset it for the next step of the program. (read multiple times)
  Reply With Quote
Old December 4th, 2017, 02:46 PM   #13
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,743
I would check the level to be GRT or GEQ a value about half the amplitude. Then monitor for a set amount of time while storing the highest value received. At the end of the "record" period, pass or fail based on the stored "high score".

Set the minimum value to start recording at around half the expected amplitude or just below a value that you would expect to "see" from a faulty test. Clear the "high score" register on the rising edge of this comparison.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  Reply With Quote
Old December 4th, 2017, 02:53 PM   #14
Diana
Member
Canada

Diana is offline
 
Join Date: Jan 2016
Location: Ontario
Posts: 12
that is very similar to what I have implemented. However, the issue is that I don't always see the reading above my limit - even though the pulse is always there - I am assuming that this is an issue with the scan time of the plc, or an issue with my code?
  Reply With Quote
Old December 4th, 2017, 03:02 PM   #15
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,384
Sounds to me like you're attempting something that probably won't work on a PLC. You not only have the program sweep to deal with, it's unlikely that your analog input will even respond quickly enough with IO Image Table updates for you to detect the brief transitions that you are hoping to monitor. Many analog input modules are multiplexed so that only one channel is updated at a time. That's why PLCs offer High Speed Counter modules. They allow high frequency pulsed inputs to be processed on-board the module with a separate processor so that the latency inherent in the PLC's IO system can be overcome.

I don't think that the MicroLogix 1200 offers an "Immediate IO Update" function, since ControlLogix IO updates are inherently asynchronous to the PLC sweep. If you want to run a subroutine multiple times, you simply call the subroutine multiple times. You might be better off searching for a stand alone frequency module that could provide a discrete input under appropriate conditions, but I don't really understand exactly what it is that you're looking for from this pulsed input.
__________________
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Any idea how to access the Omron simulator? strantor LIVE PLC Questions And Answers 9 March 13th, 2015 06:01 PM
Multiple Controllers Read Same Tag kingnutin LIVE PLC Questions And Answers 5 July 23rd, 2014 12:56 PM
Tuning Interactive (series) Pressure Loops Jiftim LIVE PLC Questions And Answers 2 January 27th, 2014 04:53 PM
WinCC Continuous CSV read SYED.ABIDI LIVE PLC Questions And Answers 9 March 23rd, 2013 11:05 PM
how to read more data in a packet by CIP read data service(4C) chenhg LIVE PLC Questions And Answers 0 October 7th, 2008 03:31 AM


All times are GMT -5. The time now is 07:35 AM.


.