Pluk

Conversion CQM1H -> CJ2M

14 posts in this topic

Hi All,

I've some problems after converting a cqm1-cpu41 program to a cj2m unit. I am still trying to identify all problems :-0 but the most annoing at this moment is the following.

This cpu is connected to a proface HMI, and commands the screens that are shown,  through D1. I am keep getting screen #9 ("press reset"). if i press and hold ALARM_RESET (0.07) and the timer hits, I get the main screen that i want.But after releasing ALARM_RESET (0.07) screen #9 is back again (so that value is wriiten in D1)   This is a snippit of the converted program (exactly the same as the old program) There isn't any other code writing #9 in D1. 

The strange thing is that line 210 is doing exactly that ( IF NOT ALARM_RESET (0.07) -> MOv #9 to D1 ) what is see, but how in earth did this work in the old CQM1 unit ? I suspect something with cycle time ? Maybe in the old unit line 217 was executed later and #A was written in D1 'over' the #9.

Anyone has some thoughts on this ?

Thanks in advance 

Jeroen

 

screentrigger.PNG

Share this post


Link to post
Share on other sites

Hi Jeroen,

Is it possible that the Mov(021) #9 D1 was actually @Mov(021) #9 D1? 
The difference is the differentiate up which means a one-shot on the move.

Just a thought.
Regards,
Garry

Share this post


Link to post
Share on other sites

Hi Garry,

Thx for your answer, 

I've checked it in the pre-converted program and it is the same instruction Mov(021), so that didn't changed..

Regards,

Jeroen

Share this post


Link to post
Share on other sites

Are you sure the ALARM_R... is ALARM_RESET Push Button (physical input number 0.7)?

It would only makes sense to me if ALARM_R... were maybe a Ready Signal from an external device.

Share this post


Link to post
Share on other sites

Hi all,

I've filled in some symbols and made a screenshot of the print version, so its clearer to see. And done some more thinking. I think the original design is to overwrite D1 (screen selection of HMI) after the timer (T1098) is hit. But now it is an endless loop as long I.0.07 is NOT pressed.

  1. line 9: if NOT 0.07 ->  writes #9 in D1
  2. line 10: if NOT 0.07 -> sets (and keeps) 65.00 On (this should be resetted by timer 0198 hit 0)
  3. line 11: if 62.00 then run timer
  4. line 12: if timer 0198 hits -> writes #A in D1 (if H11.02 is 1 this is language selector)

If i put a differential monitor in T0198, I get a count every 1,5 sec, so the timer fires off but immediately start counting down again. That makes sense since 62.00 is still 1 because  I0:07 is still NOT 1

Because of the fact that this program worked on a CQM1-CPU41 it must have something to do with changed functions i.m.o.

  • KEEP(011) did the priority changed maybe ?
  • TIM is there changed anything in the internals there ?
  • Is the cycle time that much higher that some unwanted effect is bugging the code ?

Anyone encoutered something similiar before with such a conversion ?

Thanks in advance,

Jeroen

message_reset.JPG

Share this post


Link to post
Share on other sites

OK, i solved the puzzle :stupid:

Today I went to the factory where the old setup (machine  & PLC) are still in function.  I logged in into the old plc and start monitoring above ladder. To my surprise i saw that 0.07 was ON in the normal state. So i checked the switch and it is a NC switch. While I was testing with a NO switch .....

Everything works now!!

For the record:

If your doing this conversion and the program uses a high-speed counter input for an encode with a Z pulse,  make sure you:

  • choose linear encoder type
  • change 252.00 to A531.00 (the bit you have to set HI to enable reset the counter)
  • the result datatype of PRV881 is changed from BCD to BIN, so you probably have to convert the value with BCD(024) to work with your old program

Share this post


Link to post
Share on other sites

Hi all,

This project is nearly finished now, but i have a little doubt about the following.
 

Some timers in the old program (TIM) getting their set value from the datamemory (D).

All the timers are TIM (BCD type) but it seems to me that in the CJ2M all DM values are in HEX. To fix one problem i've changed the TIM instruction to a TIMX(550) timer (BIN) and that gave the results i was looking for. So the doubt I have now, should i change all the timers with a set value form the DM to TIMX(550). And if so , why isn't any notice of that in the migration guide ? Or (Likely) am I thinking the wrong way :)

 

