Riggs

MrPLC Member
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Riggs

  • Rank
    Sparky

Contact Methods

  • Website URL http://www.msubs.com
  • ICQ 0

Profile Information

  • Gender Male
  • Location Devon, UK
  • Country United Kingdom
  • Interests Omron CJ1 PLCs

Recent Profile Visitors

1801 profile views
  1. Omron CJ2 serial TXD CRLF problem

    Problem has gone away now (with a bit of help from Omron support) but didn't fiind out what was causing it in the first place. Thanks for reply. James.
  2. Hello, I'm using an Omron CJ2 to communicate with some equipment via the CPUs built in serial port. I've got the TXD instruction working, however my transmitted data frame always has 0D0A (=CRLF) appended to it by the CPU. This is with serial port mode = 'RS-232C', Start Code = 'disabled' and End Code = 'Set End Code' in the PLC settings. If I set End Code = 'ODOA', my output string ends up with '0D0D0A0A0D0A' appended to it. This makes no sense at all to me. Am I missiing something obvious in the manual? Thanks for any help, James.
  3. Hello Mr. PLC-ers, I need a bit of technical help with the PID instruction on an Omron CJ1, which I'm using to control the heading of an underwater vehicle. Currently I'm only using Proportional and Integral action, however I think the system may benefit from a little Differential action as well. I have my PID sampling rate higher than the measured variable update rate (to allow for increases in measured variable data rate without the need to modify the PID parameters), which should (if I'm not mistaken) have no detrimental effect on the calulation of the P and I terms, but could mess up the calculation of the D term, depending on how it is filtered within the instruction. My question is: How is the D calculated within the CJ1 PID instruction, and how is it affected by the PID instructions' input filter? Does anybody know the characteristics of the input filter? Do I need to implement some kind of interpolation function on the input to avoid step changes messing up the D calculation, or is this already handled within the instruction? The description of the PID instruction in the programming manual does not give enough information to answer these questions, so any help would be much appreciated. Cheers, James.
  4. Cheers Lostcontrol, Your 'Add 0.5 then FIX' hadn't clicked...brilliant, I'll do that. Thanks! James.
  5. Cheers Lostcontrol, I'm using the FIX instruction elsewhere in the program. Trouble is, it only returns the integer part and throws the rest away, as you say. So I need a way of finding out if the bit beyond the decimal point is greater or less than 0.5, in order to decide whether to round up or down. The only way I've come up with so far is to FIX the real number into an int, then FLT it back into a real and subtract this from the original number, then use a comparison instruction to see if what is left is bigger than 0.5 or not. If so then add 1. All seems a bit long winded, but maybe there isn't a better way? James.
  6. Omron CJ1 Is there an easy way to do this? I've been through the instructions with a fine toothed comb and I've not come up with a simple solution... James.
  7. Switch Debouncing

    Hi, Thanks for replies (in answer to 'pfort': whan a mechanical switch, eg. a push button, is pressed, the contacts will close and open a few times very fast as they bounce off each other before settling into the closed position. This can cause multiple edge detection when you are only interested in the first edge). I don't think my hardware can be set up to avoid this, however dwestes' suggestion of a software timer will do the job easily, thanks! James.
  8. Switch Debouncing

    Hi again, Omron CJ1 with ID201 input module: Before I embark on writing some code for debouncing input switch contacts, is there a standard way of accomplishing this? I've not yet found an appropriate instruction or function block. Cheers, James.
  9. Real MOV in CJ1

    Aha, thanks for that dweste, I hadn't spotted the FLT instruction. And yes, I do mean 32767. Banker, I realise that this has been covered over and over again in the forums, but I was under the impression that if you MOV a 16 bit integer into a 32 bit real, then the PLC will interpret the real number incorrectly? I've rejigged the program now to use FIX, and if the FIX turns the error flag on, I then do the comparisons and use FIX to load the 32767's into the x_INT register. Thanks for your excellent replies, James.
  10. Real MOV in CJ1

    Hello All, I've got a real number (x_REAL) which I want to fix into an INT (x_INT). If the value of x_REAL is above 32768 or below -32767 I want to limit it to those values. I am trying to do this with a couple of compare instructions followed by MOVF instructions: >=F x_REAL +32768 which turns on a MOVF +32768 x_REAL instruction and <=F x_REAL -32767 which turns on a MOVF -32768 x_REAL instruction Then a FIX x_REAL x_INT instruction. BUT: the CJ1 dosen't support MOVF, and I cant see another way to assign a value to a real on a CJ1. Am I missing something really obvious here? Any help would be much appreciated! James. (P.S. I'm on a bit of a steep learning curve here, so will probably be asking a few stupid questions over the next few weeks... and I'm spending a lot of time poring over the manuals, before anyone asks!)