585,886 active members*
5,945 visitors online*
Register for free
Login
Results 1 to 6 of 6
  1. #1
    Hello!

    I need help.

    How can I program the following loop

    IF

    parameter value negative > 1 command

    parameter value positive > 2 command

    Thanks

    Regards

    GNT

  2. #2
    Join Date
    Apr 2002
    Posts
    5003
    As long as you conduct a unique command, write it in the same line. The same thing in green goes to the next line.
    So that what was equal, becomes unequal.

    You should look through the instruction. There’re some examples inside.
    If you need more than 2 possibilities, then take the Case command. Then you’ll have as many possibilities as you like.

  3. #3
    Hello.

    I believe I explained that wrongly.

    I know how I should write an IF loop. But I don’t know what should stand in clamps.

    I’ve tried it with

    IF(R10<0)

    But it doesn’t work

    How can tell the controller that it has to choose between negative and positive values?

    I can’t find anything about it in Siemens documentation.

    Regards
    GNT

  4. #4
    Join Date
    Jul 2003
    Posts
    258
    Do you mean

    IF R50 ==46 GOTOF continue working

    Continue working is a “label”

    Regards

  5. #5
    Join Date
    Nov 2004
    Posts
    2484
    You have to multiply a negative value by -1!

    As follows:

    10*-1 = -10
    <b><br />Das dringendste Problem der Technologie von heute ist nicht mehr die Befriedigung von Grundbedürfnissen und uralten Wünschen der Menschen, sondern die Beseitigung von Übeln und Schäden, welche uns die Technologie von gestern hinterlassen hat.</b><br /><br />Dennis Gabor (1900-79), ungar.-brit. Physiker, Entwickler der Holographie, 1971 Nobelpr.

  6. #6
    Hello:

    A short example:

    [code]IF R10 == 0 ;Pruefung auf =0
    MSG ("weder pos noch neg weil 0")
    G04 F2
    ELSE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •