small question in S7

girevik said:
I believe IW is used for digital inputs and PIW is used for analog inputs...
I'm afraid it's not that simple.

The cycle of a PLC consists of (amongst other things):
  1. Reading the state of all connected digital inputs and storing these in the PII or Process Image Inputs
  2. Processing the program based on (amongst other things) the Process Image Inputs and storing the results in the Process Image Outputs (PIQ).
  3. Copying the stored results from the Process Image Outputs to the connected (digital) output cards.
If in your program you're reading an IW (or Input Word), you're reading the value as was stored in step 1 of the above list. If, on the other hand, you're reading a PIW (or Peripheral Input Word) then you are reading the value as is at the moment of processing the instruction.

To my knowledge (i'm only using S7-3XX) S7 analog in- and outputs are never stored in the Process Image tables, so you can only access these with PIW and PQW instructions.

Kind regards,
 
thanks

Dear jvdcande
thnak you so much for your information.It really helped me.

jvdcande said:
I'm afraid it's not that simple.

The cycle of a PLC consists of (amongst other things):
  1. Reading the state of all connected digital inputs and storing these in the PII or Process Image Inputs
  2. Processing the program based on (amongst other things) the Process Image Inputs and storing the results in the Process Image Outputs (PIQ).
  3. Copying the stored results from the Process Image Outputs to the connected (digital) output cards.
If in your program you're reading an IW (or Input Word), you're reading the value as was stored in step 1 of the above list. If, on the other hand, you're reading a PIW (or Peripheral Input Word) then you are reading the value as is at the moment of processing the instruction.

To my knowledge (i'm only using S7-3XX) S7 analog in- and outputs are never stored in the Process Image tables, so you can only access these with PIW and PQW instructions.

Kind regards,
 
You can use PIW for digital as well, if you have a function that is called more than once in a program and you need to acces the actual inputs and outputs rather that their image at the start and image to put out at the end of scans, that is what I and Q are, then you need to update the image from the real world periphery.

In S5 it used to be simply L PW4 T IW4 to update the input image and L QW4 T PW4 to update the real outputs, I presume in S7 L PIW4 T IW4 is the same, but I do know that Step 7 does have standard blocks to update images from/to real world, so perhaps its not as simple.
 
To my knowledge (i'm only using S7-3XX) S7 analog in- and outputs are never stored in the Process Image tables, so you can only access these with PIW and PQW instructions.
This is not 100% correct either.

Lets sort it out:
Both S7-300 and S7-400 has a proces image table of a certain size.
If the selected address for an input or output is within the available proces image, then the input or output can be accessed via the proces image (I or Q).
If it is outside the proces image, then the input or ourput can only be accessed via direct access to the periperial address (PI or PQ).
This applies to both digital and analog i/o.

Direct access via PI or PQ burdens the cycle time because the CPU has to load the value immediately from the i/o module.

The typical is that digital i/o are assigned addresses within the proces image, and analog i/o are assigned addresses outside the proces image. The reason is that digital i/o normally is accessed many times within the program whereas analog i/o is normally accessed only once (when scaling the raw analog values to engineering values).

STEP7 will by default set the address of an analog module so high that it is outside the proces image (for S7-300 typically from 256 and up). Try to change it to a lower value. In S7-300 it will then automatically be assigned to the proces image. In S7-400 you get the option to assign it to a proces image.
 
Jesper,

this is again proof of the fact that there is always something more to learn. So far I've never looked into or had the need for assigning analog signals to an address within the image tables.

Thanks for the info.


Kind regards,
 
thanks

Dear friends
Thank you so much.I learend too many things.
jvdcande said:
Jesper,

this is again proof of the fact that there is always something more to learn. So far I've never looked into or had the need for assigning analog signals to an address within the image tables.

Thanks for the info.


Kind regards,
 

Similar Topics

Hi Guys, I was wondering if you guys could help me out. I want a tag to display a certain word depending on a set of tags. There are six flag...
Replies
8
Views
2,533
Hello I'm new with the PLC :) so my Question is that I want O/1 to be on when I push I/1 and when I push I/1 again O/1 becomes off. considering...
Replies
4
Views
1,909
i have a small question ? hope you guys ansewer me i have a siemens plc , and i want to switch on any object for example a fan , and i want...
Replies
25
Views
5,378
Here is the logic i am designing. The X3 is basically a push button when u press it once it put something in on position. when u press it again it...
Replies
7
Views
5,348
my dear friends, plz tell me how can i compare 2 words? I dont want to convert the words to integer.
Replies
7
Views
6,240
Back
Top Bottom