1. m256
  2. PLCnext Technology & PLCnext Controls
  3. Monday, 07 December 2020

Hello,

I have a project in which I can choose the file config.txt to place in /opt/plcnext/projects/BusConductor.

The selection is made in eHMI, so the user can select the local configuration during the startup of the plant.

I have 20 different configurations and everything works perfectly.

Now I have to define a configuration with no module, so I made a config.txt with just a "0" inside.

But the configuration doesn't seem to work. This is what I get in the Output.log:

27.04.20 06:51:01.245 BusConductor.BcComponent INFO - Resetting local I/O driver...
27.04.20 06:51:01.274 BusConductor.BcComponent INFO - Done resetting driver.
27.04.20 06:51:01.274 BusConductor.BcComponent INFO - Creating local I/O configuration...
27.04.20 06:51:01.315 BusConductor.BcComponent INFO - Done creating configuration.
27.04.20 06:51:01.316 BusConductor.BcComponent INFO - Reading local I/O configuration...
27.04.20 06:51:01.322 BusConductor.BcComponent INFO - Done reading local I/O configuration.
27.04.20 06:51:01.322 BusConductor.BcComponent ERROR - Read local I/O configuration failed. Response message too short.

Looking at the code I see the cause of exclusion (that comes before the file reading):

// Get the number of I/O modules detected
// TODO: Check the "More Follows" word (receiveData[3]), and handle the situation where
// there are more I/O modules than can fit in one message.
if (receiveData.size() < 8)
{
this->log.Error("Read local I/O configuration failed. Response message too short.");
return false;
}

num_modules = receiveData[7];

 

I tried commenting out just the "return false;" and leaving there the error message, and it worked, even if the LED D is flashing:

27.04.20 08:09:07.732 BusConductor.BcComponent INFO - Resetting local I/O driver...
27.04.20 08:09:07.784 BusConductor.BcComponent INFO - Done resetting driver.
27.04.20 08:09:07.784 BusConductor.BcComponent INFO - Creating local I/O configuration...
27.04.20 08:09:07.826 BusConductor.BcComponent INFO - Done creating configuration.
27.04.20 08:09:07.826 BusConductor.BcComponent INFO - Reading local I/O configuration...
27.04.20 08:09:07.829 BusConductor.BcComponent INFO - Done reading local I/O configuration.
27.04.20 08:09:07.830 BusConductor.BcComponent ERROR - Read local I/O configuration failed. Response message too short.
27.04.20 08:09:08.831 BusConductor.BcComponent INFO - Loading local I/O process data mapping...
27.04.20 08:09:08.835 BusConductor.BcComponent INFO - Done loading process data mapping.
27.04.20 08:09:08.835 BusConductor.BcComponent INFO - Enabling I/O data output...
27.04.20 08:09:08.839 BusConductor.BcComponent INFO - Done enabling data output.

 

What kind of errors could I face commenting out this check?

Or any other solution? Maybe this check could be placed after the file reading?

 

Thanks a lot!

 

Accepted Answer
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi,

That would be a great question for an "Issue" on the Busconductor Github page.  ;-)

However that is an interesting question. If there are no I/O modules attached then there is actually no need to start the Axioline bus at all. The code was written with the assumption that there is at least one Axioline module attached to the PLC.

Some solutions that I can think of:

  • Include a configuration switch in the PLCnext Engineer project, that indicates whether there is any I/O attached. In cases where there is no I/O attached, the BusConductor functions should simply not be called from the PLCnext Engineer project. This "switch" could be manual, but it could be automated by checking the length of the BusConductor configuration file. If that file is empty, then the BusConductor functions are not needed.
  • Change the BusConductor code to check for the situation when there are no modules attached. In that case, receiveData[1] should contain 0x002, and receiveData[2] and receiveData[3] should contain error codes indicating that no modules could be found. In that situation, the configuration file should then be checked to make sure it is empty - i.e. that the user actually intends for there to be no I/O modules connected to the PLC.

The first solution would be the simplest, but I hope that one of these solutions is suitable.

I think that your suggestion will work - but only if you set num_modules = 0, instead of receiveData[7]. But this may then miss some situations where there is a genuine difference between the actual modules connected to the PLC, and the user configuration.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support
m256 Accepted Answer Pending Moderation
0
Votes
Undo

Thanks Martin for your answer.

I'll start using the first method. It works but generates a red flashing LED D.

Any way to avoid this?

 

Thanks!

 

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hmm, yes, I didn't think of that. That's because the PLCnext Engineer project has at least one I/O module configured (the "AXC F physical" module), but the Axioline bus is not running.

I'm not sure if there is any way around that. I don't think it is possible to start the Axioline master when there are no physical I/O modules present. We might be able to do something with the TIC files on the PLC for this special case, but then any I/O Ports from the "AXC F physical" module that you've mapped in PLCnext Engineer will disappear, which will cause its own problems.

This will take some time to investigate, so please open an issue in the Github project describing the scenario you need to handle. Then, we won't lose track of this requirement.

Thanks.
Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support
m256 Accepted Answer Pending Moderation
0
Votes
Undo

Hello Martin,

as you suggested I opened an Issue in the BusConductor GitHub project.

 

Thanks!

 

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo
This issue has now been resolved in Github:
https://github.com/PLCnext/BusConductor/issues/2
Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.