LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Equality check on strings containing value and unit

I write the input array to my oscilloscope via visa.
I want to check if my send values are set by reading them back and a following comparison one by one.

 

Quiztus2_0-1716978024934.png

 

equality.png


What is your simplest approach to check equality on those 2 string arrays. Of course 1V and 1.00V should be treated as equals.
Attached as LV19

Actor Framework
0 Kudos
Message 1 of 4
(262 Views)

Hi Quiztus,

 


@Quiztus2 wrote:

I want to check if my send values are set by reading them back and a following comparison one by one.


What is your simplest approach to check equality on those 2 string arrays. Of course 1V and 1.00V should be treated as equals.


Compare the numeric and the string/unit parts on their own…

 

  • Can the scope answer with 100mV when you send 0.1V?
  • You know about the problems of comparing float values? (What is the expected result for a value of 1.1V that cannot be represented precisely using floats?)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(244 Views)

Very valid points. Fortunately setting is either from a discrete set of interger + string e.g. (AC|10K|100K|1M|100mV)

or plain integer.

 

The responses are supposed to be integer based, but they are sometimes floats instead.
So the best so far I came up with is:

equality_scan.png

Quiztus2_0-1716984209876.png

 

Actor Framework
0 Kudos
Message 3 of 4
(213 Views)

Since you know the formatting rules of the instrument, can't you just create a string from the value you send, then compare it with the returned string?

0 Kudos
Message 4 of 4
(166 Views)