I'm automating a parallel lathe with a 9-speed gearbox selected manually using two levers, each with 3 positions: lever 1 has positions A, B, and C, and lever 2 has positions D, E, and F. The possible combinations are as follows: Direction changes are achieved by activating two electromagnetic clutches.This gives me the following truth table: I'm using the gearchange component for up to 32 speeds created by Andy Pugh, which can be used in this case. The first problem I encountered was creating the logic to detect these combinations, as I needed to detect the positions of the 6 switches I'm going to install to control the lever positions. Of the 6 bits, two will always be true. The component I found and was able to use was LUT5, but the problem is that it's only valid for 5 bits, and there are 3 combinations where bit 5 is one. Therefore, for these 3 combinations, in addition to LUT5, I had to use an additional AND2 gate to detect them.I read on the forum that for some automatic gear shifters, like the Maho MH400E, they created a component with an array that detects each gear by the switch positions.I also used the generic mux component to identify which gear was selected using a number between 1 and 9. Since it's 9 bits, it gave me a combination of 512, of which I only used 9 so that the mux output was a number between 1 and 9.I don't know if there's another way to detect the switch combination for the two levers.I've attached my HAL file to detect each lever position so I can send the correct speed to the VFD.