read loops

Diana

Member
Join Date
Jan 2016
Location
Ontario
Posts
12
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?
 
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,
 
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.
 
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?
 
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?
 
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.
 
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?
 
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.
 
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?
 
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.
 

Similar Topics

Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
138
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
73
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
103
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
134
Hello, So i managed to read the string coming from control logix and put a string display in PanelView 800. Now I am struggling to do the other...
Replies
1
Views
115
Back
Top Bottom