8. Operation: Computer Programming¶
Every MagnaLOAD DC Electronic Load has the following communication connections available:
|LXI TCP/IP Ethernet||Rear||JR6||Optional||2|
All of the communication connections share the same internal communications bus; only one communication interface can be used at a time. The front panel menu display will always show what communication interface is active. The MagnaLOAD
The front panel USB takes the highest computer interface priority. Whenever the front panel USB connection is made, When a front or rear USB connection is physically made while the product’s control power is on, the MagnaLOAD will automatically switch to computer control from the newly connected USB port. Conversely, when a command is sent via the optional LXI TCP/IP Ethernet or IEEE-488 GPIB interface, the MagnaLOAD will automatically switch to computer control from the Ethernet or GPIB port with the new communication. Switching back to USB requires disconnecting and reconnecting the USB plug or power cycling the MagnaLOAD. RS485 is the lowest priority interface and only has control when the USB ports are disconnected and the there is no communication over LXI TCP/IP Ethernet or IEEE-488 GPIB interfaces.
8.1. Validating Computer Programming Interface¶
Before beginning to program, or when troubleshooting custom software, it’s important to establish and validate basic communications with the MagnaLOAD, eliminating as many external variables as possible that could interfere with communications.
If not already installed, Magna-Power recommends using a terminal emulation programs called PuTTY <http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html> for initial communication validation.
[Further description to come with validation for each interface]
8.2. Programming Methods¶
8.2.1. MagnaWEB Software¶
8.2.2. Standard Commands for Programmable Instrumentation (SCPI)¶
8.2.3. National Instruments LabVIEW¶
8.2.4. IVI Driver¶
8.3. USB Communications¶
8.4. RS485 Communications¶
8.5. LXI TCP/IP Ethernet Communications¶
MagnaLOAD DC Electronic Load products are available with an optional LXI TCP/IP Ethernet interface (+LXI). The LXI TCP/IP Ethernet interface meets the LXI Class C, Revision 1.4 standard. When specified at time of order, an Ethernet interface module is installed, providing an embedded Ethernet port for communiations. With two UART ports available, RS232 and Ethernet, the one first receiving communications after power on is the port that is activated. Once activated, the other UART port cannot be recognized unless there has been a period of inactivity for 5 minutes. After this period, a new UART port can be recognized by sending communications. By default, DHCP is enabled on the power supply. In the absence of a DHCP server, the power supply will default to the settings defined in. The LXI TCP/IP Ethernet interface, connector JS5, is detailed in [REFERENCE LXI TERMINAL DEFINITION]
Ethernet communications can be made though the MagnaWEB, a terminal emulation programs like PuTTY, user written software, or through a computer’s web page browser. In the latter case, software, programmed into the LXI TCP/IP Ethernet interface module, allows the power supply to be recognized and to communicate directly with the computer without the need for additional programs stored in the computer.
An IVI-COM Driver is included with the installation CD and is available for download from the Magna-Power Electronics Support Download Center. The driver allows the power supply to communicate through many different programming languages. The driver handles the low-level bus protocols simplifying automation development. The driver supports TCP/IP, IEEE-488 GPIB, and RS232 using standard VISA resource descriptors. For additional documentation and details on using the IVI-COM driver, see [REFERENCE PROGRAMMING IVI]
8.5.1. Connectivity and IP Address Negotiation¶
When the LXI TCP/IP Ethernet module is configured for DHCP, but the DHCP server cannot be located, the module falls back to an Auto-IP configuration. The device then automatically selects an IP address from 169.254.###.### subnet as described in RFC 3927 (Request for Comments 3927 - Dynamic Configuration of IPv4 Link-Local Addresses). This routine is the same as that used with operating systems such as Microsoft Windows. This allows the user to use the LXI TCP/IP Ethernet interface in the absence of a DHCP server.
The LAN status LED, located at the rear of the power supply, provides LAN fault and device identification as defined as follows:
- On - Normal Operation
- The device has a properly configured IP address and the network cable is connected.
- Flashing - Device Identify
- The LXI Device Identification function was enabled via the Instrument Identification web page. This identification can help the user to quickly locate the unit and distinguish it from similar devices.
- Off - LAN Fault
- The device is experiencing one or more of the following LAN fault conditions: failure to acquire a valid IP address, detection of a duplicate IP address on the network, failure to renew an already acquired DHCP lease, or the LAN cable is disconnected.
8.6. IEEE-488 GPIB Communications¶
MagnaLOAD DC Electronic Load products ere available with an optional IEEE-488 GPIB interface. When specified at time of order, an IEEE-488 GPIB interface module is installed internally, providing an embedded IEEE-488 GPIB port available for communiations. With two UART ports available, RS232 and IEEE-488 GPIB, the one first receiving communications after power on is the port that is activated. Once activated, the other UART port cannot be recognized unless there has been a period of inactivity for 5 minutes. After this period, a new UART port can be recognized by sending communications. The IEEE-488 GPIB terminal, connector JS4, is detailed in
All of the SCPI subsystem commands in the previous section can be initiated using RS232, optional IEEE-488 GPIB (+GPIB), or optional LXI TCP/IP Ethernet (+LXI) communications.
The IEEE-488 standard defines a method for status reporting. As illustrated in [NEED FIGURE], the reporting method uses the IEEE-488 Status Byte (STB). Three bits of this byte are defined as:
- Master Status Summary (MSS) Bit
- Event Status Bit (ESB)
- Message Available (MAV) Bit
The Master Status Summary (MSS) is an unlatched bit. When the Status Byte Register is read using a Status Byte Register query, bit 6 will be 1 if there are any conditions requiring service.
The STB is masked by the Service Request Enable Register (SRE) to allow the user to mask specific or all events from setting the MSS bit to 1. The MSS bit is obtained by logical OR’ing the bits of the enabled Status Byte Register.
The Event Status Bit (ESB) is set when one of the events defined in the Event Status Register (ESR) [REFERENCE ESR TABLE HERE] has occurred. Like the STB, the ESR is masked by the Event Status Enable Register (ESE) to allow the user to mask specific or all events from setting the ESB to 1.
The Message AVailable (MAV) bit is set to 1 when a message is available in the output buffer.
8.6.1. IEEE-488 GPIB Communications with NI MAX¶
National Instruments offers Measurement and Automation Explorer (MAX), a Graphical User Interface, as a terminal emulation program for configuring an Interchangeable Virtual Instrument (IVI). MAX is usually installed with one of National Instrument’s Application Development Environments such as LabVIEW, Measurement Studio, or with hardware product drivers such as NI-488 and NI-DAQ.
To operate the power supply with MAX, the instrument must first be located for communications. The following steps describe this procedure.
- Run the MAX application program.
- In the Configuration window, press the + sign to the left of Devices and Interfaces to view the installed devices.
- If there is more than one IEEE-488 GPIB device listed, then select the correct GPIB device.
- Press Scan for Instruments on the menu bar and wait several seconds.
- At least one instrument should appear under the GPIB controller. If no instruments appear, then refer to [REFERENCE PROGRAMMING GPIB SECTION] to verify the correct setup.
- On the menu bar, press Communicate with Instrument. The NI-488 Communicator dialog box should appear.
- In the NI-488 Communicator dialog box, press the Configure EOS button. The Termination Method dialog box should appear.
- Select the option Send EOI at end of Write. Enter 0 into the EOS byte. Press OK.
|1||DIO1/Data line||13||DIO5/Data line|
|2||DIO2/Data line||14||DIO6/Data line|
|3||DIO3/Data line||15||DIO7/Data line|
|4||DIO4/Data line||16||DIO8/Data line|
|5||EOI/End or Identify||17||REN/Remote Enable|
|7||NRFD/Not Ready for Data||19||NRFD/Gnd|
|8||NDAC/Not Data Accepted||20||NDAC/Gnd|