Qasem

Failed to write out of range value

7 posts in this topic

Hi,

I have an HMI program which write a value to the PLC to decide the mode of pump control there are 3 options : OFF / MANUAL / AUTO However the program returns a failure massage as seen in the attached photo

What should we do?

 

Failure.jpg

Share this post


Link to post
Share on other sites

It looks like you are trying to write 2 to a digital (bool) tag, which you can only write a 0 or a 1 to.

The tag that you are writing to needs to be an INT or a DINT, not a BOOL.

1 person likes this

Share this post


Link to post
Share on other sites
2 hours ago, alan_505 said:

It looks like you are trying to write 2 to a digital (bool) tag, which you can only write a 0 or a 1 to.

The tag that you are writing to needs to be an INT or a DINT, not a BOOL.

Yes you are saying right but this program and code was written by someone else and it happened that the PLC accept this and the pump can be either OFF/MNUAL/AUTO 

I know it may sound odd but this is it

 

 

 

Share this post


Link to post
Share on other sites

if tag is to have multiple states (not just TRUE/FALSE or 0/1) then it cannot be of BOOLEAN type. it could be an INT for example.

1 person likes this

Share this post


Link to post
Share on other sites
40 minutes ago, Qasem said:

I know it may sound odd but this is it

No, it isn't.  Something is missing.  A boolean tag can only be true or false.  There's no other value possible.

To get three choices, you need an integer data type, or you need more than one boolean.  Take a closer look at the code.

Share this post


Link to post
Share on other sites

To the OP - It's not unusual to use 0,1, or 2 (or higher) with a compare to make things happen in an HMI or program. As everyone else has said- you can't use a BOOL tag for an integer function.

Share this post


Link to post
Share on other sites

The program was originally installed on a panelview 1000 . Now all work is converted to *.med to work on. PC.

What is interesting here is that the some tags are missing and  some other tags are not supported. 

Could this be the problem!

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