aleksander

NJ301-1100 primary task timeouts after add EDS of Cognex scaner

17 posts in this topic

Hi

I am new in Omron, most of time I spend with Siemens products so that's why I shyly want to ask about communication over EthernetIP in the case of PLC Omron.

I am working with not my machine with PLC NJ301-1100 where are 3 axes on EtherCat, no nodes on Ethernet/IP, only HMI NA5. Primary task with cycle 500us (and additional periodic task 10ms but it is not important).

I want to add Cognex scaner on EthernetIP. I use SysmacStudio.

In first step I add EDS file and two structures IN (80bytes)/OUT(80bytes) to PLC, no algorythms. After downloading changes to machine in a while it stops with PRIMARY TASK TIMEOUT.

With original program the task execution is ave 394us, max 467us. For NJ301 adding 160bytes is additional around 100us to communication cycle. Is that cycle part of each task (primary and others) or it is parallel proces? I am little confused.

calc.png.986a5e14c63248e8d51b7120c90cc0a

Additional communication time is 160*0,0015 + 160*0,56 + 2,15 + 7,5 = 99,49us. Am I correct? And this is the problem, I am out of the range of WatchDog?

For now I didnt add any algorythms. In the future I will add new periodic task to PLC and this new InOuts will not be used in primary task.

Thank You for any advice.

ps I have found option for my inputs/outputs REGISTER TO SETTINGS FOR EXCLUSIVE CONTROL OF VARIABLES IN TASK. I created and chose new periodic task for them. Will it helps? I won't be able to check it until Monday so if You have any advices I will be gratefull ;)

Best regars!

 

Edited by aleksander

Share this post


Link to post
Share on other sites

I just experienced the REGISTER TO SETTINGS FOR EXCLUSIVE CONTROL OF VARIABLES IN TASK a couple of days ago myself. I should know the answer to the task execution and the order but I don't. I'm hoping we can get one of the Omron guys to explain this.

You can however, adjust the TIMEOUT to eliminate the error. In the Task Settings you can extend the time. If scan time is really not important to you then you can disable it by setting to Do Not Detect. I wouldn't recommend this if this is a quality inspection. I would also write the ladder program in a manner as to not miss any Pass/Fail signals.

Share this post


Link to post
Share on other sites

In the NJ PLCs the system task doesn't run in parallel. It will execute in the space between tasks and interrupt a priority 17 or higher task if needed. You do have some control over it (Operation Settings -> Basic Settings -> System Service Monitoring Settings). A good rule of thumb is to stay under 80% usage of your primary periodic task window. In your situation I would try to offload some code from the Primary if possible or increase the Primary task to 1ms (best solution IMO).

Adding the new EIP connection will increase the service task time required which can cause a timeout error if it can't accommodate it.

I don't recommend increasing the timeout detection or disabling it all together - this is the equivalent of turning up your car radio to drown out a squeaky belt. All of your tasks should have enough time to run in their entirety. 

 

Share this post


Link to post
Share on other sites

Hi

   @io_rack, @photovoltaic - thanks for answear

    I dont want to change anything in primary task (code and timings) because of possible future problems with production. All I want/must to do is add EAN scaner and check codes (one per 2sec, but in the appropriate CAM). I will add new task (with period 5-10ms, must recount CAMs speed) but first I must make the new inputs independent of the primary task. New task will only cause synchronical stop to the machine, not more.

   I have build similar, little faster machines on Siemens PLC where is about 5ms main cycle (also with 3-4 axes) and everything works fine. Adding new nodes on ethernet/profinet is no problem. In that machine manufacturer made 500us main cycle and adding new node to connection is problem. No one wants to take responsibility for problems after the change in primary task. As always it is case of time and m...y ;)

   I also think that primary task performed in 1ms (even longer) whould works fine but have no permission.

   So, after my changes (new task, new inputs assigned to new task in REGISTER TO SETTINGS FOR EXCLUSIVE CONTROL OF VARIABLES IN TASK ) timings should look like this:

1. primary task 500us then

2. read my new inputs (with period 5ms, long 160us) then

3. perform my new task (with period 5ms, long ~100u-200us) then

4. free time 

back to 1.

Possible to work? :)

Best regards!

 

Share this post


Link to post
Share on other sites

Hi

   Yesterday I did changes on machine. I created new task (10ms) and assigned to it new ethernet INOUTs.

   Timeout happened (and critical stop of machine) but due to new task so now I am one step further, something is wrong with declaration of INOUTs.

   Communication with EIP was so long that it did "insufficient system service time error".

   I must find out where is problem with INOUTs declaration and it should work.

   Best regards!

Share this post


Link to post
Share on other sites

Can you share the EDS file of the Cognex scanner?  Is the RPI you've configured within the supported range declared in the EDS file?  (Note, EDS files use micro-seconds, not milli-seconds.)

Share this post


Link to post
Share on other sites
7 hours ago, aleksander said:

Hi

   Yesterday I did changes on machine. I created new task (10ms) and assigned to it new ethernet INOUTs.

   Timeout happened (and critical stop of machine) but due to new task so now I am one step further, something is wrong with declaration of INOUTs.

   Communication with EIP was so long that it did "insufficient system service time error".

   I must find out where is problem with INOUTs declaration and it should work.

   Best regards!

The writing is on the wall here I think - your primary task was nearing the limit before you added the additional code and connection. You need to offload your primary task or increase the period.

What problem are you having with an In/Out declaration ?

Share this post


Link to post
Share on other sites

If it's working fine on a Siemens at 5ms main cycle, why would you want to run at 0.5ms main cycle time on the Omron?

On 09/09/2023 at 6:20 PM, aleksander said:

   I have build similar, little faster machines on Siemens PLC where is about 5ms main cycle (also with 3-4 axes) and everything works fine. 

 

Share this post


Link to post
Share on other sites

@pturmel - I attached file, I left RPI [ms] = 10 and then PPS was set automatically on 200. I have EZ-EDS app, where I can find declaration of supported range of RPI? In Siemens (Profinet) there was no need to setup this attributes.

@photovoltaic - primary task is average 390us (before my interference). I cant touch that task, it is not my machine - I have no permission. Tomorrow I will try to find out what is the problem with my INOUTs, if Production Team will let me ;) In GlobalVariables I have declaration of INPUTS and OUTPUTS as structures, offsets tryed as CJ, user - always timeouts. Tomorrow will check NJ but in that case sum of bytes changes and I am sure there will be mismatch (maybe I find out something;).

@chelton - Siemens machines are "my machines" and can do everything what I want with them. Omron machine is not my and I cant touch primary task (original code and period time must be not changed). I now it will work with greater time but cant do this. Manufacturer forbids - let's not get into this.

02A60305052E0100.eds

Share this post


Link to post
Share on other sites

Good luck with your testing. But with only 110uS system overhead to play with I don't like your chances. Adding ethernet/ip comms, and a 10ms periodic task. I hope you don't have to much code to put in the task.

Share this post


Link to post
Share on other sites
1 hour ago, aleksander said:

@pturmel - I attached file, I left RPI [ms] = 10 and then PPS was set automatically on 200. I have EZ-EDS app, where I can find declaration of supported range of RPI? In Siemens (Profinet) there was no need to setup this attributes.

@photovoltaic - primary task is average 390us (before my interference). I cant touch that task, it is not my machine - I have no permission. Tomorrow I will try to find out what is the problem with my INOUTs, if Production Team will let me ;) In GlobalVariables I have declaration of INPUTS and OUTPUTS as structures, offsets tryed as CJ, user - always timeouts. Tomorrow will check NJ but in that case sum of bytes changes and I am sure there will be mismatch (maybe I find out something;).

@chelton - Siemens machines are "my machines" and can do everything what I want with them. Omron machine is not my and I cant touch primary task (original code and period time must be not changed). I now it will work with greater time but cant do this. Manufacturer forbids - let's not get into this.

02A60305052E0100.eds

1 hour ago, aleksander said:

 

@photovoltaic - primary task is average 390us (before my interference). I cant touch that task, it is not my machine - I have no permission. Tomorrow I will try to find out what is the problem with my INOUTs, if Production Team will let me ;) In GlobalVariables I have declaration of INPUTS and OUTPUTS as structures, offsets tryed as CJ, user - always timeouts. Tomorrow will check NJ but in that case sum of bytes changes and I am sure there will be mismatch (maybe I find out something;).

 

This means you have 100us to spare every Primary period. Your system task runs every 10ms along with 2 other tasks. You have 100us * 20 = 2ms to spare for 2 tasks and a system task which handles your NA comms, EtherCAT comms, and Ethernet/IP comms - that's pretty tight. I'm surprised your HMI doesn't lag already.

As far as offset type goes NJ is optimized for your architecture but it will most definitely cause a size mismatch and cause everything to fall out of alignment as well. You could try using a byte array and then the instruction aryByteTo to map it to your structure.

You're trying to apply a bunch of bandaids instead of addressing the root cause in my opinion. I understand it's not your machine but the scan time seems to have been overlooked from the OEM.

Share this post


Link to post
Share on other sites
4 hours ago, aleksander said:

where I can find declaration of supported range of RPI?

In the [Connection Manager] section in the ConnectionN = ....  where the comments show O=>T RPI and T=>O RPI.  Unfortunately, those fields are blank in the linked EDS, so you'd have to find the acceptable range elsewhere in Cognex's documentation.  Normally you'd find a "ParamN" shown there, and you'd look that up in the parameters section to find the min and max allowed (and preferred default, usually).

Share this post


Link to post
Share on other sites

Hi

   Thank You All.

   With each of your new entries, the strength of my arguments in the conversation with the Client increases.

   I will do some tests and will talk with Client. Finally I will write how the case ended.

@pturmel I found in Cognex docs:

Requested Packet Intervals (RPI)
The Requested Packet Interval (RPI) determines how fast the cyclic data packets are exchanged between controller and I/O module, and are typically entered in milliseconds (ms). Sensors accept RPI values in 1 to 15 ms intervals for the first 15ms. For RPI values greater than 15, sensors will accept values in 5 ms increments. For values between 16 and 20, data will be exchanged in 20 ms increments. For values between 21 and 25, data will be exchanged in 25 ms increments.

   So my 10ms was correct.

   Best regards!

Edited by aleksander
1 person likes this

Share this post


Link to post
Share on other sites

Dear interested in topic

   Finally, we decided (with Client) that new algorithms handling Cognex scaner will be build in PLC S7-1200 Siemens. Manufacturer didn't allow change PrimaryTasks's timings.

   S7-1200 will do the job and with I/O I will send to Omron PLC fault signals. In Omron PLC I will add only faults handling.

   My only one problem is to show some values from S7-1200 on HMI NA5 Omron. I added new external device to the project but there is only Omron manufacturer ;/

   From where I can get Siemens PLC libraries and how add them in SysmacStudio? Unfortunately, I did not find this information on the Internet.

   In SysmacStudio I am there:

SysmacStudioExDevice.thumb.png.14a071cff

 

As always, I am grateful for your help

Best regards!

Share this post


Link to post
Share on other sites
25 minutes ago, aleksander said:

Dear interested in topic

   Finally, we decided (with Client) that new algorithms handling Cognex scaner will be build in PLC S7-1200 Siemens. Manufacturer didn't allow change PrimaryTasks's timings.

   S7-1200 will do the job and with I/O I will send to Omron PLC fault signals. In Omron PLC I will add only faults handling.

   My only one problem is to show some values from S7-1200 on HMI NA5 Omron. I added new external device to the project but there is only Omron manufacturer ;/

   From where I can get Siemens PLC libraries and how add them in SysmacStudio? Unfortunately, I did not find this information on the Internet.

   In SysmacStudio I am there:

SysmacStudioExDevice.thumb.png.14a071cff

 

As always, I am grateful for your help

Best regards!

The NA HMI will not communicate with a Siemens PLC. You will need to do PLC-to-PLC comms and then read the tags from the NJ.

Share this post


Link to post
Share on other sites

Hi All

   After consulting with the Client, I calculated all the cams and other key parameters versus the speed of the machine. I set the main task to 2ms and everything has been working fine for two days. Now it's time for my modernization...

Thank you for the discussion.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now