Thanks in advance

 

Share this post


Link to post
Share on other sites

The CJ PLCs are capable of both BCD or Decimal. The TIM instruction requires a preceding "#" for HEX (witch will display BCD). The TIMX instruction requires a preceding "&" for Decimal.

2 hours ago, Pluk said:

CJ2M all DM values are in HEX

Well, this is true but... HEX shows you the physical state of the memory. (Which bits are ON and which bits are OFF). The memory Data Type will be interpreted by the Instruction specifications.

Share this post


Link to post
Share on other sites
2 hours ago, Pluk said:

Some timers in the old program (TIM) getting their set value from the datamemory (D).

Are these values set from the HMI? This should not have changed unless it was changed in the HMI.

Share this post


Link to post
Share on other sites

Yes the are set through the HMI, but not by direct input. There are 2 buttons + and - 

And they add data to a word at a dm, the constant = 1 and datatype = bin. See attached image.. 

 

Maybe the datatype should be bcd there? 

15873916815422447497771478049027.jpg

Share this post


Link to post
Share on other sites

Sorry I'm not writing the whole story in right oder.

  1. old situation:  cqm1-cpu43  <-> proface gp270
  2. new situation: cj2m-cpu12 <-> proface gp4301tad ( omron program converted bij software, HMI software changed to corrensponding new mem layout (dm -> d, etc)
  3. screen for setting a counter reads D00032, 2 buttons + and ->  adding or subtracting one per push

At that moment if I pushed + or - nothing changed, I went  into the program and I find a ladder that converted (BCD->BIN) d32 -> d35. D35 is the set value for a reverisible counter (CNTR) (BCD type) that should count from set value to 0. 

4. I replaced the BCD->BIN far a plain MOV. That fixed the + and -. 

So i've tested that today and its worked unitl setting a value higher then 8, then the CNTR would not count anymore (because of they HEX input ofcourse)

5. Replaced CNTR for a HEX variant CNTRX (with set value D35)

That fixed the counting above 8

At that point I had to change a timer, but i did that from Memory view in CX-programmer so i inputted a hex value there. Then I realised, should that timer be an TIMX instead of a TIMH ? And that broought me to my question.

 

But if i understand your comments right, both timers/counters can work with hex/bcd set values depening how they are entered. But now I realise, hat maybe, in the conversion of the screen program, some settings are changed, and that in above screenshot, the datatype should be BCD instead of bin ?

 

Share this post


Link to post
Share on other sites

BIN = HEX (the way you are using it) = Unsigned integer (when working with timers and counters).  It is all about how you use the HEX data.  #F = 15 as an Unsigned integer for instance.  When you put 15 in on the HMI, you will see F if you monitor in HEX and 15 if you monitor as an Integer (signed or unsigned).  Since the X version of the timers and counters are binary (integer) timers and counters and you are inputting an integer with your HMI, use the X versions.  More specifically, use TIMHX to replace TIMH.  

Share this post


Link to post
Share on other sites
1 hour ago, Pluk said:

But if i understand your comments right, both timers/counters can work with hex/bcd set values depening how they are entered. But now I realise, hat maybe, in the conversion of the screen program, some settings are changed, and that in above screenshot, the datatype should be BCD instead of bin ?

You understand correctly. In my opinion, I would make them all BIN (Unsigned Integer). Add an "X" to all timer and counters and make all HMI inputs "Bin". I think it's easier on the brain. Also take note of Michael's comment about the TIMH (TIMHX). It is a different resolution than the TIM (TIMX).

If you do change all to Bin, then it makes more sense to change all of the hard coded values to "&xxxx". Not sure if you found it but you can monitor in Decimal as well.

Mr_PLC_Monitor.JPG.67aa1d3864b470b9f8008

Share this post


Link to post
Share on other sites

Hi all,

Thanks for the clarification! I I agree with you both, especially on

 would make them all BIN (Unsigned Integer). Add an "X" to all timer and counters and make all HMI inputs "Bin". I think it's easier on the brain. 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now