WinCC Flex trend view

JOLTRON

Lifetime Supporting Member
Join Date
Aug 2006
Location
MI
Posts
692
Is it possible to enter an I/O point during runtime for trendview to monitor.

Instead of having a list of pre determined tags to choose from I want to put an input text box on the screen and be able to monitor a specific I/O point or a couple.
 
No, not directly at least.

You could let the PLC work as the multiplexer. Specify the DB number and Word Addres in the HMI, transfer these to PLC and let the PLC fetch the data to a fixed tag address that Flex uses for the trendview.
 
Thats a good idea. I'll do that. I was thinking there would have been a simpler way but it will work.

Thanks!
 
Hope this makes sense!

So here is my attempt that doesn't work. I know I'm doing something simple wrong but I'm outta my comfort zone in STL.

I created a Function that I feed a memory type, byte address, bit address and dest any.

Trend seems to only allow Words to be selected not Bits???

My goal is to monitor a single I/O/M and display on a trend.
So monitor I4.1 and send signals to Trend1 in my HMI M85 will
For example on HMI select
memtype = 1, ByteAdress = 4, BitAddress = 1
Dest = M85.0

Create Source Any Code
Code:
//Byte 0 of ANY pointer is the HEADER which is always B#16#10 for S7
      L     B#16#10                     //Load the Byte Sytax ID B#16#10 into ACUM1 
      T     LB     0                    //Transfer ACUM1 to Local Byte 0 of Temp Variable: #SourceAny Local ANY POINTER)

//Byte 1 is for DATA TYPE: 
//Types: 01=Bool, 02=Byte, 03=Char, 04=Word, 05=Int, 06=Dword, 07=Dint, 08=Real, 09=Date, 0A=TOD, 0B=Time, 0C=S5Time
      L     B#16#1                      //Load the Byte data type BOOL(hex01)into ACUM1. 
      T     LB     1                    //Transfer ACUM1 to Local Byte 1 of Temp Variable: #SourceAny (Type Local ANY POINTER)

//Word 2 is REPETITION FACTOR - how many items to be moved
      L     W#16#1                      //Load the Word Quantity 1(hex01)into ACUM1. 
      T     LW     2                    //Transfer ACUM1 to Local Word 2 of Temp Variable: #SourceAny (Type Local ANY POINTER)

//Word 4 is DB NUMBER or 0 for none
      L     W#16#0                      //Load the Word Data Block Number 0 (Hex 0)into ACUM1 
      T     LW     4                    //Transfer ACUM1 to Local Word 4 of Temp Variable: #SourceAny (Type Local ANY POINTER)


//Byte 8 and 3LSBs of 7 are BYTE address

      L     #ByteAddress                //Load ByteAddress from HMI into ACUM1
      SLD   3                           //Shift Left Double 3 places to make room for bit level
      L     #BitAddress                 //Load BitAddress from HMI int ACUM1
      +D                                //Add 2 together to get BYTE.BIT formate
      T     LD     6                    //Transfer ACUM1 to Local Double-Word 6 of Temp Variable: #SourceAny (Type Local ANY POINTER)

//Byte 6 is MEMORY TYPE
// b#16#80=I/O area, 81=Input area, 82=Output area, 83=Bit memory area, 84=Data block, 85=Instance data block, 86=Local data (L stack), 87=Previous local data
//HMI is used to select memory type then adds hex80 to put in correct format

      L     #MemType                    //Load Memory type entered on HMI
      L     B#16#80                     //Load hex 80
      +I                                //Add 2 together to be proper format
      T     LB     6                    //Transfer ACUM1 to Local Word 6 of Temp Variable: #SourceAny (Type Local ANY POINTER)
