Skip to main content

Sequence Switching Mode

CS8000 API provides two modes for switching connections: Immediate Mode and Sequence Mode. This chapter describes the Sequence Mode, which allows for precise timing of RF connections.

Sequence mode allows you to define a series of switch configurations. The CS8000 will then execute these configurations in sequence, waiting for a trigger IN signal before moving to the next step.

NOTE

When a sequence is loaded into the switch's internal memory, it will wait for a trigger IN signal before executing the very first switch configuration. It's is possible to start the sequence execution by sending a trigger IN signal from an external device, or by using the API's sendTrigger() method to simulate a trigger IN signal. Alternatively, you can configure the switch's initial state using immediate mode before starting the sequence execution.

Using Sequence Mode​

Using the sequence mode involves using the prepare() method to define a step, then calling load_step() method to store the prepared step into the switch's internal memory. This process is repeated for each step in the sequence. Once all steps are loaded, the start_sequence() method is called to begin the sequence execution.

The start_sequence() method will effectively arm the switch's TRIGGER engine. This means that prior to calling this method, any trigger signal on TRIGGER IN port will be ignored.

Calling the reset_sequence() method will disarm (disable) the trigger engine and stop any ongoing sequence execution. It will also clear all previously loaded steps from the switch's internal memory.

Tip

Before calling load_step(), it's recommended to call reset_sequence() method to clear any previously loaded steps in the switch's internal memory. This ensures that the new sequence starts fresh without any leftover configurations from previous sequences.

is called.

The example below demonstrates how to use Sequence Mode on a CS8216 device to create a sequence with three steps, and start the sequence execution looping 10 times. The three steps are as follows:

  1. Connect COMMON port 1 to channel 5, and open COMMON port 2 (disconnect, isolated).
  2. Connect COMMON port 1 to channel 5, and connect COMMON port 2 to channel 1.
  3. Connect COMMON port 1 to channel 5, and keep COMMON port 2 unchanged (connected to channel 1).
import { CS8000 } from "@ikalogic/cs8000";
const sw = new CS8000("CS8216");
sw.open(); // Open the first available device
sw.reset_sequence(); // Clear any previously loaded steps
sw.prepare(1, 5); // Prepare to connect COMMON port 1 to channel 5
sw.prepare(2, 0); // Prepare to open COMMON port 2 (disconnect, isolated)
sw.load_step(); // Load the prepared step into the switch's internal memory
sw.prepare(1, 5); // Prepare to connect COMMON port 1 to channel 5
sw.prepare(2, 1); // Prepare to connect COMMON port 2 to channel 1
sw.load_step(); // Load the prepared step into the switch's internal memory
sw.prepare(1, 5); // Prepare to connect COMMON port 1 to channel 5
// Keep COMMON port 2 unchanged (connected to channel 1)
sw.load_step(); // Load the prepared step into the switch's internal memory
sw.start_sequence(10); // Start the sequence execution, looping 10 times
Note

If you wish to loop the sequence indefinitely, you can pass 0 as parameter to the start_sequence() method. If you wish the sequence to run only once, pass 1 as parameter, or keep it empty (default value is 1).

Caution

As you can see in the example above, if load_step() is called without calling prepare() first, the last prepared step will be loaded again into the switch's internal memory. This may be wanted if you only wish to change the connection of one of the COMMON ports while keeping the other unchanged. However, if this is not the intended behavior, make sure to always call prepare() for both COMMON ports before calling load_step().