Question about Simatic Step7v5.4???

robertcer

Member
Join Date
Jun 2007
Location
Novi Sad
Posts
16
Hi to everyone!

I have a problem about scaling an analog value in simatic step7v5.4 software packet... I used a predefined function FC 107 --> Read In an Analog Value , but I have a problem.. :( As an input parametar BG(Module address) for FC105, I don't know what to enter, because I have 2 racks and the analog modules is in the second rack. The CPU unit is installed in the first rack. The two racks are connected with interface module IM365 for connecting an expansion rack. In hardware configuration my analog module is on the 4th place, but on the 2nd rack. I tried to enter number 4 to BG parameter, but it isn't work... Can anybody help me? Who works with simatic... I will be pleased if somebody sends me an example... Thanks very much!
PS: Sorry for my English!

My email is: [email protected]
 
are you sure you are using the right FC105. There are a few of them available in the instruction folders. In the TI-S7 folder there is one called "Scale" that has an IN instead of the BG. The IN is just the PIW address of the analog input.
 
The FC107 you are referring to uses the BG parameter to perform the following type of access for a Step 5 type of analgue input card.

L PIW[AR1,P#0.0]

BG is referring to the base PIW address of the module.

Edit: Added the following from the Siemens F1 Help for FC107.

Description of instruction:
The function AE_466_2 (Read In an Analog Value) reads in an analog value from an analog input module 6ES5 466-3LAxx and makes it available for further processing at the parameter XA as a standard value (linear calculation between the limits OGR and UGR) in floating point format. During standardization, the function considers the various rated areas and number notations by means of the parameter KD (channel representation). Depending on the module setting, the number notation and rated area of the read analog value are different. To enable the function to standardize correctly within the limits OGR and UGR, the parameter KD must be set in accordance with the following list:
KD=22 Fixed point format bipolar with rated area -2048 to +2047
KD=23 Value representation bipolar with rated area -2048 to +2047
KD=24 Fixed point format unipolar with rated area 0 to +4095
KD=25 Fixed point format unipolar with rated area +512 to 2559
If processing is done correctly, the RLO is set to "0" when the function is closed and accumulator 1 contains the value read by the module. The standardized value is available at output XA. The parameters _FB and BU show signal state ”0”.
Troubleshooting:
If a value which does not lie within the defined values range is entered at a parameter, the function records this parameter assignment error with RLO "1" and an error number in accumulator 1. The output XA is then assigned a zero. The parameters _FB and BU show signal state ”0”. If a non-existent module or non-existent channel is selected, timeout (QVZ) results. If the error bit _FB is set, the value zero is issued at output XA. The RLO is set to signal state "1"; accumulator 1 contains the value read by the module. If the overflow bit BU is set, the rated area limit is issued at output XA. The RLO is set to signal state "1"; accumulator 1 contains the value read by the module.
Differences between S5 and S7:
· The BG parameter
S7 does not differentiate between I/O areas. There is only the P area.
Error number 6, "Wrong I/O area", no longer exists.
· A check is made to ensure the result of adding the BG value and 2 x KN is less than 1022.
Valid I/O area: 0 to 1023. If this area is exceeded, error number 3 is displayed.
· A process image of the S5 I/O areas P/Q/IM3/IM4 is made in the S7 I/O area. You must assign the I/O area in the configuration table. You must also match the address in the BG parameter (byte 2).
· In S7, the I/O area is assigned values as follows:

S5 S7
P area 0 to 255Q area 0 to 255IM3 area 0 to 255IM4 area 0 to 255 P area 0 to 255P area 256 to 511P area 512 to 767P area 768 to 1023
Note:
This function is only used to convert the FB33 of an existing S5 program of an S5 CPU 928B, 945 or 948 to a function of an S7 program for the S7-400 programmable controller.
 
Last edited:
I just realized that analog module which I have can't be used for scaling with any of FC-s (predefined functions), but that isn't a problem. I made my own FC which I am using for scaling... But, I have another problem (bigger problem). I have connected sensor to my analog input channel, which is set up as a 2-wire current input and it is ok! In hardware configuration I also setup input for analog module (2 wire, current input - 4..20mA) and setup up an input address. The problem is when I put an address into an OB1, for example I called the instruction "MOVE" to move PIW20 to MW0, and then on the CPU unit the SF led turn on, and the execution of program goes to stop. The conlusion is that I can't read from the analog input...
I have read something about Process Image Tables but I don't know how to configure it... Do you know something about that? Can you help me?
I am looking forward to hearing from you the solution...
Thank you!

Robert
 
Hello,

the Process Image Tables can only be modified on bigger CPU´s.
By this I mean the newer versions of 317 and higher this Image table can be modified. And on all 400 CPU´s you can modify this Process Image Table.

Smaller CPU´s carry a fixed set Process Image Table, for example a 315-2DP has fixed Process Image Table of 128 Byte / 128 Byte (Inputs / Outputs)

But I think this is not your major problem.

I would try to move IW20 into MW0

IW20 is the value which is stored before entering OB1 in the process image table and this value wont change during the OB1 cycle.

PIW can change during the CPU cycles thru OB1, which can sometimes make a problem.

I would do it like this
in STL

L PIW20
T MW0

If you use the CPU Diagnose, what will it tell you about the SF Fault?
 
Last edited:
It sounds to me like the address PIW20 is incorrect. Check the addresing in the hardware config for the analogue input card.

L PIW20
T MW20

The above code should work OK if something is addressed as PIW20.

Bear in mind that the value for 100% will be 27648

If you look in the Module Information (Ctrl + D) you should get some information about the cause of your problem.

Nick
 
that analog module which I have can't be used for scaling with any of FC-s (predefined functions)
Why not? Using FC105 would solve addressing problems etc...

Regards

Ken
 
Robert, post the hardware config for the rack concerned then we can see what addresses have been allocated. Use Export in the h/w config editor (select the readable form). Open the exported file using Notepad and then copy/paste the text into your post. Here's an example with the analogues starting at PIW256:

Code:
RACK 0, SLOT 4, "6ES7 331-7KB00-0AB0", "AI2x12Bit"
BEGIN 
  CPU_NO "1"
  ALARM_OB_NO "40"
  OBJECT_REMOVEABLE "1"
  POS_X "0"
  POS_Y "0"
  REDUNDANCY
  BEGIN
  END
  SIZE_X "0"
  MODULE_ADD_FLAGS "0"
  SIZE_Y "0"
  CAX_APP_ID ""
  OBJECT_COPYABLE "1"
  CREATOR ""
  COMMENT ""
LOCAL_IN_ADDRESSES 
  ADDRESS  256, 0, 4, 0, 1, 0
END
 
Hi! With this it isn't work... L PIW20
T MW20
I don't know what the problem is??!!!

Here is my hardware configuration:

FILEVERSION "3.2"
#STEP7_VERSION V5.4
#CREATED "20. septembar 2007 8:23:56"

STATION S7300 , "SIMATIC 300(1)"
BEGIN
REPORT_SYSTEM_ERRORS "0"
_ATTR2_111755 "1"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
SIZE_X "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
END

SUBNET MPI , "MPI(1)"
BEGIN
MPI_HSA "31"
MPI_BAUDRATE "187.5_KBPS"
MPI_GAP "5"
MPI_READY "20"
MPI_RETRIES "2"
MPI_IDLE1 "60"
MPI_IDLE2 "400"
MPI_TQUI "0"
MPI_TSL "415"
MPI_TTR "9984"
CREATOR ""
COMMENT ""
NET_ID_2 "00 1B 00 00 00 06"
NET_ID "001B00000006"
END

RACK 0, "6ES7 390-1???0-0AA0", "UR"
BEGIN
OBJECT_REMOVEABLE "1"
POS_X "236"
POS_Y "17"
SIZE_X "603"
SIZE_Y "344"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
END

RACK 0, SLOT 1, "6ES7 307-1EA00-0AA0", "PS 307 5A"
BEGIN
CPU_NO "1"
ALARM_OB_NO "40"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
END

RACK 0, SLOT 2, "6ES7 315-2AG10-0AB0" "V2.0", "CPU 315-2 DP"
BEGIN
ALARM_OB_NO "40"
CBA_USAGE "0"
OBJECT_REMOVEABLE "1"
CAPABLE_FAILSAFE "0"
POS_X "0"
POS_Y "0"
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
MPI_ADDRESS "2"
COMMENT ""
LINKED_SUBNETNAME "MPI(1)"
END

RACK 0, SLOT 2, SUBSLOT 1, "_S7H_SUBMODULE_315_2AG10_DP_CT", "DP"
AUTOCREATED
BEGIN
PROFIBUSADDRESS "3"
ALARM_OB_NO "40"
DP_CLOCK_MODE "0"
SLAVE_ACTIVE_PASSIVE "0"
DP_CLOCK_INT "0"
_ATTR2_111748 "0"
DP_MASTER_MODE "DP_MASTER"
OBJECT_REMOVEABLE "0"
POS_X "0"
POS_Y "0"
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
DP_VERSION "7"
CAX_APP_ID ""
L2_ADDR_EQUI_MASTER "255"
OBJECT_COPYABLE "0"
CREATOR ""
COMMENT ""
LOCAL_IN_ADDRESSES
ADDRESS 2047, 0, 0, 0, 7, 0
END

RACK 0, SLOT 4, "6ES7 321-1BL00-0AA0", "DI32xDC24V"
BEGIN
CPU_NO "1"
ALARM_OB_NO "40"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
REDUNDANCY
BEGIN
END
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
LOCAL_IN_ADDRESSES
ADDRESS 0, 0, 4, 0, 1, 0
SYMBOL I , 0, "P22-D", "Pumpa rekuperatora HZP - P22 (daljinski rad)"
SYMBOL I , 1, "P22-B1", "Pumpa rekuperatora HZP - P22 (u radu)"
SYMBOL I , 2, "P22-B3", "Pumpa rekuperatora HZP - P22 (prorada zastite)"
SYMBOL I , 3, "P13-D", "Pumpa grejaca - P13 (daljinski rad)"
SYMBOL I , 4, "P13-B1", "Pumpa grejaca - P13 (u radu)"
SYMBOL I , 5, "P13-B3", "Pumpa grejaca - P13 (prorada zastite)"
SYMBOL I , 6, "KH-PV-D", "Usisni ventilator HZP (daljnski rad)"
SYMBOL I , 7, "KH-PV-B1", "Usisni ventilator HZP (u radu)"
SYMBOL I , 8, "KH-PV-B3", "Usisni ventilator HZP (prorada zastite)"
SYMBOL I , 9, "KH-OV-D", "Otsisni ventilator HZP (daljinski rad)"
SYMBOL I , 10, "KH-OV-B1", "Otsisni ventilator HZP (u radu)"
SYMBOL I , 11, "KH-OV-B3", "Otsisni ventilator HZP (prorada zastite)"
SYMBOL I , 12, "P16-D", "Pumpa P16 (u lokalu)"
SYMBOL I , 13, "P16-B1", "Pumpa P16 (u radu)"
SYMBOL I , 14, "P16-B3", "Pumpa P16 (prorada zastite)"
SYMBOL I , 15, "P19-D", "Pumpa P19 (u lokalu)"
SYMBOL I , 16, "P19-B1", "Pumpa P19 (daljinski rad)"
SYMBOL I , 17, "P19-B3", "Pumpa P19 (u radu)"
SYMBOL I , 18, "KH-ZU-B1", "Reg. zaluzina na usisu HZP (otvorena)"
SYMBOL I , 19, "KH-ZU-B2", "Reg. zaluzina na usisu HZP (zatvorena)"
SYMBOL I , 20, "KH-ZO-B1", "Reg. zaluzina na otsisu HZP (otvorena)"
SYMBOL I , 21, "KH-ZO-B2", "Reg. zaluzina na otsisu HZP (zatvorena)"
SYMBOL I , 22, "KH-MR", "HZP (mraz termostat)"
SYMBOL I , 23, "KH-PU", "HZP (presostat ventilatora na usisu)"
SYMBOL I , 24, "KH-PO", "HZP (presostat ventilatora na otsisu)"
SYMBOL I , 25, "KH-PF1", "HZP (dif. presostat ventilatora na usisu)"
SYMBOL I , 26, "KH-PF2", "HZP (dif. presostat ventilatora na otsisu)"
SYMBOL I , 27, "KH-PPK1-B1", "Protivpozarna klapna KH-PPK1 (otvorena)"
SYMBOL I , 28, "KH-PPK1-B2", "Protivpozarna klapna KH-PPK1 (zatvorena)"
SYMBOL I , 29, "KH-PPK2-B1", "Protivpozarna klapna KH-PPK2 (otvorena)"
SYMBOL I , 30, "KH-PPK2-B2", "Protivpozarna klapna KH-PPK2 (zatvorena)"
END

RACK 0, SLOT 5, "6ES7 331-7KF02-0AB0", "AI8x12Bit"
BEGIN
CPU_NO "1"
ALARM_OB_NO "40"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
REDUNDANCY
BEGIN
END
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
LOCAL_IN_ADDRESSES
ADDRESS 20, 0, 16, 0, 1, 0
PARAMETER
GROUP_DIAGNOSIS, AI , 0, "1"
GROUP_DIAGNOSIS, AI , 1, "1"
GROUP_DIAGNOSIS, AI , 2, "1"
GROUP_DIAGNOSIS, AI , 3, "1"
WIRE_BREAK, AI , 0, "0"
WIRE_BREAK, AI , 1, "0"
WIRE_BREAK, AI , 2, "0"
WIRE_BREAK, AI , 3, "0"
LIMIT_VIOLATION, "0"
DIAGNOSTICS, "0"
INTEGRATION_TIME, AI , 0, "20_MS"
INTEGRATION_TIME, AI , 1, "20_MS"
INTEGRATION_TIME, AI , 2, "20_MS"
INTEGRATION_TIME, AI , 3, "20_MS"
AI_TYPE, AI , 0, "CURRENT_(2-WIRE_TRANSDUCER)"
AI_TYPE, AI , 1, "CURRENT_(2-WIRE_TRANSDUCER)"
AI_TYPE, AI , 2, "CURRENT_(2-WIRE_TRANSDUCER)"
AI_TYPE, AI , 3, "CURRENT_(2-WIRE_TRANSDUCER)"
AI_RANGE, AI , 0, "4_TO_20_MA"
AI_RANGE, AI , 1, "4_TO_20_MA"
AI_RANGE, AI , 2, "4_TO_20_MA"
AI_RANGE, AI , 3, "4_TO_20_MA"
UPPER_LIMIT_VALUE, AI , 0, "22.962384259260"
UPPER_LIMIT_VALUE, AI , 1, "22.962384259260"
LOWER_LIMIT_VALUE, AI , 0, "-14.962962962963"
LOWER_LIMIT_VALUE, AI , 1, "-14.962962962963"
END

RACK 0, SLOT 6, "6ES7 322-1BL00-0AA0", "DO32xDC24V/0.5A"
BEGIN
CPU_NO "1"
ALARM_OB_NO "40"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
REDUNDANCY
BEGIN
END
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
LOCAL_OUT_ADDRESSES
ADDRESS 0, 0, 4, 0, 1, 0
SYMBOL O , 0, "P22-C", "Pumpa - P22 (HZP) (ukljucenje/iskljucenje)"
SYMBOL O , 1, "P13-C", "Pumpa - P13 (HZP) (ukljucenje/iskljucenje)"
SYMBOL O , 2, "KH-PV-C", "Usisni ventilator (HZP) (ukljucenje/iskljucenje)"
SYMBOL O , 3, "KH-OV-C", "Otsisni ventilato (HZP) (ukljucenje/iskljucenje)"
SYMBOL O , 4, "P23-C", "Pumpa - P23 (HZM) (ukljucenje/iskljucenje)"
SYMBOL O , 5, "P14-C", "Pumpa -P14 (HZM) (ukljucenje/iskljucenje)"
SYMBOL O , 6, "KM-PV-C", "Usisni ventilator (HZM) (ukljucenje/iskljucenje)"
SYMBOL O , 7, "KM-OV-C", "Otsisni ventilator (HZM) (ukljucenje/iskljucenje)"
SYMBOL O , 8, "P24-C", "Pumpa - P24 (GAR) (ukljucenje/iskljucenje)"
SYMBOL O , 9, "P15-C", "Pumpa - P15 (GAR) (ukljucenje/iskljucenje)"
SYMBOL O , 10, "KG-PV-C", "Usisni ventilator (GAR) (ukljucenje/iskljucenje)"
SYMBOL O , 11, "KG-OV-C", "Otsisni ventilator (GAR) (ukljucenje/iskljucenje)"
END

RACK 0, SLOT 7, "6ES7 332-5HF00-0AB0", "AO8x12Bit"
BEGIN
CPU_NO "1"
ALARM_OB_NO "40"
OBJECT_REMOVEABLE "1"
POS_X "0"
POS_Y "0"
REDUNDANCY
BEGIN
END
SIZE_X "0"
MODULE_ADD_FLAGS "0"
SIZE_Y "0"
CAX_APP_ID ""
OBJECT_COPYABLE "1"
CREATOR ""
COMMENT ""
LOCAL_OUT_ADDRESSES
ADDRESS 4, 0, 16, 0, 1, 0
PARAMETER
GROUP_DIAGNOSIS, AO , 0, "1"
GROUP_DIAGNOSIS, AO , 1, "1"
GROUP_DIAGNOSIS, AO , 2, "1"
GROUP_DIAGNOSIS, AO , 3, "1"
GROUP_DIAGNOSIS, AO , 4, "0"
GROUP_DIAGNOSIS, AO , 5, "0"
GROUP_DIAGNOSIS, AO , 6, "0"
GROUP_DIAGNOSIS, AO , 7, "0"
DIAGNOSTICS, "0"
REACTION_TO_CPU_STOP, AO , 0, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 1, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 2, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 3, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 4, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 5, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 6, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
REACTION_TO_CPU_STOP, AO , 7, "OUTPUTS_WITHOUT_VOLTAGE_OR_CURRENT"
AO_TYPE, AO , 0, "CURRENT"
AO_TYPE, AO , 1, "DEACTIVATED"
AO_TYPE, AO , 2, "DEACTIVATED"
AO_TYPE, AO , 3, "DEACTIVATED"
AO_TYPE, AO , 4, "VOLTAGE"
AO_TYPE, AO , 5, "VOLTAGE"
AO_TYPE, AO , 6, "VOLTAGE"
AO_TYPE, AO , 7, "VOLTAGE"
AO_RANGE, AO , 0, "4_TO_20_MA"
AO_RANGE, AO , 1, "ZERO_VALUE"
AO_RANGE, AO , 2, "ZERO_VALUE"
AO_RANGE, AO , 3, "ZERO_VALUE"
AO_RANGE, AO , 4, "+/-_10_V"
AO_RANGE, AO , 5, "+/-_10_V"
AO_RANGE, AO , 6, "+/-_10_V"
AO_RANGE, AO , 7, "+/-_10_V"
END
 
Hey guys, I solve the problem... It was a hardware failure with analog input module... Thanks for help! If I have some problems more, I will write to you! Thanks one more time for help!
You are the BEST!
 
I want to approximate a curve for controlling... Actually, I have to define some intervals of temperature, and inside that intervals I have to control the valve on different ways...
 

Similar Topics

Hi, first post here so sorry for it being a noob question but what can I do .. I need help (and of course I need it yesterday :banghead: ) The...
Replies
11
Views
5,881
Hey all. I've got a query for you. Does it require more of the processor of a PLC to generate the time value everytime a timer is called upon...
Replies
8
Views
1,393
Could anyone tell me when Network 9 will be enable ? or when value of OUTV will change ? Thank you
Replies
1
Views
1,796
In one network SFC20(BLkMOV) is used to transfer 8 byte data from P#DB500.DBX8.0(SRC BLK) to P#DB20.DBX4.0(DST BLK). I would like to change...
Replies
2
Views
4,238
how can i easly change a normal contact to a negeting contact in the program? exampel : -| |- ---> -|\|- it is not dubbel click on the...
Replies
3
Views
1,953
Back
Top Bottom