CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Fri Jan 24, 2020 6:22 pm

All times are UTC+01:00

Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Aug 31, 2012 10:41 pm 

Joined: Mon Nov 01, 2010 4:30 pm
Posts: 52

I have a really weird problem with a CFC program, please check attached image.

There is a MUX box which switches between two BOOLS(physical inputs), and sends the output to a BOOL input of a FB.
When online, Codesys 2.3 displays the MUX output (here sensorFWD FB input) as invalid - there is text *** INVALID 16#40 next to it, highlighted in red. Modifying MUX inputs has no effect at all.

The problem is not in the FB but in the MUX - if I attach MUX output to a locally declared BOOL, this BOOL is displayed as INVALID as well.

What is even more strange is that if I first copy one of the physical inputs (sC34M in the picture) to a local BOOL(copy_of_sC34M), and then then connect this BOOL copy to the MUX input (instead of the physical input, as displayed in the picture) - the problem disappears ??? MUX works as expected, no INVALID etc. How could that be ?

I did project check for overlapping memory areas and concurrent access - no results. As far as I can tell, the problem is not in the physical inputs either - they are read correctly, the PLC doesn't display any problem. Project has only one freewheeling task, PLC is Festo CPX-CEC-C1.

What could be the explanation for this?
I have found some sort of a workaround, but don't want to leave it like that.

Another question is, how do I detect issues like this? I found this *** INVALID 16#40 by chance, there wasn't any indication for a problem from the PLC/Codesys.


You do not have the required permissions to view the files attached to this post.

PostPosted: Mon Sep 03, 2012 9:12 am 
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 987
Is sC34M a BOOL?
is sC34F a bool?

instead of MUX use SELECT (it needs a BOOL input, this way no conversion needed)
please have yur names to the convention (x foor BOOL etc.

computer shooter
paul deelen
jacob van wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
skype shooter paul.deelen
phone +31736139136

PostPosted: Mon Sep 03, 2012 9:02 pm 

Joined: Mon Nov 01, 2010 4:30 pm
Posts: 52
yes, sC34M and sC34F are BOOL's, these are the names of two physical inputs - declared directly in the PLC configuration.

Thanks for reminding me about SEL, just forgot about it. It's indeed the better choice in this case and I'll use it.
But still the question remains why this INVALID 16#40 appears, as the use of MUX is technically valid. And especially why it disappears if I use a copy of a variable instead of the variable itself.
BTW the problem is not in the conversion - I tested to attach a BYTE variable (not obtained via conversion) to the first MUX input, and the output was still invalid.

PostPosted: Mon Sep 25, 2017 9:38 am 

Joined: Wed Sep 20, 2017 8:51 am
Posts: 2
Hi, @pnn .
201709251730 UTC+8
I change the CoDeSys v2.3--Project--Options--Build--Number of data segments to default value, and the problem is gone.

210709251400 UTC+8
I encountered a similar problem, indicating '*** INVALID: 16#08 ***'. Have you solved your problem, and what is your solution?

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited