Candela Technologies Logo
Network Testing and Emulation Solutions

Control a Chamber with the lf_chamber.pl Script

Goal: Monitor and manipulate a CT480a chamber

The CT840a chamber with rotating platform contains an embedded controller that is operated by the modbus protocol. For manual control of the turntable, the LANforge GUI may be used. For automation, you will want to use the lf_chamber.pl script.The lf_chamber.pl script allows you to monitor the door sensor, table angle, light state and fan state. It also provides control over lights, fans, and table position. This script requires a LANforge server version 5.4.1 or higher to communicate with the chamber. A CT521a or a virtual machine instance is adequate for the task. These instructions apply to the CT840a chamber.
 
  1. Configuring the CT840a

    1. The CT840a requires a network connection. Plug an Ethernet cable into the Control LAN port at the bottom rear of the chamber.
      Depending on the date manufacture, these ports might be labeled differently. screenshot
      1. The chamber controller and lights are powered via AC cords at the outside bottom rear of the CT840a chamber.
      2. The Chamber Power or DC port is for 12v or other power required by devices inside the chamber. This runs below the turntable.
      3. The Turnable Power or Plate DC port is for a 12v or other power required by the DUT on the turntable. This is run up to the top of the turntable.
      4. Accessories or DUTs can be cabled to the Device USB port, or USB port.
      5. The USB camera has a dedicated USB port, Camera USB or Camera USB port.
      6. Below the turntable is an Ethernet jack for the DUT to use. That comes out at the Turnable Eth or Plate LAN port. It should be run up to the top of the turntable with the 12v power cord.
      7. The chamber controller is accessed on the network via the Chamber Eth or Control LAN port.
    2. Use the front touch screen to set an IP address screenshot
    3. Make sure you can ping the chamber from your laptop and/or the machine running LANforge server. The LANforge server will communicate over the network to the Chamber Eth port.
    4. The rear ports are all accessory ports for the chamber. screenshot
      1. 120v AC cord for internal power strip. screenshot
        1. This power plug provides power to the chamber modbus controller and the chamber lights.
        2. The turn table power cord plugs into the power strip.
      2. Pass-through DC barrel connectors. Use these for 12v (or other) power needed by devices in the chamber.
      3. SMA connectors. Seal these with terminators when not in use.
      4. Ethernet ports
      5. USB 3-A and USB C port
      6. Type F Coax port. Seal this with terminators when not in use.
      7. Fiber-optic pass-through. Seal this with screw-caps when not in use.
      8. HDMI ports
  2. Configuring the Chamber in LANforge

    1. In the Chamber View window, right-click on the main window and select New Chamber screenshot
    2. You will see the Create/Modify Chamber window. screenshot
    3. Select the chamber and turntable type: screenshot
      1. For Chamber Type, select 2D Large
      2. For Turntable Type, select CT840A
      3. For Turntable, put in the IP address of the chamber screenshot
      4. Select your LANforge server resource that manages the turntable screenshot
      5. Click OK
    4. You will see a new chamber, C0 in the Chamber View window. screenshot
    5. In the Chamber View window, right-click on the chamber C0 and select Modify
    6. Use the Speed and Position fields to adjust the turntable. screenshot
    7. Click Apply to send the configuration.
  3. Scripting Chamber Operations

    1. Connect to your LANforge system and open a terminal. An ssh connection is adequate.
    2. Become root:
        $ sudo -s
    3. The lf_chamber.pl script lives in /home/lanforge
        # cd /home/lanforge
    4. To use the script, you must setup your environment variables located in /home/lanforge/lanforge.profile:
        # source ./lanforge.profile
  4. Now you may operate the script. Just using the script provides you a summary of options:
    # ./lf_chamber.pl
    Usage:
    ./lf_chamber.pl --angle 45 --speed 3 --targ 192.168.100.122
    ./lf_chamber.pl --adjust 5 --targ 192.168.100.122
    ./lf_chamber.pl --fan 1 --targ 192.168.100.122
    ./lf_chamber.pl --lights 1 --targ 192.168.100.122
    ./lf_chamber.pl --status 1 [ --id foo --mgt_pipe /foo/bar ] --targ 192.168.100.122
  5. The following examples are going to use the example IP 10.0.0.9 for the chamber location on the network.
  6. Chamber Status

    1. Use the command ./lf_chamber.pl --targ 10.0.0.9 --status 1
      Current-Angle: 3598 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 0 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 449
    2. If you see a lot more output, debugging has been enabled. You will see the individual mbpoll commands: 
      Current-Angle: mbpoll -a 1 -r 4139 -t 4 10.0.0.9 -1 
          Door-Open: mbpoll -a 1 -r 2094 -t 1 10.0.0.9 -1 
          0 Table-Moving: mbpoll -a 1 -r 3046 -t 1 10.0.0.9 -1 
          0 Lights: mbpoll -a 1 -r 1283 -t 1 10.0.0.9 -1 
          0 Fan: mbpoll -a 1 -r 1284 -t 1 10.0.0.9 -1 
          0 Jog-Speed: mbpoll -a 1 -r 4507 -t 4 10.0.0.9 -1 
          3 Return-Speed: mbpoll -a 1 -r 4509 -t 4 10.0.0.9 -1 
          3 Absolute-Speed: mbpoll -a 1 -r 4511 -t 4 10.0.0.9 -1 
          3 Jog Angle: mbpoll -a 1 -r 4513 -t 4 10.0.0.9 -1 
          
    3. If a script is presently moving the table, you will see an error similar to:  
      Current-Angle: /home/lanforge/local/bin/mbpoll: Connection failed: Operation now in progress.
      COMM-FAIL
    4. If there is a LANforge service currently engaging the chamber, you might see this error because   the lanforge service polls the chamber frequently. If you want to stop the LANforge server, use the command:
      sudo service lanforge stop
  7. Controlling the Platform

    1. Use the command ./lf_chamber.pl --targ 10.0.0.9 --angle 45 --speed 3 to rotate the platform 45 degrees from zero.
    2. You will see the Current-Angle and Jog Angle reported in tenths of degrees, so 450 is 45.0 degrees.# ./lf_chamber.pl --targ 10.0.0.9 --status 1
      Current-Angle: 450 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 0 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 450
    3. Change argument --angle 45 to --adjust 5 to add five more degrees of rotation:
    4. # ./lf_chamber.pl --targ 10.0.0.9 --adjust 5
      Adjust 5
    5. # ./lf_chamber.pl --targ 10.0.0.9 --status 1
       Current-Angle: 500 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 0 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 500
    6. To return the plaform to zero rotation, use --angle 0 argument.
    7. The --speed argument modifies the rate of rotation. Speed 1 is very slow; use speed 3 to save time. Speed 6 might be too fast and your DUT might shift unexpectedly.
    8. If you see output that says mbpoll, you may ignore those lines.
  8. Controlling the Fans

    1. Use the command ./lf_chamber.pl --targ 10.0.0.9 --fan 1 to turn fan on. 
      Toggle fan  
          /home/lanforge/local/bin/mbpoll -a 1 -r 2074 -t 0 10.0.0.9 -1 0 > /dev/null  
          /home/lanforge/local/bin/mbpoll -a 1 -r 2074 -t 0 10.0.0.9 -1 1 > /dev/null 

        # ./lf_chamber.pl --targ 10.0.0.9 --status 1
      Current-Angle: 3598 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 1 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 449
    2. Change argument --fan 1 to --fan 0 to turn the fan off:
    3. # ./lf_chamber.pl --targ 10.0.0.9 --fan 0
      Toggle fan  
          /home/lanforge/local/bin/mbpoll -a 1 -r 2074 -t 0 10.0.0.9 -1 0 > /dev/null  
          /home/lanforge/local/bin/mbpoll -a 1 -r 2074 -t 0 10.0.0.9 -1 1 > /dev/null
    4. # ./lf_chamber.pl --targ 10.0.0.9 --status 1
      Current-Angle: 3598 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 0 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 449
    5. If you see output that says mbpoll, you may ignore those lines.
  9. Chamber Lights

    1. Use the command ./lf_chamber.pl --targ 10.0.0.9 --lights 1 to turn lights on.
    2. Use the command ./lf_chamber.pl --targ 10.0.0.9 --lights 0 to turn lights off.
    3. The chamber lights are useful when setting up equipment but also for   viewing the equipment with the USB camera.
  10. USB Camera

    1. The USB camera is directly controlled by the connected computer. In the video demonstrations the LANforge system has a USB A-to-USB A cable connected to the chamber to use the camera. The software to use the camera is installed on the LANforge system, it would be one of these: xawtv, cheese or camorama. There is nothing special about the camera, any laptop should be able to use it.

      For more information see USB Cable Types

    2. If you want to browse the camera from any machine on the network, the simplest way to do that is to  use vncviewer/rdesktop to browse the camera software running on the LANforge desktop.
    3. You might notice that the default frame rate of the camera takes a lot of the LANforge CPU time.   It should be possible to use v4l2-ctl to set the frame rate of the camera.
    4. Please note that recording movies using the camera can be done but they will be very large files.   We recommend doing timed frame captures every few seconds to save space.
    5. See also: Video for Linux documentation.

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog