Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO programmatically use a certain scan engine and etherCAT configuration

Solved!
Go to solution

Hi Everyone. I'm sure most of us here are pretty familiar with deploying scan engine configurations from a project to a cRIO. That's all well and good, but is there a way to have the cRIO select it's own scan engine config based on a setting in an ini file or something like that?

 

The thing is I have a system where I want to be able to work in the field with two different configurations. Each configuration has a different number of beckhoff ethercat slaves attached. If you bootup the cRIO with the wrong number and type of etherCAT slaves attached the scan engine can't switch to active mode. I just want to be to reboot he cRIO and have it either automatically or through a setting be able to load the correct scan engine configuration without needing to manually deploy via project. 

 

I've never really found information on just how the scan engine configuration data is stored on the cRIO. Ideally you would just be able to load a file and configure the scan engine with it in your RTEXE.

 

Any ideas on how to do something like this?

 

 

 

 

0 Kudos
Message 1 of 5
(178 Views)

I can say that there is something different going on when you use "refresh modules.vi" from the scan engine palette vs when you use the "New->add targets and device -> Existing target or device -> discover an existing target or device" by right clicking on the ethercat master in the project.

 

Adding an extra module to the ethercat daisy chain can be done via the project easily. Trying to use "refresh modules.vi" hangs. You can can see it hanging on the "refresh local modules" invoke node. 

 

If I can get to whatever methods the project is using I could make this work--- any idea from NI?

0 Kudos
Message 2 of 5
(150 Views)
Solution
Accepted by topic author MarkCG

Hi Everyone. I'm sure most of us here are pretty familiar with deploying scan engine configurations from a project to a cRIO. That's all well and good, but is there a way to have the cRIO select it's own scan engine config based on a setting in an ini file or something like that?

- You mean you want to apply the same RT VI to different EtherCAT hardware topology? If that's the case, you are expected to use Refresh Modules VI. Note that Refresh Modules VI discovers all EtherCAT slaves dynamically if EtherCAT master information is not deployed to the target; if there is existing deployed information on the RT, Refresh Modules VI simply reads the available deployed information lazily.

 

The thing is I have a system where I want to be able to work in the field with two different configurations. Each configuration has a different number of beckhoff ethercat slaves attached. If you bootup the cRIO with the wrong number and type of etherCAT slaves attached the scan engine can't switch to active mode. I just want to be to reboot he cRIO and have it either automatically or through a setting be able to load the correct scan engine configuration without needing to manually deploy via project. 

- Use Refresh Modules VI without any deployment operation

 

I've never really found information on just how the scan engine configuration data is stored on the cRIO. Ideally you would just be able to load a file and configure the scan engine with it in your RTEXE.

- It's not recommended to modify the configuration data. Wrongly modifying the configuration files of Scan Engine or EtherCAT on the cRIO may crash the RT OS.

 

I can say that there is something different going on when you use "refresh modules.vi" from the scan engine palette vs when you use the "New->add targets and device -> Existing target or device -> discover an existing target or device" by right clicking on the ethercat master in the project.

- What different things you care about?

 

Adding an extra module to the ethercat daisy chain can be done via the project easily. Trying to use "refresh modules.vi" hangs. You can can see it hanging on the "refresh local modules" invoke node. 

- Refresh Modules VI takes quite a long time to have everything ready for the first time: the VI loads all EtherCAT ESI files from the cRIO and parsing them to the memory, etc. But only for the first time you run the VI after your cRIO is up.

 

If I can get to whatever methods the project is using I could make this work--- any idea from NI?

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LflSAE&l=en-US

Message 3 of 5
(142 Views)

- You mean you want to apply the same RT VI to different EtherCAT hardware topology? If that's the case, you are expected to use Refresh Modules VI. Note that Refresh Modules VI discovers all EtherCAT slaves dynamically if EtherCAT master information is not deployed to the target; if there is existing deployed information on the RT, Refresh Modules VI simply reads the available deployed information lazily.

 

 I'll have to figure why refresh modules is taking so long. I put the beckhoff ESI files on the RT target using the import

 

- Use Refresh Modules VI without any deployment operation

 

yes this is a key point, thank you. I'll undeploy the EtherCAT master and see how that works

 

- It's not recommended to modify the configuration data. Wrongly modifying the configuration files of Scan Engine or EtherCAT on the cRIO may crash the RT OS.

 

fair enough. Still would be interesting to know where and how it's stored

 

- What different things you care about?

 

- Refresh Modules VI takes quite a long time to have everything ready for the first time: the VI loads all EtherCAT ESI files from the cRIO and parsing them to the memory, etc. But only for the first time you run the VI after your cRIO is up.

I imported a whole folder of them-- 90% of which I don't need. I can try to clean them up to speed up load time as well

0 Kudos
Message 4 of 5
(129 Views)
Highlighted

Thank you I did get this working after fixing some error handling in the linked article above. Removing all but the necessary etherCAT slave information files from /var/local/natinst/IndComECAT/DD/  makes refresh modules fast. Attached is the VI I made to do this

Message 5 of 5
(123 Views)