panic mode

MrPLC Admin
  • Content count

    3018
  • Joined

  • Last visited

Posts posted by panic mode


  1. On 1/19/2022 at 2:23 PM, BL said:

    I have try all but if i try to rebuild (F4) then it give a error in the 32bit label.

    i know you did but... you still did not show what exactly did you try. please post your code and how you try to use the instruction as well as how used variables are declared and their values. Also post example of what you want or expect the code to produce. Then others will be able to comment on it or try it out themselves.

     

     


  2. you should get a copy of the manual for your PLC. it will make your life much easier. many instructions are available in 16 and 32 bit version.

    names of 32bit instructions are easy to recognize since they start with D ("double word" is 2x16bit=32bit)

    example of such pairs include

    HCMOV and DHCMOV - move word or doubleword from highspeed counter

    RCL and DRCL - rotate left with carry

    RCR and DRCR - rotate right with carry

    exact name, availability and details of each instructions is in the manual

    i have not used FX5 but quick glance suggests that things are bit different here - instruction name does not change so SHL can be 16 or 32 bit as determined by type/side of the operands.

    https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d55801/jy997d55801t.pdf

    see page 1283


  3. that is correct

    manual will explain what the dial switches are for. the factory default setting is to use 192.168.1.X subnet, in which case dial switches are used to specify the last octet of that address so if you set the switches to 123, IP address will be 192.168.1.123. for other settings you really need to check manual.

    if this does not work you need to do a factory reset (set switches to 888, power up for 15 seconds, then power down, set 999, power up again and defaults are set).

    then to assign IP that is in a range different from default, use AB utility BOOTP and follow manual. of course make sure to disable BOOTP/DHCP or everything so far is useless.

     


  4. first of all is the value correctly saved in DB? if you open it in Access can you see the correct (not rounded) value? Can you manually set value in correct format?

    that could narrow down where the problem is. maybe everything is fine and the only issue is display format/settings of the "Live Monitor".

    one could also play with DB and create calculated field/column that produces any format or representation you like.


  5. It also depends on your familiarity with PLCs. Like Inntele suggested, i too would most likely just write the new program from scratch.

    I like programming and structuring things my way. That requires knowing how machine works. But that's me.

    1 person likes this

  6. wow, a blast from the past... very distant past... a real museum piece that somehow still works.:-D

    to get program out of it you would need one of several equally ancient options.

    like some hardware programmers and cassette decks, or one of LCD programmers... none of those will be of any use unless you have a way to transfer data from tape deck to some media used by todays computers or if you do not mind reading instructions of LCD display or printout.

    the best option is a really old computer running MEDOC along with programming interface F2-20GF1.

    finding working F2-20GF1 will be a challenge. those who may still have will gladly sell it for a measly few hundred $$$. if this is a one-off case, you will be better of to not waste money on it and rather hire someone with needed tools and skills to transfer the program for you. 

    https://ibb.co/9q53xj5

     

     


  7. LOL, that could be one of the reasons...

    are those machines automated with some sort of industrial controller (PLC, DCS, Robot ....).

    if so what are the network options? for anything inside plant today, one would try to go Ethernet. plenty of existing installations use legacy bus type networks. 

    The idea is that each controller would take care of local automation and if needed communicate with other units.

     


  8. i skimmed over instruction set and yes there are options to measure time using timer or not. timers are really just counters. if the built in version does not work for you (maybe you need different range etc) then make your own using clock and counter. counters are always edge sensitive so to change counter value use input that is stream of clock pulses enabled when valve is open (just AND them).


  9. Quote

    We had plenty of money, but it suddenly vanished.

    sounds like you have no money now.

    Quote

    There are legal issues preventing us from accepting funding beyond 10% of our currently-zero budget.

    sounds like you may not be able to accept funds. not sure that includes hardware donations. (just wag)

    Quote

     All the outputs ever do is switch from 0 to 5 volts now and then.

    maybe using hysteresis or PWM to achieve the same? need to check the logic...

     


  10. agreed....

    btw. access to water is vital and will easily gain sympathy. a good word and plea for help may go long way. cost of replacement hardware that would make job easier is really not high. single donation could take care of it. maybe start page at GoFundMe and cross fingers...? or consider asking AD for a possible hardware donation. 

     


  11. first of all congrats on taking charge of the situation and making thing better.

    i only used Alphas couple of times and that was years ago. one of the big problems i recall is exactly what you are describing - code representation. code does not retain state and that alone is a death sentence to anything more than a most trivial exercise since it makes code maintenance practically unusable.

    this is by far the biggest complaint i have with FBD language on any platform, but in case of a small controller (smart relay) this is particularly painful as one cannot organize code in separate files or pages. i would have hoped that over time more control over this is added but i guess that was not the case. 

    i do not want to use programming language unless code representation is rigid. that means sticking with ladder and structured text. i really do not want to waste my time dragging boxes and lousy rubber band connections.... 

    since there is only handful of I/O, changing platform should be easy. i would just replace it with something newer, more flexible and much easier to use.

    for example Click PLC from AD is robust, very low cost, modular and software is free. using ClickPlus you also get Ethernet option so this can be tied to network, etc.

    good luck...

     


  12. not Schneider guy either but here is a generic example in structured text for consideration. since it does not rely on specialized instruction, this is easy to implement on any platform. note that it does use simple bubble sort but this is fine when data set that is not big (and 8 elements is very small).

    VAR
    	PUMPS_ENABLED:INT;
    	PUMP_RUN : ARRAY[1..8] OF BOOL;
    	AGE_MEASURED :ARRAY[1..8] OF REAL;
    	AGE_SORTED :ARRAY[1..8] OF REAL;
    	INDEX : ARRAY[1..8] OF INT;
    	TMP_REAL:REAL;
    	TMP_INT:INT;
    	I:INT;
    	J:INT;
    END_VAR
    
    // assume some random data (before sorting...) 
    // this set is normally obtained by using retentive
    // timer or counter to keep track of each pump age
    
    AGE_MEASURED[1]:=763.91;   
    AGE_MEASURED[2]:=8161.8;
    AGE_MEASURED[3]:=1008.9;
    AGE_MEASURED[4]:=6731.8;
    AGE_MEASURED[5]:=450.75;
    AGE_MEASURED[6]:=108.3;
    AGE_MEASURED[7]:=4400.18;
    AGE_MEASURED[8]:=9250.75;
    
    // Initialize sort data before sorting
    FOR i:=1 TO 8 BY 1 DO
    	AGE_SORTED[i]:=AGE_MEASURED[i];
    	INDEX[i]:=i;
    END_FOR
    
    // simultaneously sort both AGE and INDEX arrayes by values in AGE
    FOR i:=1 TO 8 BY 1 DO
      FOR j:=i+1 TO 8 BY 1 DO 
        IF AGE_SORTED[i] > AGE_SORTED[j] THEN 
          // --- swap values for age ---
          tmp_real:=AGE_SORTED[i];
          AGE_SORTED[i]:=AGE_SORTED[j]; 
          AGE_SORTED[j]:=tmp_real;
          // --- also swap value for index ---
          tmp_int:=INDEX[i];
          INDEX[i]:=INDEX[j];
          INDEX[j]:=tmp_int;
        END_IF
      END_FOR
    END_FOR
    
    // use index after sorting to control outputs
    //PUMPS_ENABLED := 3; // just an example
    FOR i:=1 TO 8 BY 1 DO
    	PUMP_RUN[INDEX[i]]:= i<=PUMPS_ENABLED;
    END_FOR

     

    btw. code to totalize pump age is not shown but this is easy to accomplish in different ways.

    for example just use periodic clock (1s or whatever) to increment 8 counters if their pump is active.

    also may want to add some code to prevent reaching overflow some some day. for example from time to time (every hour or every day), subtract from each counter value of the lowest counter.

    EDIT

    attachments are broken again so here is external link showing result

    https://ibb.co/stvtRvj

     

    1 person likes this

  13. well, what is the type of the load, what is the current? i used it a lot.

    btw. this is a safety relay with six contacts but contact rating is rather low.

    in other words it is suitable for interfacing and making hardwired logic but not very good for driving loads. and even light loads could be too much if those loads are inductive and without proper suppression. that wears contacts rather quickly. one of the problems with using suppression is that response times are lower and that is one thing one tries to avoid in safety circuits.

     

    1 person likes this

  14. i think your example is just too complicated. i am not fan of branched rung being folder either.

    to me, mode selection and permissives are two completely different things and my advice is to keep them separate (break up the long rungs).

    i like to think that mode selection is just mode selection - no IFs and BUTs. like a selector switch -you choose mode and machine is immediately in that mode - always and unconditionally.

    what you can do with that mode will depend on permissives... and that can come later...

    in this example i tried restructuring it a bit but externally this should be compatible with rest of your program.

    note that chain of contacts in rungs with permissives is very simple - just a chain. even when such rung is long, such chain folds nicely.

    mode.png

    1 person likes this