Mendon Systems

MrPLC Member
  • Content count

    490
  • Joined

  • Last visited

Posts posted by Mendon Systems


  1. For that configuration the analog data will appear in CIO words 001-004 (AD041 inputs 1-4). You will need to initialize the AD041 module on startup to set the range by writing HEX data into words 101 and 102. The details of the settings are in section 7.2 of the W471 manual. To set all four AD041 inputs to 0-5vdc you would write #80FF HEX into both CIO 101 & 102 at startup (P_First_Cycle on). The analog data will magically appear in CIO words 001-004 with a range of 0-6000 corresponding to 0-5vdc.


  2. 2 hours ago, Jay Anthony said:

    Go back and consider using STR8 and ignore the data type warnings.

    Jay,

    I'm inclined to agree with you after reading his last post. All he would need to do is convert his INT to BCD and then convert it to ASCII with the STR8. Since he's apparently looking for a fixed length string of 5 digits a MID$ instruction would get rid of the leading zeroes for him.


  3. There are a few things that are a bit difficult with Omron, and you happened to pick a great example of that. For almost everything else they are quite easy to work with.

    Consider those data type warnings to be just advisory. It is possible to write a program that does not include any warnings, but generally not worth the effort.


  4. There IS another way to do it, but it is cumbersome at best.

    1. Convert the decimal value to floating point with the FLT instruction.
    2. Add 0.5 with the +F instruction.
    3. Convert the floating point number to a string with the FSTR instruction.

    The reason for adding 0.5 is that the FSTR instruction will truncate rather than round up so 0.9999 will result in 0 rather than 1. You will need to set the FSTR control words to 0 (decimal format), 5 (total # of digits), and 0 (# of decimal digits).


  5. 1 hour ago, Campbell2112 said:

    I use this same cable to connect the same way with the company's computer could it be my driver ?

    That is possible I suppose. You could try updating your driver to see if that helps. Some of the USB/serial adapters will work with one computer or PLC and not work with another one. What type of adapter is it???

    1 person likes this

  6. From a functional standpoint the only difference in those 3 is that the W memory area data is cleared during a restart and there are some restrictions on accessing D memory at the bit level depending on what CPU you have. In theory the W area should be used as Work (scratchpad) memory, the D area should be used for Data storage, and the H area should be used for Holding bit storage. In practice you can use them however you want in your program.

    2 people like this

  7. I agree with Bob. That description sounds like a timer that is being used to generate some sort of clock pulse. The timer contact will be true for one program cycle whenever the timer expires. For example: if that timer is set to 5 seconds then the timer contact will be true for one scan every 5 seconds. There will be at least one more contact of that timer used somewhere else in the program as a clock pulse, probably to start (or stop) some logic sequence.


  8. Not entirely sure what you are asking but ......

    You can use any contact format of a timer that you want (NO or NC, and differentiated ON or OFF). The contact identification for timer #10 would be T0010. The mnemonic would be LD T0010 for a NO contact.

    If you are defining a symbol for a timer be sure to define it as a BOOL not a TIMER. The TIMER object type only applies to the CJ2M, but CX-P will default to TIMER for other CPU types also.


  9. You can use the P_First_Cycle flag to turn the bits off directly as Bob suggested.

    You can also use the TKON(820) & TKOF(821) instructions to turn on and off an entire task at any time you want. I often create an initialize task that runs once at startup and turns itself off with the TKOF instruction when complete. This works best if you assign the startup task as cyclic task 00 with Operation Start checked (default) and include a TKOF instruction as the last rung of the task immediately before the END(001) instruction.


  10. That doesn't sound too difficult, but the logic for Up versus Down may take some thought. You can run a timer (maybe 1 second) from the button input then energize the Up or Down output when the timer expires. The trick is to decide which one you want to energize.


  11. As far as I know the only way to check the IP address is from the "Settings/Built-in Ethernet" page in CX-Programmer.

    A MOVR instruction converts a data address to a PLC memory address in an IR or DR register, but there doesn't seem to be any way to reverse that instruction. MAYBE??? you could use a MOV instruction to load &173 into an IR and get there somehow????