Gx Developer v8.07

lab

Member
Join Date
Nov 2003
Posts
48
Hi,
I'm wondering about a compare command in GX developer, if I want to use an input command ie. < C0 K5, which means that if C0 is less than 5 that output will go on, but how can I set a similar command to go on when the counter value is between a certain value, ie. C0 k1, k5, meaning if counter C0 is between these values the condition will go true?I would like to use it as an input function. My application is a rotary index head on a milling machine , the machine gives a pulse to begin sequence, and it's always the same pulse, so I'm using a counter to make various distance moves, ie. first 4 pulses head rotates 90 degrees, next pulse it rotates 45, and the next 4 it rotates 90 again and the last pulse I would like it go to zero degrees, 315 degrees. I have no sensor to determine the home postion so it will be done with moves and pulses only.The program I have so far works fine until the last move were 2 conditions become true at the same time, the counter hits it's value (10) and then it is reset and instead of it making a 315 degree move it makes the first of the 90 degree move because the counter value is less than 5.
Thanxs
Best Regards
Lab
 
You cant do it as an input command but you can make certain M bits work like it

The instruction you need is 'Zone compare' ZCP

---[ZCP C0 K1 K5 M10]

Less than 1 = M10 on
equal to 1 to 5 = M11 on
greater than 5 = M12 on

Be careful when using this instruction as all three M bits are used even if you dont use the results. Make sure the unused bits are not used elsewhere in the program
 
I don't see why you can't AND 2 compares to create a range... :confused:

--[> C0 K1 ]----[< C0 K5 ]------------( )


Output is ON when C0 is between 1 and 5 (not including 1 and 5).

beerchug

-Eric
 
Of course you can do it that way Eric and it is far more elegant.
As long as you only need to know when the value is in the 'zone' :)
(no indication of higher or lower)

Also, no mention of which CPU was made and not all allow in-line compares. đź“š
 

Similar Topics

I'm trying to verify a project with a PLC. The Transfer Setup menu item is grayed out and every time I click Verify with PLC, I get an error...
Replies
1
Views
40
Well, I've decided to start a new project, and like all projects, it has already gone horribly wrong. I purchased a PLC device (supposedly a...
Replies
2
Views
111
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
310
I'm trying to manually convert a Beijer E200 HMI project onto to a new Mitsubishi GOT gs2107-wtbd. The PLC is a very old A-series AS1CPU and is...
Replies
1
Views
381
Hi One of the PLC's that I maintain/update is a Mitsubishi Q-Series, probably installed about 10 years ago. At the moment, ALL the wires from...
Replies
13
Views
1,170
Back
Top Bottom