wakeup Posted June 16, 2015 Report Posted June 16, 2015 I have defined a variable "xx" as a Counter, and in ST language this code: CNTX(P_1min, condition, xx , 10); It runs sucessfully in a CJ2M CPU35, but if I do the same in a CJ1M CPU12, I get this error: That error is only shown if I have that instruction in ST languaje. Why is different in both PLCs? If I can't use a Counter variable in ST, how can I set the counter number in the CNTX function? I have tried CNTX(P_1min, condition, "C1", 10); CNTX(P_1min, condition, 'C1', 10);CNTX(P_1min, condition, 1, 10);CNTX(P_1min, condition, C', 10);but nothing runs. Thanks in advance Quote
Mendon Systems Posted June 16, 2015 Report Posted June 16, 2015 The "timer" and "counter" data types only exist in the CJ2 although CX-P will default to them in other PLCs. You need to change the data type to "number". Quote
wakeup Posted June 16, 2015 Author Report Posted June 16, 2015 (edited) Hi, I have just tried to define "xx" variable as number, I put 1 as value because C1 is not possible with number type. And trying to compile I get this error in the CNTX line I don't understand why consider a variable of type number as literal, and if counter don't exist in CJ1M plc why says counter in the error message? Thanks a lot! Edited June 16, 2015 by wakeup Quote
Mendon Systems Posted June 16, 2015 Report Posted June 16, 2015 I'm not sure that you can use timers and counters in ST in anything but a CJ2. I recall reading somewhere that they didn't work in a CJ1. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.