You are here

QJ is the Decision Maker in Q Programmer

by Bob Loyzim


Q Programmer is a very versatile programming platform where motion is involved. Incremental positioning, absolute positioning, encoder following, pulse and direction, analog velocity, multi-segment moves and torque control are some of these motion modes. However, machines are becoming more sophisticated, and often require the motion controller to have PLC logic capabilities as well as motion capability.

Our QJ command is the bridge between the logic capabilities and the motion capabilities of stepper and servo drives that use Q programmer. Using QJ in a Q program allows for decisions about the state of the digital input(s), the voltage level of the analog input(s), the value in a variable register, the value in a read-only register, etc. Complex decision trees can be programmed, and the priority of the decisions is simply determined by the order in which they appear in the Q program.

Here’s a list of the decision choices:

EXAMPLE: Two digital inputs X3 and X4 are programmed to select how far the motor should rotate. X3 will cause an incremental move of 28000 counts and is the higher priority. X4 will cause an incremental move of 17000 counts.

Here’s a flow diagram of the requirements:

Here’s the Q program for a ST-Q drive:


What if several inputs must be in specific states to trigger motion? No problem for Q Programmer. You simply use the small “i” register with the “bit-wise” AND command R&. The result is a numerical value of only the inputs of interest.. Here’s how you would look at inputs X2 and X4 simultaneously while ignoring all others. Register 7 is loaded with the value 10 ie: 8+2 and bit-wise ANDed with the small”i”.

RX    7    10

R&    i     7

And that is our Q Programmer lesson for today!

News Tags: