The HP 33120A reports error -113, “Undefined header,” when the LabVIEW initialization VI completes over RS-232. In the reported case, subsequent serial communication remains functional, so the failure is an instrument-side command parsing error rather than a complete loss of communication. The affected setup used the NI hp33120A IVI driver version 4.2.
Confirm the Failure Is Inside Initialization
Run the initialization VI while highlighting execution and note when the front-panel error appears. The reported error occurred as the hp33120A.dll initialization function completed, while every other DLL function operated correctly over serial.
- Run
hp33120a Initialise with Options.viwith each available identification-query and reset combination. - Record whether error -113 appears for every combination. In the reported case, changing these options did not eliminate it.
- After initialization, issue a known working command to confirm that communication remains operational.
- Call the driver’s error-query function immediately after initialization to read and clear the instrument error buffer.
Inspect the Actual RS-232 Command Stream
The exact IVI initialization source was not available, so the command responsible cannot be identified from the reported behavior alone. Capture the serial traffic or inspect the applicable driver source and find the command immediately preceding error -113. This separates an invalid header from timing, reset sequencing, or serial-configuration problems.
| Check | Evidence-based decision |
|---|---|
| Instrument reports -113 | Inspect the transmitted header for misspelling, unsupported syntax, or unintended leading characters. |
| Error persists with all init options | Look beyond only the optional identification query and reset selections. |
| Other DLL calls work | Focus on initialization-only commands and their order. |
| Serial parser may be overrun | Test 10 ms between a query and its read, then another 10 ms before the next command or query. |
Review the Suspected Driver Formatting Defect
Source reviewed for an older driver contained mismatched formatted-output calls in hp33120a_DefaultInstrSetup. One call included %s without a matching argument, while a later call supplied a reset string without a %s placeholder:
viPrintf(io, "%s*CLS;*ESE 1;*SRE 32;");
viPrintf(io, ":FORM:BORD NORM;:APPL:SIN 1000.0, 0.05, 0.00;",
(reset) ? "*RST;" : "");
These defects could emit unintended text, but the reviewed code is not proven to be the implementation inside IVI driver version 4.2. Confirm the transmitted bytes before attributing the IVI failure to this code. If the captured stream proves that the DLL emits a malformed command, report the trace and driver version to NI through an official support channel.
Validate RS-232 Setup and Reset Sequencing
The available 33120A driver notes identify three serial requirements: send SYSTEM:REMOTE, configure two stop bits, and use DTR/DSR handshaking. They also indicate that reset may leave remote mode, so test sending SYST:REM after *RST;*CLS, not only before serial attributes are configured. Send STAT:PRES only when the instrument has the Phase Lock Option, and finish initialization with *OPC? when synchronization is required.
Verify the correction by power-cycling or otherwise returning to a repeatable starting state, running initialization, confirming that error -113 no longer appears, reading the error queue, and executing the same working post-initialization command used during diagnosis.
FAQ
What causes HP 33120A error -113 during LabVIEW initialization?
Error -113 means the generator received an undefined command header. In this case, capture the RS-232 stream and inspect initialization-only commands because normal DLL operations continue to work.
Can I clear HP 33120A error -113 without stopping communication?
Yes. Call the driver’s error-query function immediately after initialization to read and clear the instrument error buffer; this is a workaround and does not correct the malformed or unsupported command.
What serial settings and command order should I check on an HP 33120A?
Check two stop bits and DTR/DSR handshaking, then test *RST;*CLS followed by SYST:REM. If parser timing is suspect, test 10 ms before reading a query response and another 10 ms before sending the next command or query.