rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
data_format.cpp
Go to the documentation of this file.
1 
7 // rohdeschwarz
10 #include "rohdeschwarz/helpers.hpp"
11 using namespace rohdeschwarz;
12 using namespace rohdeschwarz::instruments::vna;
13 
14 
16  _vna(znx)
17 {
18  // no operations
19 }
20 
21 
23 {
24  return dataFormat() == "ASC";
25 }
26 
27 
29 {
30  _vna->write(":FORM ASC");
31 }
32 
33 
35 {
36  return dataFormat() == "REAL,32";
37 }
38 
39 
41 {
42  _vna->write(":FORM REAL,32");
43 }
44 
45 
47 {
48  return dataFormat() == "REAL,64";
49 }
50 
51 
53 {
54  _vna->write(":FORM REAL,64");
55 }
56 
57 
59 {
60  return byteOrder() == "NORM";
61 }
62 
63 
65 {
66  _vna->write(":FORM:BORD NORM");
67 }
68 
69 
71 {
72  return byteOrder() == "SWAP";
73 }
74 
75 
77 {
78  _vna->write(":FORM:BORD SWAP");
79 }
80 
81 
82 // helpers
83 
84 std::string DataFormat::dataFormat()
85 {
86  return rightTrim(_vna->query(":FORM?"));
87 }
88 
89 
90 std::string DataFormat::byteOrder()
91 {
92  return rightTrim(_vna->query(":FORM:BORD?"));
93 }
std::string query(std::string scpi_command, Args &&... args)
Definition: instrument.hpp:173
bool write(std::string scpi_command, Args &&... args)
Definition: instrument.hpp:142
void setBigEndian()
Sets the byte order for float data transfer to big-endian.
Definition: data_format.cpp:64
void setLittleEndian()
Sets the byte order for float data transfer to little-endian.
Definition: data_format.cpp:76
bool isLittleEndian()
Queries if the byte order for float data transfer is little-endian.
Definition: data_format.cpp:70
bool isBinary32Bit()
Queries if data transfer format is 32-bit float.
Definition: data_format.cpp:34
bool isAscii()
Queries if data transfer format is ASCII.
Definition: data_format.cpp:22
void setAscii()
Sets data transfer format to ASCII.
Definition: data_format.cpp:28
void setBinary64Bit()
Sets data transfer format to 64-bit float.
Definition: data_format.cpp:52
bool isBinary64Bit()
Queries if data transfer format is 64-bit float.
Definition: data_format.cpp:46
bool isBigEndian()
Queries if the byte order for float data transfer is big-endian.
Definition: data_format.cpp:58
void setBinary32Bit()
Sets data transfer format to 32-bit float.
Definition: data_format.cpp:40
Object-oriented R&S ZNX-series VNA control.
Definition: vna.hpp:34
rohdeschwarz::instruments::vna::DataFormat definition
rohdeschwarz helper function definition
std::string rightTrim(std::string text)
Trims whitespace from right (end) of string.
Definition: helpers.cpp:47
rohdeschwarz::instruments::vna::Vna definition