siemens s7 symbolic field list

adamplc

Member
Join Date
Dec 2009
Location
usa
Posts
92
I have a problem and cannot find a good solution for a list of part #'s on a HMI. I have around 30 int #'s thats just say 0-29 from a symbolic field that the operator can change to various different products. if the operator changes the list to something else say was on 0 and change it to 20 I wish to know it has been changed to trigger the machine change.
What is the best way to see if the list has been changed.

Thanks for any help
 
As I see your question, you want to trigger a bit in the PLC when the operator changes the input field on the HMI.

PLC pseudocode:

Code:
IF HMI_selection_input = HMI_selection_memory THEN 
  HMI_selection_was_changed := FALSE
ELSE
  HMI_selection_was_changed := TRUE
END_IF
HMI_selection_memory := HMI_selection_input
 
IF HMI_selection_was_changed THEN
// do the activity
 
Have a copy of the list. Compare the two lists, if they are different, flag a machine change. Update the copy.
 
Thou both solutions are great they seem to exceed my abilities as i'm a little noob with siemens.
L D[AR2,#P0.0] how do you update the list after the compare?

Thanks
 
In the HMI software you can set the event of the HMI tag.
Set it to "set bit" and your done.
 
Code:
       L #HMI_value1
       L #HMI_copy_value_1
       <>I
       JC Diff
       JU OK
Diff: // Perform whatever action you want to happen after a change here
 
OK:    L #HMI_value1
       T #HMI_copy_value_1

What about something like that??

(Not tested but looks like it should work...)

You'd need one for each of the thirty INT's but you could set up a function that you pass in the value and the 'output' and then just cycle through the thirty INT's...

;-)
 
I was also not wanting to set events through the hmi. I already got to the point of uptown's solution but it is just so cumbersome lots of compares not sure if the pointer is a good way or not as I didn't fully understand them is this an option?
 
Yes. Write a function with 3 input parameters; pointer to table, pointer to copy, number of entries to scan. Return value is a bool which will be true of the table has changed.
 
Not sure if I got it right, is it 1 Symbolic field with 30 entries or 30 different Symbolic fields with each 30 entries?
 
In stead of Range (...-...) use Btinumber (0-31) (warning: this limits future selections to 32max)
Said Text list is linked to Symbolic IO-field which is linked to Doubleword tag.
Each bit in this doubleword is a 'product choice'.
Positive edge detected on bit will start corresponding changeover.

Or you could just do:

Code:
      L #HMI_copy_value_1
      L #HMI_value1
      <>I
      JC Diff
      JU OK
Diff: NOP 0
      JL err    // If selection falls outside max programmed selections
      JU PR00   // Product 00 (Symbolic selection  = 0)
      JU PR01   // Product 01 (Symbolic selection  = 1)
      ....
      JU PR29   // Product 29 (Symbolic selection  = 29)

PR00: NOP 0
// Set trigger bit for changeover to product 0
// And some other stuff if needed
      JU OK
PR01: NOP 0
// Set trigger bit for changegover to product 1
// And some other stuff if needed
      JU OK

....

PR29: NOP 0
// Set trigger bit for changegover to product 29
// And some other stuff if needed
     JU OK

OK:  L #HMI_value1
     T #HMI_copy_value_1
The moment a change in value is detected, it will jump to the relevant spot in the list and trigger anything you want to do.
from here on you have several choices, either do this for only one scan when it changes, or keep going through the code until the changeover is completed.
For the latter, you will have to add a jump over the OK label.

Note: The example one is limited to 256 selections and doesn't really accept gaps in the number of JU. (read the F1 for more information)
 
Last edited:
As I understood it though, you need to know which entry has changed and not just that any entry has changed?? Is this correct??

I just need to know it has changed I like what L D[AR2,0.0] has done many thanks, but in order for me to understand when pointing to w 0.0 i am pointing at the db # correct?
When pointing at the D 2.0 within the AR am I pointing at the area?
I feel a burger moment coming on!
 

Similar Topics

Hello, I am new to Siemens programming. I have been an Allen-Bradley guy for years (20+). I am struggling to understand some of the language...
Replies
5
Views
6,001
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
0
Views
1
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
26
Views
307
Hi everyone, I am an omron plc tec , lately I came across a siemens s7 200 cn plc . Can someone help me regarding the software required and...
Replies
26
Views
470
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
117
Back
Top Bottom