Skip to content

Commit

Permalink
[PR0] Update NIDAQmx.h and other nidaqmx metadata files to v23.0 (#881)
Browse files Browse the repository at this point in the history
* Update NIDAQmx.h file to v23.0

* Enums metadata updated with source files scrapigen v23.0 update

* Proto file generated after enums metadata in v23.0 update

* Functions metadata from scrapigen v23.0 source file update

* Out files generated after updating Functions metadata from scrapigen v23.0 source file update

* Attributes  metadata from scrapigen v23.0 source file update

* Out files generated after updating Attributes  metadata from scrapigen v23.0 source file update

* Add force-include field to surpass validation

* Added a suppression logic to exclude enums in proto files

* Update api_version in config.py to 23.0.0

* Formatting using black

* Add comments for ENUMS_SHOULD_BE_USED rule

* Add comments for validation suppression in enums for DAQmx metadata

* Metadata updated after compatibility fixed in scrapigen

* Generated files after fixing compatibility issue in scrapigen code

* Fix styleguide
  • Loading branch information
vigkre committed Mar 14, 2023
1 parent bccd7b2 commit 1faa210
Show file tree
Hide file tree
Showing 18 changed files with 14,338 additions and 74 deletions.
106 changes: 100 additions & 6 deletions generated/nidaqmx/nidaqmx.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

//---------------------------------------------------------------------
// This file is generated from NI-DAQMX API metadata version 20.0.0
// This file is generated from NI-DAQMX API metadata version 23.0.0
//---------------------------------------------------------------------
// Proto file for the NI-DAQMX Metadata
//---------------------------------------------------------------------
Expand Down Expand Up @@ -68,6 +68,7 @@ service NiDAQmx {
rpc CreateAIPosEddyCurrProxProbeChan(CreateAIPosEddyCurrProxProbeChanRequest) returns (CreateAIPosEddyCurrProxProbeChanResponse);
rpc CreateAIPosLVDTChan(CreateAIPosLVDTChanRequest) returns (CreateAIPosLVDTChanResponse);
rpc CreateAIPosRVDTChan(CreateAIPosRVDTChanRequest) returns (CreateAIPosRVDTChanResponse);
rpc CreateAIPowerChan(CreateAIPowerChanRequest) returns (CreateAIPowerChanResponse);
rpc CreateAIPressureBridgePolynomialChan(CreateAIPressureBridgePolynomialChanRequest) returns (CreateAIPressureBridgePolynomialChanResponse);
rpc CreateAIPressureBridgeTableChan(CreateAIPressureBridgeTableChanRequest) returns (CreateAIPressureBridgeTableChanResponse);
rpc CreateAIPressureBridgeTwoPointLinChan(CreateAIPressureBridgeTwoPointLinChanRequest) returns (CreateAIPressureBridgeTwoPointLinChanResponse);
Expand Down Expand Up @@ -279,6 +280,9 @@ service NiDAQmx {
rpc ReadDigitalU16(ReadDigitalU16Request) returns (ReadDigitalU16Response);
rpc ReadDigitalU32(ReadDigitalU32Request) returns (ReadDigitalU32Response);
rpc ReadDigitalU8(ReadDigitalU8Request) returns (ReadDigitalU8Response);
rpc ReadPowerBinaryI16(ReadPowerBinaryI16Request) returns (ReadPowerBinaryI16Response);
rpc ReadPowerF64(ReadPowerF64Request) returns (ReadPowerF64Response);
rpc ReadPowerScalarF64(ReadPowerScalarF64Request) returns (ReadPowerScalarF64Response);
rpc ReadRaw(ReadRawRequest) returns (ReadRawResponse);
rpc RegisterDoneEvent(RegisterDoneEventRequest) returns (stream RegisterDoneEventResponse);
rpc RegisterEveryNSamplesEvent(RegisterEveryNSamplesEventRequest) returns (stream RegisterEveryNSamplesEventResponse);
Expand Down Expand Up @@ -644,6 +648,9 @@ enum ChannelInt32Attribute {
CHANNEL_ATTRIBUTE_AI_FILTER_RESPONSE = 12661;
CHANNEL_ATTRIBUTE_CI_FILTER_RESPONSE = 12729;
CHANNEL_ATTRIBUTE_CI_FILTER_DELAY_UNITS = 12732;
CHANNEL_ATTRIBUTE_PWR_OUTPUT_STATE = 12759;
CHANNEL_ATTRIBUTE_PWR_IDLE_OUTPUT_BEHAVIOR = 12760;
CHANNEL_ATTRIBUTE_PWR_REMOTE_SENSE = 12763;
}

enum ChannelDoubleAttribute {
Expand Down Expand Up @@ -824,6 +831,8 @@ enum ChannelDoubleAttribute {
CHANNEL_ATTRIBUTE_CI_FILTER_DELAY = 12731;
CHANNEL_ATTRIBUTE_AO_FUNC_GEN_START_PHASE = 12740;
CHANNEL_ATTRIBUTE_AO_COMMON_MODE_OFFSET = 12748;
CHANNEL_ATTRIBUTE_PWR_VOLTAGE_SETPOINT = 12756;
CHANNEL_ATTRIBUTE_PWR_CURRENT_SETPOINT = 12757;
}

enum ChannelResetAttribute {
Expand Down Expand Up @@ -1381,6 +1390,11 @@ enum ChannelResetAttribute {
CHANNEL_RESET_ATTRIBUTE_CI_FILTER_DELAY_UNITS = 12732;
CHANNEL_RESET_ATTRIBUTE_AO_FUNC_GEN_START_PHASE = 12740;
CHANNEL_RESET_ATTRIBUTE_AO_COMMON_MODE_OFFSET = 12748;
CHANNEL_RESET_ATTRIBUTE_PWR_VOLTAGE_SETPOINT = 12756;
CHANNEL_RESET_ATTRIBUTE_PWR_CURRENT_SETPOINT = 12757;
CHANNEL_RESET_ATTRIBUTE_PWR_OUTPUT_ENABLE = 12758;
CHANNEL_RESET_ATTRIBUTE_PWR_IDLE_OUTPUT_BEHAVIOR = 12760;
CHANNEL_RESET_ATTRIBUTE_PWR_REMOTE_SENSE = 12763;
}

enum ChannelBoolAttribute {
Expand Down Expand Up @@ -1481,6 +1495,7 @@ enum ChannelBoolAttribute {
CHANNEL_ATTRIBUTE_AI_POWER_SUPPLY_FAULT_DETECT_ENABLE = 12689;
CHANNEL_ATTRIBUTE_AI_OVERCURRENT_DETECT_ENABLE = 12692;
CHANNEL_ATTRIBUTE_CI_FILTER_ENABLE = 12727;
CHANNEL_ATTRIBUTE_PWR_OUTPUT_ENABLE = 12758;
}

enum ChannelStringAttribute {
Expand Down Expand Up @@ -1610,6 +1625,8 @@ enum ChannelDoubleArrayAttribute {
CHANNEL_ATTRIBUTE_AI_BRIDGE_POLY_FORWARD_COEFF = 12176;
CHANNEL_ATTRIBUTE_AI_BRIDGE_POLY_REVERSE_COEFF = 12177;
CHANNEL_ATTRIBUTE_AI_DIG_FLTR_COEFF = 12487;
CHANNEL_ATTRIBUTE_PWR_VOLTAGE_DEV_SCALING_COEFF = 12761;
CHANNEL_ATTRIBUTE_PWR_CURRENT_DEV_SCALING_COEFF = 12762;
}

enum DeviceStringAttribute {
Expand Down Expand Up @@ -2093,6 +2110,9 @@ enum ReadBoolAttribute {
READ_ATTRIBUTE_SYNC_UNLOCKED_CHANS_EXIST = 12605;
READ_ATTRIBUTE_INPUT_LIMITS_FAULT_CHANS_EXIST = 12687;
READ_ATTRIBUTE_POWER_SUPPLY_FAULT_CHANS_EXIST = 12690;
READ_ATTRIBUTE_REMOTE_SENSE_ERROR_CHANS_EXIST = 12765;
READ_ATTRIBUTE_AUX_POWER_ERROR_CHANS_EXIST = 12767;
READ_ATTRIBUTE_REVERSE_VOLTAGE_ERROR_CHANS_EXIST = 12774;
}

enum ReadUInt64Attribute {
Expand Down Expand Up @@ -2131,6 +2151,9 @@ enum ReadStringAttribute {
READ_ATTRIBUTE_SYNC_UNLOCKED_CHANS = 12606;
READ_ATTRIBUTE_INPUT_LIMITS_FAULT_CHANS = 12688;
READ_ATTRIBUTE_POWER_SUPPLY_FAULT_CHANS = 12691;
READ_ATTRIBUTE_REMOTE_SENSE_ERROR_CHANS = 12766;
READ_ATTRIBUTE_AUX_POWER_ERROR_CHANS = 12768;
READ_ATTRIBUTE_REVERSE_VOLTAGE_ERROR_CHANS = 12775;
}

enum ReadDoubleAttribute {
Expand Down Expand Up @@ -3473,6 +3496,7 @@ enum ChannelInt32AttributeValues {
CHANNEL_INT32_AI_MEASUREMENT_TYPE_TORQUE_BRIDGE = 15905;
CHANNEL_INT32_AI_MEASUREMENT_TYPE_TEDS_SENSOR = 12531;
CHANNEL_INT32_AI_MEASUREMENT_TYPE_CHARGE = 16105;
CHANNEL_INT32_AI_MEASUREMENT_TYPE_POWER = 16201;
CHANNEL_INT32_AO_IDLE_OUTPUT_BEHAVIOR_ZERO_VOLTS = 12526;
CHANNEL_INT32_AO_IDLE_OUTPUT_BEHAVIOR_HIGH_IMPEDANCE = 12527;
CHANNEL_INT32_AO_IDLE_OUTPUT_BEHAVIOR_MAINTAIN_EXISTING_VALUE = 12528;
Expand Down Expand Up @@ -3691,6 +3715,12 @@ enum ChannelInt32AttributeValues {
CHANNEL_INT32_OUTPUT_TERM_CFG_RSE = 10083;
CHANNEL_INT32_OUTPUT_TERM_CFG_DIFF = 10106;
CHANNEL_INT32_OUTPUT_TERM_CFG_PSEUDO_DIFF = 12529;
CHANNEL_INT32_POWER_IDLE_OUTPUT_BEHAVIOR_OUTPUT_DISABLED = 15503;
CHANNEL_INT32_POWER_IDLE_OUTPUT_BEHAVIOR_MAINTAIN_EXISTING_VALUE = 12528;
CHANNEL_INT32_POWER_OUTPUT_STATE_CONSTANT_VOLTAGE = 15500;
CHANNEL_INT32_POWER_OUTPUT_STATE_CONSTANT_CURRENT = 15501;
CHANNEL_INT32_POWER_OUTPUT_STATE_OVERVOLTAGE = 15502;
CHANNEL_INT32_POWER_OUTPUT_STATE_OUTPUT_DISABLED = 15503;
CHANNEL_INT32_PRESSURE_UNITS_PASCALS = 10081;
CHANNEL_INT32_PRESSURE_UNITS_POUNDS_PER_SQUARE_INCH = 15879;
CHANNEL_INT32_PRESSURE_UNITS_BAR = 15880;
Expand Down Expand Up @@ -3839,6 +3869,7 @@ enum DeviceInt32AttributeValues {
DEVICE_INT32_AI_MEASUREMENT_TYPE_TORQUE_BRIDGE = 15905;
DEVICE_INT32_AI_MEASUREMENT_TYPE_TEDS_SENSOR = 12531;
DEVICE_INT32_AI_MEASUREMENT_TYPE_CHARGE = 16105;
DEVICE_INT32_AI_MEASUREMENT_TYPE_POWER = 16201;
DEVICE_INT32_AO_OUTPUT_CHANNEL_TYPE_VOLTAGE = 10322;
DEVICE_INT32_AO_OUTPUT_CHANNEL_TYPE_CURRENT = 10134;
DEVICE_INT32_AO_OUTPUT_CHANNEL_TYPE_FUNC_GEN = 14750;
Expand All @@ -3852,9 +3883,9 @@ enum DeviceInt32AttributeValues {
DEVICE_INT32_ANT_STATUS_ABSENT = 15994;
DEVICE_INT32_ANT_STATUS_OVERCURRENT = 15995;
DEVICE_INT32_BUS_TYPE_PCI = 12582;
DEVICE_INT32_BUS_TYPE_PC_IE = 13612;
DEVICE_INT32_BUS_TYPE_PCIE = 13612;
DEVICE_INT32_BUS_TYPE_PXI = 12583;
DEVICE_INT32_BUS_TYPE_PX_IE = 14706;
DEVICE_INT32_BUS_TYPE_PXIE = 14706;
DEVICE_INT32_BUS_TYPE_SCXI = 12584;
DEVICE_INT32_BUS_TYPE_SCC = 14707;
DEVICE_INT32_BUS_TYPE_PC_CARD = 12585;
Expand Down Expand Up @@ -3922,6 +3953,8 @@ enum DeviceInt32AttributeValues {
DEVICE_INT32_PRODUCT_CATEGORY_NETWORK_DAQ = 14829;
DEVICE_INT32_PRODUCT_CATEGORY_SC_EXPRESS = 15886;
DEVICE_INT32_PRODUCT_CATEGORY_FIELD_DAQ = 16151;
DEVICE_INT32_PRODUCT_CATEGORY_TEST_SCALE_CHASSIS = 16180;
DEVICE_INT32_PRODUCT_CATEGORY_TEST_SCALE_MODULE = 16181;
DEVICE_INT32_PRODUCT_CATEGORY_UNKNOWN = 12588;
DEVICE_INT32_TRIGGER_USAGE_ADVANCE = 12488;
DEVICE_INT32_TRIGGER_USAGE_PAUSE = 12489;
Expand Down Expand Up @@ -3987,12 +4020,13 @@ enum PhysicalChannelInt32AttributeValues {
PHYSICALCHANNEL_INT32_AI_MEASUREMENT_TYPE_TORQUE_BRIDGE = 15905;
PHYSICALCHANNEL_INT32_AI_MEASUREMENT_TYPE_TEDS_SENSOR = 12531;
PHYSICALCHANNEL_INT32_AI_MEASUREMENT_TYPE_CHARGE = 16105;
PHYSICALCHANNEL_INT32_AI_MEASUREMENT_TYPE_POWER = 16201;
PHYSICALCHANNEL_INT32_AO_OUTPUT_CHANNEL_TYPE_VOLTAGE = 10322;
PHYSICALCHANNEL_INT32_AO_OUTPUT_CHANNEL_TYPE_CURRENT = 10134;
PHYSICALCHANNEL_INT32_AO_OUTPUT_CHANNEL_TYPE_FUNC_GEN = 14750;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_10322 = 10322;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_10134 = 10134;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_12527 = 12527;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_VOLTAGE = 10322;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_CURRENT = 10134;
PHYSICALCHANNEL_INT32_AO_POWER_UP_OUTPUT_BEHAVIOR_HIGH_IMPEDANCE = 12527;
PHYSICALCHANNEL_INT32_ACQUISITION_TYPE_FINITE_SAMPS = 10178;
PHYSICALCHANNEL_INT32_ACQUISITION_TYPE_CONT_SAMPS = 10123;
PHYSICALCHANNEL_INT32_ACQUISITION_TYPE_HW_TIMED_SINGLE_POINT = 12522;
Expand Down Expand Up @@ -5193,6 +5227,19 @@ message CreateAIPosRVDTChanResponse {
int32 status = 1;
}

message CreateAIPowerChanRequest {
nidevice_grpc.Session task = 1;
string physical_channel = 2;
string name_to_assign_to_channel = 3;
double voltage_setpoint = 4;
double current_setpoint = 5;
bool output_enable = 6;
}

message CreateAIPowerChanResponse {
int32 status = 1;
}

message CreateAIPressureBridgePolynomialChanRequest {
nidevice_grpc.Session task = 1;
string physical_channel = 2;
Expand Down Expand Up @@ -8578,6 +8625,53 @@ message ReadDigitalU8Response {
int32 samps_per_chan_read = 3;
}

message ReadPowerBinaryI16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
double timeout = 3;
oneof fill_mode_enum {
GroupBy fill_mode = 4;
int32 fill_mode_raw = 5;
}
uint32 array_size_in_samps = 6;
}

message ReadPowerBinaryI16Response {
int32 status = 1;
repeated int32 read_array_voltage = 2;
repeated int32 read_array_current = 3;
int32 samps_per_chan_read = 4;
}

message ReadPowerF64Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
double timeout = 3;
oneof fill_mode_enum {
GroupBy fill_mode = 4;
int32 fill_mode_raw = 5;
}
uint32 array_size_in_samps = 6;
}

message ReadPowerF64Response {
int32 status = 1;
repeated double read_array_voltage = 2;
repeated double read_array_current = 3;
int32 samps_per_chan_read = 4;
}

message ReadPowerScalarF64Request {
nidevice_grpc.Session task = 1;
double timeout = 2;
}

message ReadPowerScalarF64Response {
int32 status = 1;
double voltage = 2;
double current = 3;
}

message ReadRawRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down
96 changes: 96 additions & 0 deletions generated/nidaqmx/nidaqmx_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,28 @@ create_ai_pos_rvdt_chan(const StubPtr& stub, const nidevice_grpc::Session& task,
return response;
}

CreateAIPowerChanResponse
create_ai_power_chan(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& physical_channel, const std::string& name_to_assign_to_channel, const double& voltage_setpoint, const double& current_setpoint, const bool& output_enable)
{
::grpc::ClientContext context;

auto request = CreateAIPowerChanRequest{};
request.mutable_task()->CopyFrom(task);
request.set_physical_channel(physical_channel);
request.set_name_to_assign_to_channel(name_to_assign_to_channel);
request.set_voltage_setpoint(voltage_setpoint);
request.set_current_setpoint(current_setpoint);
request.set_output_enable(output_enable);

auto response = CreateAIPowerChanResponse{};

raise_if_error(
stub->CreateAIPowerChan(&context, request, &response),
context);

return response;
}

CreateAIPressureBridgePolynomialChanResponse
create_ai_pressure_bridge_polynomial_chan(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& physical_channel, const std::string& name_to_assign_to_channel, const double& min_val, const double& max_val, const simple_variant<PressureUnits, pb::int32>& units, const simple_variant<BridgeConfiguration1, pb::int32>& bridge_config, const simple_variant<ExcitationSource, pb::int32>& voltage_excit_source, const double& voltage_excit_val, const double& nominal_bridge_resistance, const std::vector<double>& forward_coeffs, const std::vector<double>& reverse_coeffs, const simple_variant<BridgeElectricalUnits, pb::int32>& electrical_units, const simple_variant<BridgePhysicalUnits, pb::int32>& physical_units, const std::string& custom_scale_name)
{
Expand Down Expand Up @@ -7856,6 +7878,80 @@ read_digital_u8(const StubPtr& stub, const nidevice_grpc::Session& task, const p
return response;
}

ReadPowerBinaryI16Response
read_power_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<GroupBy, pb::int32>& fill_mode, const pb::uint32& array_size_in_samps)
{
::grpc::ClientContext context;

auto request = ReadPowerBinaryI16Request{};
request.mutable_task()->CopyFrom(task);
request.set_num_samps_per_chan(num_samps_per_chan);
request.set_timeout(timeout);
const auto fill_mode_ptr = fill_mode.get_if<GroupBy>();
const auto fill_mode_raw_ptr = fill_mode.get_if<pb::int32>();
if (fill_mode_ptr) {
request.set_fill_mode(*fill_mode_ptr);
}
else if (fill_mode_raw_ptr) {
request.set_fill_mode_raw(*fill_mode_raw_ptr);
}
request.set_array_size_in_samps(array_size_in_samps);

auto response = ReadPowerBinaryI16Response{};

raise_if_error(
stub->ReadPowerBinaryI16(&context, request, &response),
context);

return response;
}

ReadPowerF64Response
read_power_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<GroupBy, pb::int32>& fill_mode, const pb::uint32& array_size_in_samps)
{
::grpc::ClientContext context;

auto request = ReadPowerF64Request{};
request.mutable_task()->CopyFrom(task);
request.set_num_samps_per_chan(num_samps_per_chan);
request.set_timeout(timeout);
const auto fill_mode_ptr = fill_mode.get_if<GroupBy>();
const auto fill_mode_raw_ptr = fill_mode.get_if<pb::int32>();
if (fill_mode_ptr) {
request.set_fill_mode(*fill_mode_ptr);
}
else if (fill_mode_raw_ptr) {
request.set_fill_mode_raw(*fill_mode_raw_ptr);
}
request.set_array_size_in_samps(array_size_in_samps);

auto response = ReadPowerF64Response{};

raise_if_error(
stub->ReadPowerF64(&context, request, &response),
context);

return response;
}

ReadPowerScalarF64Response
read_power_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout)
{
::grpc::ClientContext context;

auto request = ReadPowerScalarF64Request{};
request.mutable_task()->CopyFrom(task);
request.set_timeout(timeout);

auto response = ReadPowerScalarF64Response{};

raise_if_error(
stub->ReadPowerScalarF64(&context, request, &response),
context);

return response;
}

ReadRawResponse
read_raw(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_bytes)
{
Expand Down
Loading

0 comments on commit 1faa210

Please sign in to comment.