vasovas Posted August 10, 2020 Report Share Posted August 10, 2020 Hello, I have an issue reading the values of HSC by Ignition SCADA. PLC type: SM35-J-R20. Shortly, there is a simple logic calculating the total output from the machine, PNP proximity sensor is used to measure the number of the passing products, and it is connected to HSC input of the PLC. SCADA monitors the current and the previous value of the counter, and in case the counter has been reset when the batch is being changed (the previous value is bigger than the current value), the previous value is memorized and it is added to the current counter value, at the same time a tag value is incremented by 1 (this tag is like a flag, a proof that the counter has been reset) . Now, the problem: without reset of the counter, the flag shows increments, and the output is not calculated properly. The most important: 50% of the machines are equipped with SM35-J-R20, and the rest - with Omron CJ1M; the problem never has been faced on Omron machines. The communication protocol used for both type PLC is Modbus TCP. Any ideas what might be the root cause? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted August 10, 2020 MVP 2022 Report Share Posted August 10, 2020 Why are you doing the calculation of count in the SCADA instead of locally on the PLC? What resets your flag? I recommend posting your program here so we can take a look at the issue. Quote Link to comment Share on other sites More sharing options...
vasovas Posted August 10, 2020 Author Report Share Posted August 10, 2020 Hello, Flex727, this is exactly what I am doing actually - rewrite the PLC program...still, I should not have this issue. Concerning the flag, it is reset by script few minutes before midnight. Quote Link to comment Share on other sites More sharing options...
vasovas Posted August 11, 2020 Author Report Share Posted August 11, 2020 Hi again, PLC program changed and the part for previous counts accumulation works when the counter is reset. I wonder is there way to reset this accumulation from the previous day on the next day? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted August 11, 2020 MVP 2022 Report Share Posted August 11, 2020 4 minutes ago, vasovas said: I wonder is there way to reset this accumulation from the previous day on the next day? When SI 35 = 0, it's a new day. 1 Quote Link to comment Share on other sites More sharing options...
vasovas Posted August 12, 2020 Author Report Share Posted August 12, 2020 22 hours ago, Flex727 said: When SI 35 = 0, it's a new day. That will work if the machine ( the PLC) is ON at midnight, but if the machine is OFF, and it is started at 5 am? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted August 12, 2020 MVP 2022 Report Share Posted August 12, 2020 There is a full complement of RTC system integers available to help you with this basic programming issue. Those, along with the SB 2 system bit should give you what you need. Give it a try and report back if you're having difficulty. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted August 12, 2020 MVP 2022 Report Share Posted August 12, 2020 21 hours ago, vasovas said: but if the machine is OFF, and it is started at 5 am? Probably not likely, but wondering if you also need to allow for what is in the topic below. Also wondering if along with the topic's subject, you actually need to be using the HSC. cheers, Aus http://forum.unitronics.com/topic/6118-hsc-resets-dw-counter-to-after-power-cut/ Quote Link to comment Share on other sites More sharing options...
vasovas Posted August 13, 2020 Author Report Share Posted August 13, 2020 Hello, Ausman, thank you for your input, In fact, I have never faced such an issue with HSC values. My HSC values never have been lost on the next day. My task actually is to reset the HSC accumulated on previous day value once only - at the start of the machine next day. As Flex727 has advised, RTC SI and SB2 can be used for this purpose, and I use SI 37 , its value is incremented with 1 and stored to MI, so at the next power up, if it happens on the next day, that accumulated HSC value is reset. It works. Of course, now I have to implement mechanism to correct the MI value depending on what current month is. It needs some work, but as Flex727, nothing difficult. If you have brighter ideas how to do that, please advise. Thanks a lot! P.S. To reset only once (first startup in the morning), I will use increment flag, so in case the machine has been restarted during the day (which happens couple of times actually), I will check that flag value, if it is different from 0, HSC will not be reset. Quote Link to comment Share on other sites More sharing options...
Pavel M Posted August 13, 2020 Report Share Posted August 13, 2020 Hello vasovas, you can compare SI 37 with some MI on every start wih SB2 If it differs - store your HSC value, reset it and rewrite MI with SI 37 If it same - do nothing Must work fine if you don't get downtime month, but as you mentioned, you might also include SI 38 in condition 1 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted August 13, 2020 MVP 2022 Report Share Posted August 13, 2020 Vasovas, to me you are focussing on the wrong SI. From what you are saying this machine is working in a full working week, or 7/7 environment. Use SB2 to store SI34 to an MI sequence that compares if the numbers match. If the numbers match don't do anything, but if they are different then it is a new day. This is covered by Flex saying there's a host of SIs to play with. Also, my question as to whether you actually need to be using HSC? cheers, Aus Quote Link to comment Share on other sites More sharing options...
vasovas Posted August 14, 2020 Author Report Share Posted August 14, 2020 Hello, Ausman, the production is not always 7/7, it might be 5/7, 6/7 or 7/7, it depends. HSC definitely is not necessary, because the counting frequency vary from 15 to 30 Hz. I am not the author of the original program, so I tried to add only what was necessary for SCADA project. Regarding the set of SI, I used SI 37 and the program works for the time being, I keep on monitoring it in case there is some bug. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted August 14, 2020 MVP 2022 Report Share Posted August 14, 2020 If only even 1/7, SI34 still works. By "working week", I meant 5/7. But if you've got it going, no worries. I only mention the HSC usage because sometimes quirky problems are introduced unnecessarily into user's projects. cheers, Aus 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.