Siemens AI/AO points Address and Data Type..

stevenPLC

Member
Join Date
Sep 2004
Posts
27
Hi,

1)I configure :
a)AI point address as PIW 1
b)AO point address as PQW 1

Are the "PIW" and "PQW" assignment correct?

2)What Data Type are these AI and AO points?How can I convert Setpoints(which is Real Data Type) to drive AO points?I have tried to use the FC106 (Unscale Function Block), but seems it cannot work.

Thank you....
 
1) It is probably correct. In the hardware configuration, all inputs and outputs can be specified, and the hardware configurator will take care that overlapping addresses are avoided.
However, it is most "normal" that digital i/o starts in the low range (from I0.0 and Q0.0) and analog starts in the high range (from PIW256 and PQW256 for example).

edit: I just noticed that you have specified uneven numbers for the addresses. The normal is to specify even numbers (PIW0 or PIW2 etc.).
Not sure if that would mean that the code doesnt work. I think it would still work, even with uneven addresses.

2) It should be possible to use FC106 to scale between a REAL value and an INT value for the PQW address.
When you specify a symbol for the PQW address, the dialog will default to a WORD data type. You must specify an INT data type for the symbolic address to be compatible with the output of the FC106 block.
If you still have problems then post your code.
 
Last edited:
If you put an analogue card in the process output image, e.g. PQW1, then won't it get overwritten with OW1 at the end of the scan ? The output address should be OW1 in the call to FC106.
As Jesper says, I start my analogues at PIW/PQW256.
 
If you put an analogue card in the process output image, e.g. PQW1, then won't it get overwritten with OW1 at the end of the scan ?
That's an interesting question, I always use the system defaults, so it's not relavent for me in practice, but I'd be intersted to know the answer.

Any comments S7Guy?
 
Hmmm, a very good question, not that I intend to actually try this.

Let's think about this: The entire process image table varies by CPU, and the I/O table takes up a small slice of it (0-255 in the 3152DP, but 0-511 in the 416). It's not possible to address, say, QD680. But could I address PQD12? I don't think QD12 would stomp on it, because there aren't two separate images. But I really don't think PQD12 would be updated immediately, and maybe you'd even get an I/O access error, because technically PQD12 doesn't exist.

But that doesn't mean that all analog cards have to be set up as PI/PQ addresses. They always default to the P area, but I can overwrite it if I want. On the other hand, I can take a run of the mill digital output card and assign it to word 800, but then I would have to address it as PQW800, not QW800. So, I think the address is what matters, not the card type.

So, this what I think is happening above:

1. If L PIW1 is used, there must be an I/O access error.
2. If L IW1 is used, it would probably work.
3. The size of the IO image in the hardware configuration could be reduced from 256 to 0 and then L PIW1 would work.

Jeez, now I've got to dig up some IO and try it.
 
If you put an analogue card in the process output image, e.g. PQW1, then won't it get overwritten with OW1 at the end of the scan ?
Aha, the question is:
"what is the difference between the normal i/o (I and Q) and the periferial i/o (PI and PQ) ?".

The normal i/o (I and Q) is a memory area in the CPU, just like the merkers. But the CPU automatically fills the I area with the status of the digital inputs, and it automatically reads the status of Q area and updates the outputs accordingly.
But (here it comes) this will only happen up to a certain limit of the size of the I and Q area. On a S7-315 the automatic updating of the I and Q area ends at I127.7 and Q127.7. The limits differ from CPU type to CPU type.

The periferial i/o (PI and PQ) is updated immediately by the CPU when it encunters an instruction that uses PI or PQ. This obviously puts a penalty on the scantime.
The advantage is that addresses outside the limited normal I and Q area can be accessed.
A secondary advantage is that if faster input and output updating is required, then accesses to i/o can be done in the middle of the program scan (rarely used, but probably extremely valuable to some).

It is possible to assign the PI and PQ addresses atomatically to the I and Q addresses. This is done in the hardware configuration of each i/o card by assigning a Proces Image to the addresses.
In the S7-300 this happens automatically if the PI and PQ addresses lie within the limits for the I and Q area. You cannot select or deselect it, it happens automatically.
(This answers the original question above - Yes, PQW1 will be overwritten by QW1).
In the S7-400 it is possible to manually specify the Proces Image.

And what is the use of this assigning of PI and PQ to the Proces Image of I and Q ?
This also pussles me. The comfort of not using PI and PQ ?
For analog i/o, nobody (or almost nobody) uses the direct unscaled values. It is common to use a scaling function (like FC105 and FC106) once per scan, and use PIW and PQW with these scaling functions. In the main program the scaled values are used.

If you choose system selection in the hardware configuration of the analog cards, then notice that it automatically suggests values outside the I and Q area (and thus no Proces Image is assigned).
 
JesperMP said:
...
And what is the use of this assigning of PI and PQ to the Proces Image of I and Q ?
...
If you intend to read from or to write to analogue card every program scan then it's better (faster scan) to assign the card to the PI area.
 
Jacekd,
do you mean to say that the scan is faster if the card is assigned to a Proces Image ?

From the online help, an advantage seems to be that the i/o is consistent during the program scan:
Compared with direct access to the input/output modules, the main advantage of accessing the process image is that the CPU has a consistent image of the process signals for the duration of one program cycle. If a signal state on an input module changes while the program is being executed, the signal state in the process image is retained until the process image is updated again in the next cycle. The process of repeatedly scanning an input signal within a user program ensures that consistent input information is always available.

I also says:
Access to the process image also requires far less time than direct access to the signal modules since the process image is located in the internal memory of the CPU.
However, if you access the i/o only ONCE per scan (like when scaling the inputs for further processing), then I think that the result will be the same. I mean, who uses the raw analog values without scaling these days ?
 
Yes, however it doesn't save you much (but it's still better then nothing). It happens because every reading/witing to the perypheria has certain overhead. So when CPU transfers data to/from the PI you have one overhead time per a module. When you read/write a channel you have one overhead time per a channel.
 
Hello!
Somebody can help me, I have to rearrange a rack in S7 HW conf, when I trying to set the i/o addressess for one DP , and I do need to set the same addresses as same as in the other project, S7 asign automaticly new address to that, there is one possibility to match both DPs with same addresses in differents PLCs.

Thanks any feedback!!!
 
I hope I understood ypu well. I see two reasons of your problem:
1) your S7 CPU does not support the feature of freely assigning of addresses
2) after change of the address, module affected overlaps address space of other module
 
Claudio,
have you tried to uncheck the setting "System Selection" under the "Addresses" tab for the hardware configuration of the card ?
If there is no such checkbox setting, then possibly your hardware doesnt support free assignment of the addresses, as jacekd states.
 

Similar Topics

Hi everybody! I suspect that the question in the title has been answered long ago. However, I would appreciate very much your comments. One...
Replies
10
Views
20,306
Hello everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
4
Views
64
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
3
Views
87
Hello to all, I'm just starting with using CodeSys. Immediately, I have noticed that Codesys doesn't use data blocks like for example S7 does...
Replies
11
Views
162
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
111
Back
Top Bottom