Posted 8 Feb 2016 Hi all, I would like to know instruction in Mitsubishi Q series PLC which is exactly same as ZCP instruction in Fx series Please help me out. Share this post Link to post Share on other sites
Posted 8 Feb 2016 You need to write it yourself, but that's easy... See below, just wrote it as text: IF 'value' less than 'setpoint high' AND 'value' greater than 'setpoint low' THEN output = TRUE. Share this post Link to post Share on other sites
Posted 8 Feb 2016 There is no exact equivalent to the ZCP instruction (as well as the CMP instruction) in the FX program. The best equivalent is using comparison statements. Or even a LIMIT instruction. But the LIMIT is ... er ... limited compared to the ZCP instruction. It only allows a data register to be clipped between the lower and upper values. Hope this helps. 1 person likes this Share this post Link to post Share on other sites
Posted 10 Feb 2016 Thank you. One more thing, Actually I am working on Indexing machine where I am facing scanning problem of Q series PLC. As we are taking feedback from Absolute encoder and converted in 0 to 360 degree and I have fire out some output depends on encoder current value/degree But still sometimes it missed to fire the output within its firing range (encode value ) where tolerance band is of 20 degree. ex FOR on [ >= D2040 K50 ]--------[<= D2040 K70 ]-------[SET M120] LOWER RANGE UPPER RANGE OUTPUT ex FOR off [ >= D2040 K320 ]--------[<= D2040 K340 ]-------[RST M120] LOWER RANGE UPPER RANGE OUTPUT And my encoder rotates 60 RPM gives value (-32676 to + 32676 ) converted into ( 0 to 360 ) Maximum scan time is 3ms. Please help me out. Share this post Link to post Share on other sites
Posted 10 Feb 2016 Interrupt sequence. Which software are you using for development? 1 person likes this Share this post Link to post Share on other sites
Posted 10 Feb 2016 Try setting a fixed scan with minimum interval (0.5ms). This will affect the scantime of your main program, but will decrease the scantime of your encoder program. Let us know how that works out. Share this post Link to post Share on other sites
Posted 10 Feb 2016 Thank you.. I have already tried this setting but no effect on cycle.It still missed the output. One of my friend given me reference of indexing machine program which is working at a higher speed Please take a look at it's main part. I am not able to get that program. g. Share this post Link to post Share on other sites
Posted 10 Feb 2016 But the above example doesn't look like it's comparing to any external value? Is it just indexing and comparing internal PLC values? If that's the case, then it will go faster without missing anything. However in your case, you need to make sure that the encoder input doesn't pass the span you want to detect within one PLC cycle. So how many pulses per revolution do you have, and is 60rpm still the correct number? In other words, have you calculated the number of pulses per second? And a different question: You say you use an encoder, but what kind of input card do you have on the PLC? Share this post Link to post Share on other sites
Posted 10 Feb 2016 I am using TCP/IP modbus card for encoder interface. As i told you I am getting -32k to +32 pulse in it's 1 rotation and my motor speed is 60 rpm (encoder is connected to motor *****contact less encoder ) which means I am getting -32k to +32 pulse ( 0 to 360 converted value) in 1 second . And though I am having 3 ms scan it miss the output. and about above example they have entered compared value in register D201(on value) D301(off value) and onwards till D299 and D399.(for loop and indexing register they have used) those value hey have entered from HMI . Share this post Link to post Share on other sites
Posted 11 Feb 2016 Well, a total of 64000 pulses per second equals about 64 pulses per ms. In other words you'll need a span of minimum about 260 pulses to ensure that you pick up the pulse (this is if the encoder was directly attached to the PLC). When you in addition takes into account that you have communication with the encoder which can cause delays I think you'll need a greater span. The FOR-NEXT loop in the other example is easy since it compares already entered values inside the PLC. This is like comparing numbers that you already know in your head (like your friends example), and numbers received via postal service: You cannot compare any number before it has arrived in the mail, and that's exactly your problem here. You simply have too many pulses per revolution, and further too many rotations per minute. Share this post Link to post Share on other sites
Posted 11 Feb 2016 By the way: What kind of application is this? A motor running or something else? Please explain in detail what you are using and what for. Share this post Link to post Share on other sites
Posted 12 Feb 2016 this is a indexing machine of total 8 station and we are picking up component from Station 1 and attaching other component on other 5th station. Giving out output at 7th station. Share this post Link to post Share on other sites
Posted 12 Feb 2016 ex FOR on [ >= D2040 K50 ]--------[<= D2040 K70 ]-------[SET M120] LOWER RANGE UPPER RANGE OUTPUT ex FOR off [ >= D2040 K320 ]--------[<= D2040 K340 ]-------[RST M120] LOWER RANGE UPPER RANGE OUTPUT for above example how can I use FOR-NEXT loop ? Share this post Link to post Share on other sites
Posted 13 Feb 2016 What are you picking up from the range detection? Position of the rotating board? The reason I'm asking is I'm wondering what you need the FOR-NEXT loop for... Are you going to stop the board within a certain range/span? And does the board rotate via a servo? If not, maybe it should? I mean, you have quite a lot of pulses per second, and a pretty small span for detection... Unless I've misunderstood the application... It's a bit hard to understand what you intend to do here, what you have done so far and what result you want from it. As mentioned; what are you detecting inside the span area? Share this post Link to post Share on other sites
Posted 15 Feb 2016 Well I am running my indexer via VFD. As that indexer is Dwell mechanics means when my Motor shaft rotates 0 to 360 fully, at that time my indexer is shifted by 1 step(0 to 90 ) means is moves only 25% of the 360. And for loop I am asking for to have multiple numbers of Values means ex, On at 200 degree and off at 300 degree and this will provide me actual degree position and also it don't miss the output. Share this post Link to post Share on other sites
Posted 16 Feb 2016 (edited) It's one of the problems that I keep running into as I change out old "standalone" FX series PLCs to run on the larger Q series PLCs that are linked to SCADA systems and have more access to what's going on elsewhere in the plant. I tend to look at FX PLCs and thinks "old - needs replacing", but in reality, the high speed inputs that exist on them are incredibly useful and expensive to replicate on the Q series, with high speed counter cards costing a considerable amount of money. There are also other functions in the FX PLCs that are designed to take high speed inputs from rotary encoders and turn them into "virtual" cams with numerous lobes and variable dwell angles. It's no wonder that whenever you open the panel door on a rotary filling machine, there's normally an FX staring back at you :) I must admit that I've looked at interrupt routines several times in the past, but have always chickened out and bought a high speed counter card whenever the problem has arisen. PS. In the past, I've even used small FX PLCs to count high speed inputs and hard wired an output signal to the larger PLC as a cost effective means of overcoming this problem. Edited 16 Feb 2016 by Colin Carpenter Other information Share this post Link to post Share on other sites
Posted 16 Feb 2016 You can consider L Series as a replacement, since it has high speed pulse inputs and outputs built in like the FX models do. Share this post Link to post Share on other sites
Posted 17 Feb 2016 I looked up the FX command that is used to read from a high speed encoder to give a number of outputs with varying dwell agles etc and the command is ABSD (Absolute Drum). Incredibly powerful and looks exactly right for what the OP is trying to do ..... however not sure if the command exists in other PLCs outside the FX range. ABSD can only be used once in the code and is tied in with interrupt commans in the PLC. Share this post Link to post Share on other sites
Posted 18 Feb 2016 @Crossbow and @Colin Carpenter: OP hasn't connected the encoder directly to the PLC (he has it via a ModbusTCP interface in both ends), hence your suggestions will have no effect on OP's application. As mentioned earlier several times: Given your number of PPR and frequency (if correct). Are you 100% sure that the number of pulses you have, and the frequency of rotation is correct? I calculated, with your information, 64 pulses per millisecond and a stop-span of 20 pulses, is this the same result as you have come up with? If my calculations are correct (you should calculate and see if you come up with the same result) 1. ModbusTCP will work. You'll need your encoder attached directly to the PLC (no matter if you have FX/L/Q). Really; how much time do you think it takes to transfer the telegrams from the encoder->ModbusIFC->QJ71E71-100->CPU? 2. As I mentioned earlier too, your scan time in the PLC won't detect your small span (no matter if you have FX/L/Q or for that sake a standard microcontroller/computer) And just to point out: Your friend's FOR-NEXT loop has nothing to do with your problem. A FOR-NEXT loop is an internal loop sequence in the PLC and has nothing to do with external devices like you have. Again, if my calculations of pulses per second is correct you will need a servo drive and servo controller so that the servo controller can internally stop the motor when you set the pulse-stop position of the servo drive. Share this post Link to post Share on other sites
Posted 18 Feb 2016 Yes, I realise what he's got, but also realise that the thread title refers to a converting from an FX to a Q, and he also says: "Actually I am working on Indexing machine where I am facing scanning problem of Q series PLC. As we are taking feedback from Absolute encoder and converted in 0 to 360 degree and I have fire out some output depends on encoder current value/degree " ... I was just trying to point out that the high speed inputs of the FX and ABSD command are designed to do exactly what he is trying to do, without facing scan time problems. Share this post Link to post Share on other sites
Posted 19 Feb 2016 Ahhh, I see. Sorry, my mistake and yes I agree with you. Share this post Link to post Share on other sites
Posted 7 Mar 2016 Thank you guys for your reply and actually I have solved this problem using FOR next loop as it is working very precisely without missing any value. Share this post Link to post Share on other sites
Posted 7 Mar 2016 where my highest value is 360 and lowest value is 0 degree and and I am getting output on only my value is in between defined range Ex. D3204 = 240 and D3304 = 320 so for encoder value D2040 if it is in between 240 t0 320 it will move value '1' in register D3404. else 0. Share this post Link to post Share on other sites