Retain Counter and Increment Encoder value at power on
Hi,
I'm using CPU AXC F 2152 and AXL F CNT2 INC2 , the application i'm working has both counter and encoder application and it requires the value of both to be retentive and hold on power on , the problem i am facing problem that the value of encoder and Counter is not retentive and clear out on power-on
Comments
Hi muas1994,
did you connect a variable to the process datum and did you select the retain property for the variable?
BR
DivisionByZero
Yes , i select checkmark for Retain for both Counter and Increment Encoder but data still not retain at power on and clear both counter and Incremental encoder register
I guess the values are overwritten by the module process data. Can you set the counter value via module parameter? If so you could initialize the module in an event task (e.g. Warm start).
It might be a workaround to save the values in a separate retain variable and use this as an offset to calculate the actual values.
How to initialize module in event task ??
The task can be created in the task and events editor
I can't tell you if it's possible to initialize the module.
Hi Muas,
Please update with regards to above issue.
Thanks,
Ramesh Kumar
(rkumar@phoenixcontact.com)
i search and read soo much but i can't find a way to initialize Counter and Encoder module like we have in Siemens where we have counter control block to assign counter register same last value before power off in OB100 startup Organization Block
But we have event enable task in PLCNEXT like Cold , Warm or Hot start, where in my case 1024 ppr encoder is counting 0.51m of fabric per revolution so i calculated total fabric length as
LengthTotal:=(CounterValue* 0.51/1024) + LengthLast;
and Add Event Enable task for Warm and Cold Start in ESM2 where i done
LengthLast:=LengthTotal;
Hence even though counter reset but my length value remain retentive