NORM_X function does not give correct values

Join Date
Sep 2016
Location
Amsterdam
Posts
6
Hi Guys,

I am using this function

#Normalized_Value := NORM_X(MIN := "DB_SystemSettings".Track_Percentage_Min,
MAX := "DB_SystemSettings".Track_Percentage_Max,
VALUE := "DB_Track_Control".Track_Percentage_Left
);

#Normalized_Value is a real
MIN=-100
MAX=+100
and "DB_Track_Control".Track_Percentage_Left (-100 to +100)

but I don't get any output between 0 to 1, which is supposed to be!!.

Has anybody encountered this problem? Any idea what is wrong?

my plc is S7-1200 and I am using TIA Portal V14

thank you for your support.

NORM 2.png NORM 3.png
 
Can you change the Mina and Max display format of the monitored values to decimal and see if those are the values you intended. They're out to lunch.
 
Can you change the Mina and Max display format of the monitored values to decimal and see if those are the values you intended. They're out to lunch.


Hi Kalabdel,

Thank you for your reply. Yes they are not the values I wanted. But why this is happening ?

Here is my data block. Do you see any problem there ?

Thank you in advance.

Mahdiar

datablock.png
 
You are not monitoring your data block, but DBD96 and DBD100 do not contain valid floating point numbers, hence your normx function is returning the input value.
 
The start values are as you stated but are the tags being used somewhere that the values are changed?



Hi Kalabdel


These are settings and for now they are just read for this NORM_X function. No other reference.

For now I have used

#Normalized_Value :=(100-"DB_Track_Control".Track_Percentage_Left)/200;

and it works fine. But I am still curious to see what was the problem. Since our tracks moved by accident and it was almost a close call to incident.

I have attached cross reference snapshot of the tags after I commented the NORM_X code and used constants instead. FYI.

Thank you for your support



Regards,
Mahdiar

Cross reference.png
 
Why use the Norm_X when your value is already a percentage? Why not divide by 100.0?

Have you cross referenced those limit variables?

Hi Cardosocea,

thank you for your reply.
I did and they are not used anywhere esle. It is possible and basically I did that for now to solve the issue. This is what I am using now.


// #Normalized_Value := NORM_X(MIN := "DB_SystemSettings".Track_Percentage_Min,
// MAX := "DB_SystemSettings".Track_Percentage_Max,
// VALUE := "DB_Track_Control".Track_Percentage_Left
// )


#Normalized_Value :=(100-"DB_Track_Control".Track_Percentage_Left)/200;


But I am curious to find out what the problem was. It was a close call.
I have attached the cross reference snapshot FYI after i commented NORM_X.

thank you for your help.


regards,
Mahdiar

Cross reference.png
 
The monitored snapshots in your first post, we're they taken from the live CPU or a simulation?

You said it was a close call, was the software just deployed or has it been working for a while?

Is there any other non Siemens HMI or Scada or any communication of any sort that has access to the data?

This shouldn't be so mysterious, it's very straight forward. The values you showed us should work and all you have to do is simulate it to prove it and if it does the your code is fine and then either the code on the CPU is different or has been modified or something exterior is changing those values.
 

Similar Topics

I’m trying to perfect the HMI interface for analog configuration. I’ve provided the user the same options for all analog inputs, as follows...
Replies
10
Views
1,664
I’m trying to perfect the HMI interface for alarm control. I’ve provided the user alarm options for all analog inputs, as follows. HH Boolean...
Replies
4
Views
1,468
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
111
Im trying to create a level indicator for water Tank i have used the ADD function while the pump is on and level increasing everything works...
Replies
33
Views
966
Good morning crew! Ok my logic works but I am missing something. When the start button is pushed it should like the red light for 4sec then shut...
Replies
13
Views
402
Back
Top Bottom