LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling EtherCAT Scan Engine on RT Target

Solved!
Go to solution

LV 2018, LVRT 2018

 

Per customer request, my app (host + RT parts) controls the EtherCAT Scan Engine on the RT side, which determines how the EtherCAT DAQ occurs.

Sometimes they want to deploy on lesser RT targets, or have huge channel counts, and so 500, 200, or 100 Hz scan engine rates work better than the 1000 Hz default.

 

I do this at CONFIG time by comparing the rate they want to the rate it's now running at, and if they're different, I switch EtherCAT into CONFIG mode (if not already there), set the new scan period, and switch back to ACTIVE mode.

 

When my program terminates normally, I switch into CONFIG mode before quitting.

 

All this works fine    EXCEPT

 

If I run the RT  part from the DevSys when the startup app is already running, then it deploys the whole thing (taking 60+ seconds) and THEN complains to me:

Deployment.PNG

 

This is before any of my code runs, I think.

In other words, the project has a default scan rate which disagrees with the last used settings on the box, so it refuses to comply. 

Rather than figure this out at the BEGINNING of deployment, it waits until the END, which is a waste of time.

 

So, I have to call up the UTILITIES-SYSTEM MANAGER and switch it to CONFIG mode, and then deploy again.

 

This doesn't happen if I orderly exit the app, because I deliberately leave the CONFIG mode set.

 

It seems obvious to me that if I ABORT the app that's running, I don't need it to be in ACTIVE mode any more.  I always seem to forget to do this extra step.

Am I missing something?   Is there a way to automatically set CONFIG mode when I ABORT the startup app?  Some other setting I'm missing?

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 7
(2,570 Views)

Hi CoastalMaineBird,

 

I would suggest that you add the Set Scan Engine Mode.vi and Refresh Module.vi in your project. By this way, you are able to set the scan engine mode automatically.

 

Thanks! 

0 Kudos
Message 2 of 7
(2,525 Views)

I would suggest that you add the Set Scan Engine Mode.vi and Refresh Module.vi in your project.

 

That doesn't change anything, and I don't see why it should.

Is the fact that they're in the project some sort of trigger to not complain?

 

I already CALL those VIs, when necessary, to change the settings. So they were implicitly in the project, but explicitly putting them in didn't change anything.

 

Again, MY code hasn't run yet when the error occurs - it's the DEPLOY operation.

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 7
(2,506 Views)

Hi CoastaMainBird,

 

If you want to change the scan rate and other configuration, I believe you should change the scan engine to configure mode. And if you used the Set Scan Engine Mode.vi and Refresh Module.vi, I think you don't need to deploy it before you run the VI.

 

Thanks

 

0 Kudos
Message 4 of 7
(2,496 Views)

My problem is NOT that I can't change the scan rate.  I can do that just fine when my program runs.  The host part has a configuration window - the user can change it and APPLY.  I switch into CONFIG mode, apply all the module changes (if any), apply the new SCAN RATE, and switch back into ACTIVE mode.

 

All that works just fine.  Any number of times.

 

If they orderly QUIT the RT program (via commands), then as I quit, I switch into CONFIG mode on the way out.

 

That's fine.

 

BUT

 

If the RT part is running as an RTEXE (with scan rate = 500, say), and then I have the LVPROJ open and try to RUN it (click the RUN arrow on the RT main VI), it will:

1... Announce that RT is already running a startup program.

2... Ask if I'm sure I want to kill it  (I say yes)

3... Deploy all the VIs from the host (~60 sec)

4... Complain about the scan mismatch, as I posted earlier.

5... Nothing I can do except use the SYSTEM MANAGER to switch into CONFIG mode.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 7
(2,482 Views)
Solution
Accepted by topic author CoastalMaineBird

OK, NOW I get it.

 

There is a CONFLICT message at the beginning of Deployment, sometimes.

1... Announce that RT is already running a startup program.

2... Ask if I'm sure I want to kill it  (I say yes)

3... Announce that there is a SCAN ENGINE mismatch.

4... I have the OPTION to DEPLOY SCAN ENGINE SETTINGS, or not.  (I didn't realize that before).

5... If I choose to DEPLOY them (the default), THEN I get the conflict.

6... If I choose to NOT DEPLOY them, then all is well.

 

So, I just didn't recognize that I had the option to avoid deploying the SCAN ENGINE settings, and that I should avoid it.

 

Part of the problem is the constant complaint about polymorphic VIs on RT - I tend to ignore that complaint because it's pointless and happens so much.

 

So, it's all good.  Thanks for engaging.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 7
(2,478 Views)

You indicate you have this figured out but just in-case it helps...

 

This KB article helped me with an issue I had with Hybrid mode.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(2,467 Views)