Skip to content

SetProperty fails without error with wrong value typeΒ #1162

@pettaa123

Description

@pettaa123

Hi, I noticed that the SetProperty function fails silently when provided with an incorrect value type. For instance, attempting to set a property of type U32 using a value of type I32 does not produce an error, even though the operation is unsuccessful.

I setup my c# client using the instructions under: https://github.com/ni/grpc-device/wiki/Creating-a-gRPC-Client
I run the latest device server on cRIO. Seen issue using XNET

//set termination
var set_cantermination_reply = client.SetProperty(new SetPropertyRequest
{
    Session = session,
    PropertyId = Property.SessionIntfCanTerm,
    I32Scalar = 1 //SET PROPERTY USING WRONG TYPE
});

if (set_cantermination_reply.Status == 1)
{
    Console.WriteLine("Setting CAN Termination failed");
}

//read back termination
var get_cantermination_reply = client.GetProperty(new GetPropertyRequest
{
    Session = session,
    PropertyId = NationalInstruments.Grpc.NiXnet.Property.SessionIntfCanTerm
});

if (get_cantermination_reply.Status == 0)
{
    var term = get_cantermination_reply.U32Scalar; //THIS IS STILL 0
    Console.WriteLine($"Getting CAN Termination:{term}");
}

AB#3072034

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions