5069-L306ER PLC and analog input read

ibora

Lifetime Supporting Member
Join Date
Dec 2008
Location
Izmir
Posts
66
Hi all,
I want to catch min piks of an analog signal when digital signal is on(pls see the attached oscillogram). My hardware is 5069-L306ER CPU and 5069-IF8/A analog inputs. Total 20 channels (as optional may increase to 30). I will have some questions:

1- I created a periodic task with 1mS to read and catch all channels. Is the time longer enough? How i can calculate the total duration as theoretically? Analog signal period is about 100mS

2- Below which programming method is more effective? Or do you have another suggestions?

Many thanks all

a) by comparing values:
////CH0
if SENSOR_CH_0 then
osri(OSRI[0]);
if OSRI[0].OutputBit then
ANALOG_VALUES_GLB[0] := 10000; //10000 will replace with analog max value
end_if;

ANALOG_VALUES[0] := ANALOG_CH_0;
if ANALOG_VALUES[0] < ANALOG_VALUES_GLB[0] then
ANALOG_VALUES_GLB[0] := ANALOG_VALUES[0];
end_if;
end_if;

b) by using MINC instruction:
////CH0
if SENSOR_CH_0 then
osri(OSRI[0]);
end_if;

MINC_0.Reset := OSRI[0].OutputBit;
MINC_0.In := ANALOG_CH_0;
MINC_0.EnableIn := SENSOR_CH_0;
MINC_01.ResetValue := 10000; //10000 will replace with analog max value
MINC(MINC_0);
ANALOG_VALUES_GLB[0] := MINC_0.Out;

analog_signal.jpg
 
You are trying to capture the minimum point of an analog input when a digital input is on.

1- I created a periodic task with 1mS to read and catch all channels. Is the time longer enough?

Check the program properties > Monitor tab for the scan times. If the scan time is more than 1000us max than 1ms is too short. You do not want any task overruns.

How i can calculate the total duration as theoretically?
Same as above, use the program properties monitor scan time max value to determine how long your program takes to run. Theoretically if you know how the scan time is for 10 inputs, and 20 inputs, you can calculate the time for 30 inputs.

There is also another add on tool called the 'Task Monitor Tool' that can be used to determine how long each task takes in the plc. You can use this tool to determine the total duration to run each part of the plc process.


2- Below which programming method is more effective?
I do not think the 5069 has the MINC instruction? But otherwise no idea, both would be ok. If you care about scan times try both and see which one is faster.


Make sure the IF8/A card has the setting for RPI set to however long your periodic task is, otherwise the analog input value will only update as fast as the rpi is set for.
 
I am not sure the OSRI instruction is coded correctly.

When the rising one-shot triggers, assign the current analog value, instead of assigning the value 10000, to the running minimum.

Code:
IF trigger_hi THEN
  IF ANALOG_VALUES[0] < ANALOG_VALUES_GLB[0]   (* Lower value ... *)
  OR NOT trigger_last THEN                     (* ... OR rising edge *)
    ANALOG_VALUES_GLB[0] = ANALOG_VALUES[0];
  END_IF;
ELSE
  IF trigger_last THEN                         (* On falling edge ... *)
    previous_min := ANALOG_VALUES_GLB[0];      (* ... save last minimum *)
  END_IF;
END_IF;

trigger_last := trigger_hi;                    (* for edge detection *)
 
Thank you for replies guys,
pk test, you're right. MINC instruction is not working on the 5069. So i eliminated this option.
drbitboy, when i started to the project i will consider your suggestion. Now i'm just creating the sw offline. The hw still not ready.

Thank you all again
 

Similar Topics

Hey y'all, I have a 5069-L306ER processor and have the IP address on A1 set. However A2 doesn't seem to talk to anything. I tried setting an IP...
Replies
2
Views
971
I am trying to upload from an AB controller ( device info attached). I'm using Studio 5000 v32.04.00. I reach the "Connected to Upload" dialog...
Replies
8
Views
1,557
Lol, our local Rexel has twenty-two 5069-L306er's back-ordered, so what's the deal with so many factory-sealed processors from china on eBay. Are...
Replies
11
Views
3,122
I have a fresh out of the box 5069-L306ER connected to power only. I am unable to set the IP address of the plc through USB OR ethernet using RS...
Replies
18
Views
7,352
[FAILURE] Device Identity: Error #11003: Unconnected Send timed out waiting for a response. I have a 5380 CompactLogix without any extra...
Replies
5
Views
2,242
Back
Top Bottom