panic mode

MrPLC Admin
  • Content count

    3020
  • Joined

  • Last visited

Posts posted by panic mode


  1. well, whatever rocks your boat but... what happens when that central PLC goes down or there is power outage or some fault?

    not that alternatives are to be ignored, just trying to get the original question answered.

    so why is reading wall clock time hard? all it takes is to declare an array and add GSV instruction to write to it. in fact i would make more than one array for different purposes:

    a) current time (need to be retentive and in AB PLCs that is pretty much all of the memory)

    b) last powerup time and

    c) last shutdown time.

     

    so here program rung with GSV is constantly reading wall clock and writing to "a" (current time, which can be used for other things in the PLC)

    and on the first scan, use copy instruction to copy entire array "a" (current time before PLC was powered down) to array "c" (last shutdown time), then read wall clock and if needed another copy instruction to save time to "b" (last startup time).

    and that's it... both time stamps are captured.

    now when ever is convenient (or right away if you like) you can calculate the difference between "b" and "c" and store it in a suitable format, perhaps using single CPT instruction. for testing and development you can go without CPT and just subtract individual array elements.

    d.year=b.year - c.year
    d.month=b.month-c.month

    etc.

    or in RSLogix where those elements are parts of arrays and not structure, that would be

    d[0]=b[0]-c[0]
    d[1]=b[1]-c[1]

    etc.

    obviously this is easily done in a loop too.

     

    if result of any element is negative, correct for it the same way you would do long subtraction on paper using borrowing, for example.

    if d.second<0 then 
      d.second = d.second  + 60 ; 1min  = 60sec. so here we add one minute...
      d.minute = d.minute-1 ; and here we subtract it to keep it balanced
    endif
    
    if d.minute<0 then 
      d.minute = d.minute + 60 ; 1h  = 60min so here we add one hour...
      d.hour = d.hour-1 ; and here we subtract it to keep it balanced
    endif

    if the result is expected to be in specific units (seconds or minutes or hours) just multiply or divide other array elements as needed and sum them up. 

     

    1 person likes this

  2. create logic that constantly stores current PLC time to a retentive data block. on powerup, using first scan flag you can read this value and compare this with present time.

    if the data goes to some PC or database, comparison could also be done on PC end...

    and constantly in this case means using some suitable interval (every scan or some other suitable interval, perhaps every second... or every 10 seconds)


  3. it could be a whole bunch of instructions that could be responsible. some will only affect one bit, some will do one or more words...

    consider posting details like PLC type, software version, cross reference etc. 

    on small PLCs (FX) latched area may be fixed, on larger PLCs it may be configurable. 

    also you did not post your code so maybe your code is not scanned (MCR?)


  4. it is internal memory, meant for bit-wise access... other types also exist like L, B. D etc.

    they all can be used store information and keep track of things. 

    unlike inputs and outputs they are not exposed to external world.


  5. 1 hour ago, Steve Bailey said:

    Perhaps the owners are starting to pay attention. The notice that Chelton cited when he started this thread no longer appears. It sure would be nice if someone from the ownership posted once in a while to let us know what's happening.

    yes, that and couple of other things are fixed but there seem to be couple of things that are still outstanding. one new thing possibly related to updates is login issue, but this is where user feedback comes in, if any issues are spotted and not listed, please use this thread to report it. 

    1 person likes this

  6. yes... as long as sensor outputs are compatible for such use. also sensing function (reflective, optical, capacitive, inductive etc.) is independent from output type. 

    but sensor market is changing and the number of choices is becoming greater. and today it is not uncommon to see sensors with different type of output. in the past vast majority of sensors was sold as open collector/drain of either "NPN" or "PNP" style. but times have changed, sensors with PP (Push-Pull), IO link etc are not exactly rare. so knowing the nature of the beast is important, and this is why one should read the datasheet and understand what output stage and configurations are possible.

    when sensors have open collector/drain output and all of them are using same polarity ("NPN" or "PNP") then they can be wired in parallel without issue. but ... other possibilities exist...

    nice characteristic of PP outputs is that one does not have to commit to one polarity. same sensor will be useful in installations that use either of the polarities. but connecting two or more such outputs together would create short circuit. this is why some sensors with flexible outputs choose to con bring this output on one terminal. using two separate terminals for this (black/white wire or contact 4/2) still allows paralleling without issues. others use configuration that depending on selection enables only one of the two output transistors. some have decided to just make it 2-wire sensor. this is nice but has leakage current and voltage drop is bigger than with 3-wire sensors. if such sensors are cascaded (wired in series) voltage drop is quite significant. 

    but there are also 3-wire sensors where output is on single terminal. and if such sensor output stage is PP type, then paralleling is still possible, but external diodes are required. diodes can always be used in paralleling DC sensors but they too increase voltage drop slightly (using Schottky it is even lower).

    hope this helps a bit. note instead of PNP/NPN i used term in quotation marks "PNP" or "NPN" because actual transistor output may be different but still performing same function.

    sorry for using external site for image, there was a problem uploading attachment here and forum is undergoing some rework

    https://pasteboard.co/JAyreyh.png

    1 person likes this

  7. very good and thanks for pointing out issues. @ Chelton, no worries i actually checked and found no way to login/logout any more. you guys are correct.... this is exactly why we need everyone to report any lost functionality. without feedback there is little hope for improvements. :-2


  8. please note that forum admins/moderators are not the ones working on forum functionality. this is what site owner/webmaster can look into, so i would like to encourage everyone to report in this thread if there is any other concern or wish. this would allow forum support/webmaster to look into issues in one place, rather than assuming everyone is happy or need to go fishing for clues. also try to be positive and provide details that would help addressing the issue. this means providing enough info to understand and reproduce issue, or why should that be considered an issue at all so that support/webmaster can evaluate it. for example i am always accessing forum for my machine and i may not see a reason to log out from some site i use often and always from my machine. and if using someone elses machine, why not use incognito mode (just an example, don't shot the messenger).

    1 person likes this

  9. according to simplified circuit shown in datasheet, PZ series has open collector output. if this is correct and all sensors use same polarity output (all PNP or all NPN), there should no issues paralleling the outputs to drive common external load (PLC input of whatever). if the output stage is different (has built in load or stage is push-pull type etc.) then this would not the a good idea because output current would need to be limited. this could still be used by adding diode to each output.  note that adding diode increases output voltage drop but for usual operation at 24V this should be no problem.

    1 person likes this

  10. that is exactly what i did and hope everyone else tries.... this is a fantastic resource for so many users and place where some of the most generous and brightest minds come or offer help, free of charge and without corporate overseer. I remember well trying to offer honest feedback to one of major automation company only to see ignorance and retaliation. This is precisely what attracted me to MrPLC because it is an independent and brand-agnostic forum. i sure hope that site receives deserver TLC and springs back to a former glory. 


  11. the only trouble is that my imagination does not stop at 13 or 50W or 10MBps. :-D 

    i'm imagining pair of thick wires going to a treehouse with electric grill, beer fridge, laser TV on in front, blazing internet machine on the right and view of a sunset over beach to the left... 

    2 people like this

  12. i would just use the existing one and maybe change few things... and make it look better and more flexible (easier to scale...)

     

    1. goto CONTROLS sheet and change color of cells F2,F3,F4 to something else and maybe set borders. there are cells where you can enter own values.

    2. click on StringList cell A2 and change formula to =CONTROLS!$F$3&"["&J2&"]"   (this one looks better and it is easier to extend since you will need 500 elements)

    3. then click on that cell again , grab black rectangle in the lower right corner and drag it down sufficiently far (1000 rows for example)

    4. click on StringList, J2 and enter 0 (whatever the first array index is), in J3 enter 1... select both J2 and J3 at once and like before drag the lower right corner down sufficiently far (1000 rows for example)

    5. now the spreadsheet got some facelift...  go to sheet CONTROLS and click on cell F3, change name from MSG_TAG to name you need, then check previous sheet with string data. note that all those 1000 rows now show your variable name and correct index, and you can do more than 300 elements.

    6. go to sheet CONTROLS and click on cell F4, change value to 500

    7. paste your strings from your Excel document to StringList cells B2-B501

    8. click on write....first of three tags are being written....

    9. repeat from step 5 for other two tags.

     

     

    Btw. i strongly suggest to not use this method on first few projects. just copy those 1500 strings one by one manually and do so on at least 2-3 projects. after that you will no longer lack motivation to get acquainted with Excel and VBA ;-)


  13. unfortunately few things may be broken with the forum. that may be one of them.

    also please use complete sentences when describing steps you did. it is not easy to follow what you mean and i don't want to keep on guessing. just like you would like detailed instructions, we would like to know what you have done or are trying to do. 

    1. you downloaded 'what' to a PLC? you mean your program?... or enclosed ACD file? which is it?

    2. you open Excel? what does that mean? there are two files, which one did you open and how? Using some version of Excel? there should be prompt asking if you are sure to enable macros etc. did you do so?

    3. there is a dialog suggesting to start RSLinx...  did you get that?

    4. link description says " VBA code is well documented " did you read the code? it uses DDE. What type of RSLinx you have? i don't think DDE works with RsLinxLite.

    5. you added couple of messages... where exactly?

    6. did you adapt DDE Topic name

    7. you clicked and nothing changed? what does that mean? no response? dialog did not open and confirm operation succeeded or failed? or it did but no change on PLC? or something else? did you try setting brake points and stepping through code?