panic mode

MrPLC Admin
  • Content count

  • Joined

  • Last visited

Community Reputation

34 Excellent


About panic mode

  • Rank
    Mitsubishi Moderator
  • Birthday 12/15/69

Contact Methods

  • Website URL
  • ICQ 0

Profile Information

  • Gender Male
  • Location Mississauga, ON
  • Country Canada
  • Interests many...

Recent Profile Visitors

5807 profile views
  1. HC-SRO4 an arduino Sensor

    No PLC can use this kind of sensor directly.   This type of sensor requires controller to initiate measurement and capture echo with very precise timing - something PLCs simply cant do (need I/O that respond within micro seconds). You can use microcontroller and convert signals to something PLC can read or - choose an industrial sensor with output that is compatible with PLCs (this is simple to interface  but it will cost hundreds of $). if you are on a budget, just throw in Arduino as a converter... you can transmit signal to PLC in different forms (analog, serial, parallel).   Btw. ultrasound sensors have some peculiarities, cannot use more than one at a same time (syncing required), sensing field is conical (pretty wide) so target need to be reasonably large and reflect sound, sloped surfaces work as mirrors and deflect beam in another direction, one does not see what exactly sensor is looking at etc. Where possible (99.9% of times) lasers work better. Some low cost industrial distance sensor is for example O1D100 (should be 2-3 times cheaper than ultrasonic).  
  2. Hi Friend,

    Do you haveany idea of how to create queue in mitsubishi PLC?




    yep... we all have been there... anyway, this is not plug and play... what commissioning steps have been completed? message suggests to check mains power. what messages servo drive reports? is everything connected correctly (motor, encoder, over-travel switches,...) and configured (motor type, gear ratio etc.)?  

    in just 15min you created four identical topics. stop spamming or you will be banned... give chance to someone to respond.
  5. to do positioning you need a servo. in recent years some VFD drives (but not all) also support this functionality. to do any kind of precision you need tight loop. normally that loop is part of the drive or motion controller. You can of course use PLC  code for this but the fact remains that this is not a fast loop resulting in loss of performance (either speed or accuracy or both). using only contactors to control motor in an attempt to control position is exercise in futility. another issue is braking (slowing down). if you need an example, use any cheap motor (ceiling fan, drill gun etc) and try to operate it manually using switch and - stop at specific position. it just wont work... if you have VFD, you can control velocity (and deceleration!!!). this allows you to slow down axis before reaching stop position. with clever code and calculating deceleration ramps etc this can get you potentially close to what you expect. theoretically the only compromise would be speed. the other issue is that induction motors are designed to operate at specific speed (within some tolerances).  
  6. Bit Shift GX Works2 shifting 2 bits simultaneously

    Can you please elaborate on this.. 
  7. Trouble Wiring a Simple LED with a Micro820 Controller

    LEDs are polarized devices like all diodes. When forward biased voltage drop is usually 2-3V and current is usually 5-20mA. To operate on higher DC voltage al you need is series resistor but 10K will be too high value (LED will likely show some output but very dim).  If we assume 15mA (0.015A) and 3V for LED, then resistor will be 21V/0.015A = 1400 Ohm. Nearest common value is 1.5k and it should be rated for 0.5W    But keep in mind that reverse biased LED will not survive if it is connected to voltage that exceeds some 6-7V.  common solution is to either make sure this will never happen or protect LED somehow. simplest solution is to wire another diode anti-parallel to LED. another option is to use bridge so polarity will not matter.  
  8. Binary string to int conversion

    i agree, using string to represent numeric values is less than ideal. but if that's what you have, use a loop and go through each string character, something like this (sample pseudo code): INT N, I N:=0 FOR I:=1 to stringData.LEN   N:=N+N   if stringData[I]=='1' then       N:=N+1   endif NEXT  
  9. Binary string to int conversion

    and post your code
  10. PE Exam

    Ever hired or relied on services of others? contractor, doctor, anyone?  Is there any value in confirming that they are capable of doing their job?   
  11. New laptop, comms errors

    you put HDD into another laptop? are you sure they are identical machines? do you have drivers for all hardware (such as network port)? did you try to connect to anything else and at least try PING? also check network settings on both nodes, communication between two devices is possible if both are on a same subnet
  12. Float substraction?

    Computer representation of numbers in different formats is a really interesting topic. Key is to use correct format... Note, REAL is encoded data format. If you are interested in making each and every digit count.... do not use REAL data type! This is why servo controllers count pulses. You only see distances in REAL format as a secondary result. Many things about REAL look nice and easy at first but there are pitfalls. For example: - comparing floating points directly for equality is generally a bad idea (even if some systems may have some sort of a workaround in place) - adding or subtracting floating point values that greatly differ in size is a bad idea. one can check it by making loop and adding very small value to a real number. eventually it will stop increasing, usually long before reaching maximum value that REAL can hold. - etc.   I see cases all the time when programmers favor REAL in calculations thinking they get "better resolution" because software they look at generates bunch of meaningless digits. They don't realize that 32-bit is 32-bit. both 32-bit INT and 32-bit REAL can represent same number of different states.... they are just distributed differently. in case of integers, distribution is uniform. in case of REAL it is not. you get really small increments when values are close to zero. but you get really huge increments when values are big. in fact REALs have a problem with significant figures because they only use 23-bit for this. There is no magic or "free lunch". 32 bits are divided into groups:          1 bit is sign          8 bits are exponent          23 bits are significant those 23 bits are determining how many significant figures in your number are correct. 23 bits in binary comes up to some 6, in best case 7 significant figures in decimal. Anything after that is garbage.... there is no point in using so many decimal places in your examples when system that is used to do calculation can at best do 6-7 significant figures.   Back to your question:  IF result<=Param then .... IF 0.05000305 <= 0.05000000 this is a problem?   I would not even consider it....    note: Value 0.05000000 is a result of subtraction from "70.000000". i would not count on more than 6 significant figures. this means 70.000000 is an exaggeration as only four decimal places are useful so this should be displayed as 70.0000 instead of 70.000000. subtracted number is of same magnitude so result is going to be good only for up to those four places after decimal point. Anything beyond 0.0500 in this case is nothing but wishful thinking... values such as 0.05000305 or 0.05000000 make no sense as they are really no better than 0.0500. Sure you can get "wrong" result at the very slim margins of your range but why would you care. And if you do .... don't use REALs (floating point numbers), use integers to represent fixed point numbers.          
  13. Float substraction?

    i don't see why would one care unless this is data to be displayed on HMI. in that case HMI should have options to display specific format (number of decimal places etc.). If for some reason this is not available, don't use floating point, use fixed point format... for example multiply value by 1000 and place result into an integer variable. so value such as 79500 will really represent 79.500 (three decimal places are implied). This is something even oldest HMIs would handle.
  14. Float substraction?

    70.0 - 69.95 = 0.05  - nothing wrong with that...  0.05000305 is just closest floating point representation possible in 32-bit...   note that not all REAL numbers can be presented accurately, most are approximated. and you get "artifacts" after 6th place or so.  
  15. floating and Nonfloating I/O modules

    Floating means that output is galvanically isolated so it 'floats'. This means that it is not referenced to ground and if you measure potential difference between one of output terminals (positive or negative) and ground, just about any value is possible.    Using floating output is special case in electrical standards around the world and may need special condition in order to be deemed acceptable.  Normally this is reserved only for low power device, some instrumentation etc. and when used, double insulation is a minimum. You can see this on small consumer devices and power supplies - it is double wall rectangle.  Generally transformer and PSU outputs are required to be referenced in order to meet safety requirements and avoid harm due certain modes of failure (leakage current).