Cegge

MrPLC Member
  • Content count

    21
  • Joined

  • Last visited

Posts posted by Cegge


  1. So I have done quite a bit of googling and i even reached out to our integrator but i am having a nuisance fault of "Watchdog Fault" Caused by periodic task overlap. The task is scheduled to start again before it is finished. I added all of the Programs in this task MAX scan time and it only came out to 102 ms. the task is scheduled for every 100 ms. The watchdog is set at 500 ms. The task is currently running at 146-148 ms and i confirmed this using a TON instruction at the end of the task followed by a reset.

    What can i do to get this down?? What would be the best practice? Move programs into another task? Make the task continuous? What would happen if i did make it continuous?

    I tried setting the task to 150 ms and the controller DID NOT like that. I was barely able to get back on line with it to change it back to 100 ms.

    CPU usage is at 91% and this task accounts for around 50% of that. Thank you all in advance for your help.


  2. As of right now I waiting on the AVE instruction to error out again so I can see what the values are in the array when it does error out. Last time it was nothing but the same value over and over again so I put an NEQ so that the new value has to be different from the calculated average in order for it to get loaded into the array. :shrug: Maybe this solved it?? so far this is the longest it has went without producing an error. If anyone has any idea why that would have possibly fixed it please let me know.

    49 minutes ago, BobLfoot said:

    I may be all wet here, but the AVE instruction is a multi-scan instruction if I remember correctly and the FFL/FFU doesn't reset or complete until the end of scan unless you manipulate the status bits by logic.  And you're using the same flag bit to trigger FFL and AVE.

    Try instituting an alternating flag / time bit and have the FFL execute when positive and AVE when negative.

    IF it's something in the SCAN, PRESCAN logic that will patch it.

    I see what your saying. If I get another error i will definitely try this. I don't think I am getting bad data in from the remote device.

     

    On 3/17/2020 at 5:48 PM, pcmccartney1 said:

    Certainly, you need to track down the source of the bad data.  But food for thought.

    After the AVE calc is done, copy it to another tag.  Then when the FFL is expected to occur, you could test for good data, if the data is bad stuff in the last calculated average.  This would prevent you from getting bad data in the array and or an extreme value that might skew the next average calc.

    I am not sure how i would implement this. I may not even fully understand what you are saying either. Your saying after each AVE calculation copy that value into another tag. How would i use this value to test for good/bad data? Is there an instruction or some way of testing to see if a value is a number?

     

    On 3/17/2020 at 3:47 PM, Joe E. said:

    It could be that the data is getting corrupted on the way. Is it always the same register (sample #8)? What device is at the other end of the MSG instruction?

    Yes it was in the same register the one time i caught it. Wouldnt the MSG instruction error out though if it had a communication problem? It is an NDC infared guage.

     

    On 3/17/2020 at 11:44 AM, Joe E. said:

    Check the code that's the source of your sample. "1.#QNAN" means that the previous operation returned a value that is "Not A Number". It's not a valid floating point number, so subsequent math operations won't work.

    https://stackoverflow.com/questions/4617796/1-qnan-error-c/4617839

    The link has some tests you can use in C++ that may or may not work in the PLC. I don't have a PLC on my desk any more (working on it...) or I'd test it for you. You need a way to verify the sample is valid before adding it to the array.

    I would have to do quite a bit of learning to get to where i could do testing in C++. I use python and javascript from time to time but i am still learning. This would be the best solution. If i could find a way to test for bad data before filling the array. 


  3. 5e70e4b4c0545_ArraySnapshot.JPG.c6cf8dd0

    I have another array with a length of 60.

    I'm not using the last one in either array. But the condition it errors out in is the same [60]=0 [59=1.#QNAN and the rest 1.35

    Sorry it took so long to respond. I set it up to stop filling the array when the AVE instruction errors out so i could get the results above. Any idea what causes this? They are both filled at the same time with a 1 sec pulse.


  4. A little background information here,

    I am trying to create a moving average so I accomplished it with the code (5e68eee776a49_LogicSnip.thumb.JPG.c17d49imaged attached)

    The problem i am having is the AVE instruction error bit goes true. it leaved me with a result of 1.#QAN 

    I did some googling and it said this is typically done when dividing by zero?? so i added a NEQ to 0 prior to loading the array. then it happened again. so i put the error bit in front of the FFL so it will stop loading the array when i get the error bit so i can see what values are in the array when it errors out.

    Has anyone else had this issue and what could you do to resolve it? I haven't had any luck find something that points me in the right direction. Thanks in advance for your help.


  5. The problem I am having is costs. The OEM of the machine has the program locked. There is only 4 devices on each machine. 2 i/o modules an HMI and a PLC. They are all small machines but we have no plans of having that machine being able to initiate communications out. I just want to read maybe 10 tags out of the machine. It's not worth the 2500 dollars per machine they want for the programs. That's 10 grand and it's just not worth it for what we are trying to accomplish. Likewise it would costs around the same to have the OEM come out and change the IP addresses. I am not sure what you mean by creating a VLAN on each machine. Currently the NAT device I found is around 260 dollars. If I could do it cheaper that would be even better. Also I do not have the hassles of dealing with any corporate or local IT department. They do not want anything to do with the PLC network and all communications are done through a single machine with 2 network cards. Currently I am the only one making any changes to the PLC network. And I keep a record of all of the devices and IP and MAC addresses. I also label them locally at the device.


  6. Unfortunately the switch I have does not have this feature. I just checked the product ID. I will check tomorrow first thing with out local AB rep to see if this is indeed an add on functionality that I can purchase. But I am still thinking I could probably do what you suggested and find a router that supports 1:1 NAT. I am learning a lot through this conversation and I greatly appreciate your help. Each machine does have it's own LAN. We have all of the ports on the stratix switch setup as one big VLAN. Basically just using it as an unmanaged switch. But it looks like I may not be able to utilize that switch. Unless there is some way to use port forwarding. But I would probably still have issues with the machines trying to communicate to one another since they all have that exact same VLAN setup. If you have any suggestions on particular NAT 1:1 small router let me know. If I can configure 5 cheap ones real quick then I wont even fool with the Stratix switch. 


  7. Unfortunately the switch I have does not have this feature. I just checked the product ID. I will check tomorrow first thing with out local AB rep to see if this is indeed an add on functionality that I can purchase. But I am still thinking I could probably do what you suggested and find a router that supports 1:1 NAT. I am learning a lot through this conversation and I greatly appreciate your help. Each machine does have it's own LAN. We have all of the ports on the stratix switch setup as one big VLAN. Basically just using it as an unmanaged switch. But it looks like I may not be able to utilize that switch. Unless there is some way to use port forwarding. But I would probably still have issues with the machines trying to communicate to one another since they all have that exact same VLAN setup.


  8. The drawing is exactly what I am trying to do. I'm not sure what a NAT device is, I will have to research that.And I am trying to pole them to read the tags that are in them. They are in a temperature controlled area that rarely goes above or below 70 degrees Fahrenheit so the residential equipment will be probably be fine. I do have a managed switch they all connect too. So just to make sure I understand what your saying. I need to get a NAT device. Which I will figure out what device that does. It sounds really straightforward the way you explained it. Basically this device will take the IP of the PLC and forward it to a different IP that I can use on the PLC network to communicate and pole its tags? Networking is somewhat new to me. Other than putting everything on the same network I haven't done much with port forwarding or any type of complex communication paths. Thank you so much for your response.


  9. Ok guys, this is more a networking question involving a Stratix 5700 managed switch and 5 machines. The five machines all have set IP addresses from the OEM that cannot be changed. The manufacturer has them set in the program to maintain that IP ,so if it sees the IP change it will change it back. With that being said all Five machines have the exact same IP configuration and I cannot change it without contacting the manufacturer and getting them to change it or sell me the program so i can change it. both options will costs entirely too much in my opinion. With that being said my only goal is to read tags from the PLC on each machine. Is there anyway to set each port on that Stratix switch where i can communicate with each  machine individually without causing them to have IP address conflicts with the other machines that have the same IP address. I hope I explained my question well enough. Thank you in advance for any help on this issue.


  10. I apologize for posting twice about the same thing. I thought I had done the first one wrong. I have never used a public forum before. I did find the solution. When I had move studio 5000/rslogix to the new computer the default tag scope was set to just that program instead of the entire controller. That's why the new tags wouldn' show up. I just created new tags with the scope of the controller.


  11. This is my first time to the forum and I am still very new to plc programming. I just had to move all of our software over to a new computer ( kind of new) it's running windows 7 pro. The same is as the computer before. Same computer name, same I'm, same file directory. However when I add tags in studio 5000 and reference them in the HMI, it says it is unresolved in route to the processor. It only does this for the new tags. I used the same shortcut and everything so I am at a complete loss here. What do I do.