create Dest Any code
Code:
  L     P##Dest_Any                 //Load a 32 bit Area Pointer pointing at 80 bit ANY pointer (P#DB102.DBX 60.0 INT 30) from Input Variable:  
      LAR1                              //Load Address Register One with the contents of ACUM1 (Pointer to 10 byte input variable #Dest_ANY)   

      L     B [AR1,P#0.0]               //Load the Byte Sytax ID B#16#10 into ACUM1.
      T     LB    10                    //Transfer ACUM1 to Local Byte 10 of Temp Variable: #empDest_ANY (Type Local ANY POINTER)

      L     B [AR1,P#1.0]               //Load the Byte Data Type INT(hex05) into ACUM1.
      T     LB    11                    //Transfer ACUM1 to Local Byte 11 of Temp Variable: #empDest_ANY (Type Local ANY POINTER)

      L     W [AR1,P#2.0]               //Load the Word Repetition Factor into ACUM1.
      T     LW    12                    //Transfer ACUM1 to Local Word 12 of Temp Variable: #empDest_ANY (Type Local ANY POINTER)

      L     W [AR1,P#4.0]               //Load the Word Data Block Number into ACUM1 
      T     LW    14                    //Transfer ACUM1 to Local Word 14 of Temp Variable: #empDest_ANY (Type Local ANY POINTER)

      L     D [AR1,P#6.0]               //Load the Double-Word 6 Area Pointer into ACUM1
      T     LD    16
My attempt to capture I4.1 and move it to M85.0
Code:
      CALL  "BLKMOV"                    //Call the System Function SFC20 BLKMOV (Block Move)
       SRCBLK :=#Source_ANY             //To move Source Bit Destination Bit 
       RET_VAL:=#tempRetVal             //Error code target address
       DSTBLK :=#tmpDest_Any
-Joel

Currently the SFC20 is returning a 33577 - hex 8329 Alignment error when writing a parameter.
This error code indicates that the reference to parameter x is a bit address that is not equal to 0.
 
Last edited:
BUMP.

Anyone got any advice on this.

Basicly just looking for code to check the a bool from an ANY pointer and Turn on another bit if its on.

I've tried using the BLKMOV along with
A src
= dest
type setup but havent' had luck with either
 
When I see an ANY Pointer, I instinctively reach for my gun.

Why make it so complicated ?
You have a selector box in the HMI linked to an INT tag.
And you have another tag that the HMI uses to trend.
Just use the INT tag to chose the PLC address to log:

pseudocode:
IF HMI_trendvar_select = 1 THEN HMI_trendvar = ProcesVar1
IF HMI_trendvar_select = 2 THEN HMI_trendvar = ProcesVar2
IF HMI_trendvar_select = 3 THEN HMI_trendvar = ProcesVar3
etc.

Throw out the ANY pointer and the BLKMOV.
 
I was planning on making a canned function that I can just drop into PLC and be good to go.

If I understand how your sayting to do it, it seems like I would need an If Then for every I/O in the program. This could get lengthy.

Or am I missing something.
 
So far I am still running with the ANY pointer style.

I read that when using a BOOL the length must always be divisible by 8. So I changed the repetition factor to 8 and now I get RETVAL of 8128 = Alignment error when reading a parameter.

The build of the SRC any pointer in when I monitor is:
LB 0 = 10
LB 1 = 1
LW 2 = 8
LW 4 = 0
LD 6 = 81000021

The build of the DEST any pointer in when I monitor is:
LB 10 = 10
LB 11 = 1
LW 12 = 8
LW 14 = 0
LD 16 = 83000021
o_O
 
If I understand how your sayting to do it, it seems like I would need an If Then for every I/O in the program. This could get lengthy.
You want to trend every single i/o ?

edit: If I had to trend every single i/o via indirect adressing, I would resort to SCL.
If you dont have SCL, then hopefully L D[AR2,P#0.0] will come to your rescue.
 
Last edited:
Not at the same time.
But want to be able to trend any I/O at any given time.

If I think I have a prox that may be flickering I would like to be able to walk up to the screen and enter the I4.1 and have it trend this item.

It will save me from bringing the laptop out.

And since I can't seem to find anything in S7 for trending, like I've seen the some AB stuff I worked with, just thought it would be handy.
 
edit: If I had to trend every single i/o via indirect adressing, I would resort to SCL.
If you dont have SCL, then hopefully L D[AR2,P#0.0] will come to your rescue.

No SCL at the moment. I wouldn't mind picking it up to check it out. But that costs money.

I reposted as a topic of ANY pointer to see if LD picks up on it.

Thanks for your help.
 
So LD has helped me out greatly and my code is now working. Now I notice that it isn't real time. I am missing some data. It seems like the fix for it is to use "buffer bit triggered" but there are no examples of it. And the "Help" file is not great.

Have you used this before? Can you give me some advice on it.
 
Last edited:

Similar Topics

Gurus, I have two sets of array contains 100 points of x axis and y axis. Apparently, the trend values in the wincc flex only support y axis...
Replies
1
Views
2,296
Hi there, i'm searching a solution to make one trendview with grid (WinCC Flex 2008 PCRuntime), how is it possible ? thx
Replies
0
Views
2,803
Does anyone have any experience with these. I'm trying to set this up and having issues with it. I am trying to a trend to monitor inputs but they...
Replies
16
Views
4,910
Dear all, can anyone how to create trend in wincc flexible in detail? thnx everybody
Replies
1
Views
1,813
Hi, Does anyone know if it is possible to change the colour of the limit lines on a trend view object? (WinCC flex 2008 HF1) The default seems...
Replies
3
Views
4,457
Back
Top Bottom