PIW and PQW in scl

Join Date
Sep 2005
Location
Niel (Antwerpen)
Posts
32
Hi,

Maybe someone can help me

I have a altivar ATV61 connected with profibus.
The connection is ok
Now I want to read and write data to it
The drive have 10 input words PIW265 .. 275
and 10 output words PQW 264.. 274
I have no addresses more available in my Inputs or Outputs soi needed to use PIW and PQW.
How can I write and read data to this type of addresses.
I cannot monitor PQW ?
All I see is the frequence in PIW 267
I'll don't understand the PIW and PQW?
Can someone tell me how to reach this data?
I program in SCL

Thanks :geek:
 
I don't think you can directly reference the PIW & PQW.
You'll need to use internal registers do you math and such and read your PIW & send to your PQW
Can you post your hardware configuration (screen shots)?
 
Danny van den Heuvel said:
I'll don't understand the PIW and PQW?
I and Q are part of the "proces image" of the CPU. The CPU updates the proces image automatically. All data of the Proces Image is consistent.
Outside the Proces Image you have to use PI and PQ. PI and PQ is read or written the instance the address is encountered in the code. So this slows down program execution. And you can max get 4 bytes consistent by addressing PI and PQ in code (with PIDn and PQDn).

bkottaras said:
I don't think you can directly reference the PIW & PQW.
You can, but it may be a bad idea.

10 Words is more than can be consistent by just using PID, PQD, and a drive typically must have consistent data. So you need to transfer the data consistently to and from the drive with the necessary blocks for doing so.

So for the code part in SCL you have to use an intermediary buffer, Merkers or a shared DB, and then use DP_SEND/DP_RECV (if the Profibus net is via a CP) or DPWR_DAT/DPRD_DAT (if the profibus net is via an onboard DP port).
 
Last edited:
Here's some example SCL that reads data from an example drive. You will have to customise it for your own application:

Code:
  FUNCTION_BLOCK FB305
   
   VAR_INPUT
   wPIWAddress:WORD;
   END_VAR
	  
   VAR_OUTPUT
   iActualSpeed:INT;
   bDriveRunning:BOOL;
   END_VAR
   
   VAR_TEMP
	iSFC14ReturnValue:INT;
   END_VAR
   
   VAR
   //Static Variables
   Send: ARRAY[1..10] OF byte;
   Receive: ARRAY[1..10] OF byte;
   Rx AT Receive: STRUCT
	Status:STRUCT
		bRunning:BOOL;
		bReady:BOOL;
		bFault:BOOL;
		bMoreBitsA:BOOL;
	END_STRUCT;		
	iSpeedFeedback:INT;
	iMoreData1:INT;
	iMoreData2:INT;
	iMoreData3:INT;
END_STRUCT;
	 
   END_VAR
   iSFC14ReturnValue:=SFC14(LADDR:=wPIWAddress,RECORD:=Receive);
   iActualSpeed:=Rx.iSpeedFeedback;
   bDriveRunning:=Rx.Status.bRunning; 
	   END_FUNCTION_BLOCK
 

Similar Topics

Hello, I have a CPU 315-2dp plc using for profibus communication with the SEW Movidrive MDX61B inverter. In the hardware configuration I have...
Replies
25
Views
8,091
Hi all, I recently was trying to find the addresses being used by a DP/DP Coupler in S7. The addressing was Input Word 20 and Output Word 20...
Replies
8
Views
7,408
Someone knows a way to move a big range of piw to a DB? The range is 224 byte. We can change the Hardware of the PLC so we can access it with IW...
Replies
2
Views
2,612
How to declare PIW PQW in WinCC (Analog Values)with simatic manager.... Any Examples Appreciated ..........
Replies
14
Views
7,751
Is there any way to get diagnostics info on device connected over Profinet/Profibus (communication with device fault) from PIW assigned to that...
Replies
6
Views
2,479
Back
Top Bottom