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;
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;