Development of type float NAN of Python

I am writing the Python 2.6 code that is interfaced with NI TestStand 4.2 via COM in Windows. I want to do a value "NAN" for a variable, but if I pass float('nan') , TestStand displays as IND . In other words, my code was something like:

locals_prop_object.NewSubProperty(var_name, win32com.client.constants.PropValType_Number, False, "", 0)
# Set the initial value to NaN--although it appears in TestStand as 'IND'.
locals_prop_object.SetValNumber(var_name, 0, float('nan'))

Apparently, TestStand distinguishes between floating point "IND" and "NAN" values According to TestStand help:

  • INDcorresponds to the signs of the NaN in Visual C++, while
  • NANcorresponds to QuietNaN

It means that Python float('nan') is indeed a signalling NaN when passed through COM. However, from what I've read on the signaling NaN, apparently signaling NaN is somewhat "exotic" and quiet NaN is your "regular" NaN. So I have my doubts that Python would pass a signaling through COM NaN (how can I verify this?).

So, any ideas how Python float ('nan') becomes TestStand "IND", the Python-> COM-> stream TestStand?

Now I tried with NI TestStand. First of all I've tried:

quiet_nan = struct.unpack(">d", "\x7f\xf8\x00\x00\x00\x00\x00\x01")[0]# Set the variable's value in TestStandlocals_prop_object.SetValNumber(var_name, 0, quiet_nan)

But that always appeared in TestStand as IND . So I created a TestStand file with the value of the variables IND and NAN , and read values from Python. It turns out that TestStand NAN has the value FFFF000000000001 . According to summary graphics Kevin , it is a quiet NAN negative.

Then, finally, it works (well that is probably specific to the platform; it works for me on Windows XP):

# Make a NAN suitable for TestStandteststand_nan = struct.unpack(">d", "\xff\xff\x00\x00\x00\x00\x00\x01")[0]# Set the variable's value in TestStandlocals_prop_object.SetValNumber(var_name, 0, teststand_nan)

Tags: NI Software

Similar Questions

  • How to record a data type float [64] table in a file?

    I have a table of type float64 [] data I want to save to a file.  I tried to use the ArrayToFile function, but he dislikes the type of data [] float64 .  I'm with LabWindows/CVI version 7.1.

    Why not use the data type double?

  • Problem of type float

    Tyring to do an ELT Oracle DB for Oracle DB.
    Incremental update of IKM SQL.

    Source-> Float (precision 126) to Target-> Float (precision 126) does not work.
    If I remove this mapping, my ELT works.

    With this mapping, I get a vague error...
    "Too many mistakes during the charge process: the error limit has been reached." A maximum of 1 error could. »

    I looked at the table of loading C$ _ and this table has the column float correctly filled.
    I looked at the table of integration I$ _ and it's empty. The error E table $ _ is also empty.

    Any ideas anyone?

    Published by: skhot on December 8, 2011 11:42

    changed the IKM
    from: incremental update IKM SQL (line by line)
    to: IKM SQL incremental update.

    His works now.

  • Conversion from data type "float".

    In a wireless data logger I collect analog data with a 8-bit microcontroller and sending it as a UDP datagram. The data received in the LV application looks like this:

    \r\n020.43\s002.14\s000.00\s000.02\s ("------" "" display codes)

    0D0A 3032 302F 3433 2030 3032 2E31 3420 3030 3030 2030 3030 2E30 3220 (display Hex) 302F

    020.43 002.14 000.02 000.00 (normal display)

    I want to undress and show values 20.43, 2.14,0.0 and 0.02 in my application of LV.  Try with "Scan of the String" and "Decimal number to the string" but without much success. Maybe I can 'building' my data of the hexagon?

    Any idea is welcome. Thank you.

    Channel scan works very well for me.

  • Change the value of type Float to String

    Hello

    After SQL statement gives the result as rent-.5

    Select Replace ("' rent - XX", "XX", 0.5) double

    How can I get the result like rent - 0.5

    Thanks in advance.

    The use of FM (model Format) is to cut off the escape null in this case.

    Here is an example

    select to_char('0.5','fm0.99'), to_char('0.5','0.99')
      from dual
    
  • Convert float to date data type

    How to convert the float to type date data type... the time stamp is actually stored type float in one of the tables.can, I use the cast function?

    For example... 39086.4047337963 (to convert to the format of the timestamp or date)

    user8813441 wrote:
    I got the answer from one of the forums

    SELECT TO_DATE ('19000101', 'YYYYMMDD') + 38497.6531944444
    DOUBLE;

    Assuming that it isn't something different right course...

    SQL> ed
    Wrote file afiedt.buf
    
      1  SELECT TO_DATE('19040101', 'yyyymmdd') + 38497.6531944444
      2* FROM dual
    SQL> /
    
    TO_DATE('19040101',
    -------------------
    26/05/2009 15:40:36
    
    SQL>
    

    This would also be a reasonable answer, unless of course your sales/technical design has already stipulated that the float should be the number of days since January 1, 1900.

    However, you don't mention that in your original post, so how could anyone experienced that?

  • Disable the setting custom step Type

    Hello

    I'm developing some types of custom step and I don't want the developer of the sequence to be able to change them. He should be able to access the properties of the step only which are visible through the property browser. I want my guys to appear as types of NI - where everything is disabled for the user.

    This way I can protect my types to get damaged by an adventurous sequence developer and also give him the freedom to design their own tests using the types I give him.

    Is this possible? If so, how?

    Thank you.

    Aditya

    If they are connected as long as developer and not admin, you can change the privileges > configure > change types to false.

  • Conversion of 16-bit unsigned 32-bit float

    Hi, I'm new to labview and data types in the electronics. Due to a shortage of labour in my company, I am required to do it myself. I've been through several labview basic tutorials and examples, but I am unable to do anything properly with labview. Any help is very appreciated.

    I'm using labview 8.6.1 and I downloaded the drivers for modbus. Currently, I am required to read data out of a sensor and write the data to a file. Using the ".vi MB series Master query Read Input registers (poly)", I am able to read the data in the registers. However, the data in the registers are 16-bit unsigned and does not give the "real" value I'm not sure about this, but I tried to use simply Modbus 6.3.6 and change the bit 16 32-bit unsigned type float makes the job of showing the real value.

    So, my question is, how do I get the actual values of the VI? I apologize if this is a simple question but I am new to this and don't have the time to study further in this regard. In addition, I apologize in advance if not enough information is given. Her updated the VI of "Master Series MB query Read Input registers (poly) .vi" that I used to write data to the file, as well as 1 text files, I got is attached.

    Thank you for your help and sorry for any trouble.

    Here's my VI registered under LV8.6.

    You have pretty cables through your VI, but it is ridiculously little handy, easily scalable and uses some Rube Goldberg constructions.

    Your Rubes:

    1. table to the cluster to unbundle converty.  Then grouping to a cluster and then to a table.  No need to go through the songs and dances of cluster.  You could have used the Index table and table build and not had to convert anything to a cluster or backward.

    2. using a constant Dbl to change than one through the digital conversion function to determine the data type for the type cast.  Eliminating the conversion and has created the representation of the single precision instead of double precision constant.

    3 code dozens of times when he should have been treated in a loop of duplication.

    If you use me as a Subvi, your screen real estate will be less than a 1/4 of what it is now.

    You say you want to read a bunch of records that are not adjacent to each other?  You can make several requests of reading.  Write a query command, then read the answer.  Then write another order of demand for various registers and read this response.  It depends on how different readings, you do or how far records of interest are about whether it makes sense.  If you need read a two pairs of registers, which are some distance apart, it might be more efficient to perform a single read multiple registers if they are close together and just throw the records don't care you.  It will be more bytes to read at the back, but it might be faster because it can be done in only one reading.  Or you could do two readings targeting your specific records.  It might be less bytes to read in each message, but it will take more time to make two requests to read and wait for responses between the two.

    I don't know if the limit of 125 records is something to make your device, modbus or modbus in general protocol library.  I want to say that it might be that the modbus Protocol usually means that records the 125 250 bytes of data.  Factor of a few bytes of the command of the response and the checksum, you will be 256 bytes.  Modbus packages are designed to take less than 256 bytes so that only a single byte is needed to tell how many bytes of data will be forthcoming in response to the message.

    With selective targeting of your records to read and using the table of Index to read specific float32 values of interest, you can write the 12 values you want in the file instead of all those you don't need.

  • How can I write the value of floats Unitronics vision230 PLC with modbus Ethernet

    How can I write the value of type Float in unitronics PLC Vision230 modbus ethernet (Ethernet Master Query.vi MB) usinsg I read and write register 32 bits, for example, I want to write the value 23.45 2nd Add. MF. And registry MF is the 32-bit registry. I read and write register 32-bit.

    Narendra.

    Narendra,

    Two characters can type cast into a uint16 you VI supports.

    To summarize. Take one (4 bytes). Flatten it to a string (4-byte) divided this string into two parts of 2 bytes each. Cast in u16 (16 x 2 = 32-bit).

    However, if you really want to follow the IEEE standards then you will need refer this KB. His is not that simple, but seems closer to what you are looking for.

    Amit

  • notifications of type push (bb10) has not received

    Hello!

    After having my job to push service, he stopped.

    I can save the user, create the chanel and everything works fine, but when sending notifications, he said everything is ok, but nothing is received the alpha device.

    It worked, maybe it crashes after the latest OS update, not sure.

    Any idea on what is happening?

    This is the answer to push:

    http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">http://pushapi.eval.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2013-01-16T20:44:24Z">
    

    For the slog2, you will need to install the Momentics IDE which is installed with the native SDK 10 BlackBerry. Install this IDE will give you the tools you need to access the device.

    http://developer.BlackBerry.com/native/download/

    1. in the QNX Momentics IDE, based on the target browser, right click on the target of the device. ClickLaunch SSH Session.

    2. in the terminal that appears, do one of the following:

    a. to view logs of current slogger2, type slog2info.

    b. to display the output in real time for the processes that are being debugged (for applications that are running in development mode), type slog2info - w.

    c. to display help on slogger2, type slog2info h

    SSH to the machine and run it:

    slog2info >/tmp/slog2.txt, and then send the slog2.txt

    We are able to determine the root cause of the problem in this thread that was the bar needed to be updated to have XML descriptor:

    
          APPLICATION
           
               bb.action.PUSH
               application/vnd.push
           
    
    

    However, when the BAR file was generated META-INF/MANIFEST. MF was lacking the entrances to invoke target which led to the discovery of the root cause of the problem which was the SDK of AIR PlayBook instead of the SDK software BlackBerry 10. Once the correct SDK has been used push starts happening on the device.

  • How can I start developing?

    I'm new and I first aid to development of type Hello world using adobe api. How can I start?

    I would like to know the basic steps to make these.

    Thanks in advance.

    Download Acrobat SDK: Adobe - Acrobat Developer Center | Adobe Developer Connection

  • How can I do this type of Introduction of Logo HD 1008

    I want to know how I can develop this type of movies

    https://www.YouTube.com/watch?v=mMmlG6eq_no & feature = fvwp & NR = 1

    https://www.YouTube.com/watch?v=AlGsCOWeM4E & List = PL3F064E0B8C77E532

    https://www.YouTube.com/watch?v=T9GoQg4DSBg

    and what software to use for what I want to do it in HD 1008

    Thank you

    It should be MUCH more specific in your request.  I saw something like a dozen different techniques in your exzmples, more of which were created in a real 3D application and not After Effects.

    Please tell us what feature you are interested.  Unfortunately, no member of this forum has three months to devote to writing of a step by step description each technique which use something like three different applications.

  • Convert c# to Java code - Floating Point Arithmetic

    Convert c# to Java code - Floating Point Arithmetic

    Hello
    I need to write a c# equivalent in java code. The c# code includes functions perform mathematical calculations. The result of these functions must match exactly with the c# (especially precision) counterpart. Here's a function that requires an equivalent java

    Public Shared Function squareroot (string n1)
    {
    If ((n1 == null) |) (System.Convert.ToDouble (N1) < 0))
    {return null ;}
    else {}
    return (Math.Sqrt (System.Convert.ToDouble (n1))) System.Convert.ToDecimal. ToString();
    }
    }

    C# two data types - float (32-bit) and double (64-bit) floating-point. It also includes a more specific data type float called decimal (128-bit). The float and double are supposed to follow the standard IEEE 754 floating point standard, but precise figures are different. Double c# has 15-16 digits for precision while the equivalent of java has 53, right? (the IEEE standard reference).

    Does anyone have an idea on what java equivalent data types/libraries must be used such that the results correspond with double c# and decimal?

    Thank you & happy new year

    This has nothing to do with the IEEE 754 standard, because nothing in IEEE 754 specifies how many decimal places should be used when a value is converted to a string. Simply because the resolution is between 15 and 16 decimal places does not mean that there is always an exact representation of any number of IEEE 754 format to 16 decimal places. In your example, Java chooses to create two decimal places more than c# don't but I bet that this is not a general rule you can count!

    The whole concept of using strings to represent the number seems to be skewed. I don't really see the point. It is mind bogglingly slow and in my view it does nothing for you. You have not yet met the real problem yet! What happens when Java or c# decides to use scientific notation?

    In your situation I would like to change the program c# use 'double' rather than 'chain', then you would find that you get an almost perfect match to all time. I make this recommendation of much written spending year of algorithms in C, C++, c# and Java of signal processing.

  • Function of certification and OCA rest

    Hello, I am a student at OCA certification and need help to understand the rest function works.

    I read that the remainder (m, n) (http://www.techonthenet.com/oracle/functions/remainder.php) is calculated as: m - (n * X) where X is the closest whole number of m / n.

    I ask: why rest (12.5,5) = 2.5?

    In my view, the result should be > > > rest (12.5,5) = 12.5-(5 * [l'entier le plus proche de 12.5/5])=12.5-(5*3)=-2.5.)

    Thanks for your replies. Kind regards.

    antoniob wrote:
    It's the right answer... maybe, there seems to be a bug.

    You shouldn't jump to conclusions that fast. First let us check the behavior documented. No speculation that can be found on the net (or even on this forum).

    Oracle wrote: http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions152.htm#sthref1470
    ...

  • If n1 = 0 or m2 = infinite, then Oracle returns

  • An error if the arguments are of type NUMBER
    NaN if the arguments are of BINARY_FLOAT and BINARY_DOUBLE types.
  • If n1! = 0, then the rest is n2 - (n1 * N) where N is the integer nearest n2/n1. If n2/n1 is equal to x.5, N is the nearest integer pair .

  • If n2 is a floating-point number, and if the remainder is 0, then the sign is the sign of the n2. Remains of 0 are not signed for NUMERIC values.
  • Where you think is out of reminder in conflict with this description?

    Published by: Sven w. on April 7, 2011 16:43

  • Problem numeric field

    I put a number field with the following things:

    Object > area > models > display > $1234,21

    It works well, but when I put develop fit width, it grows but not see the "$" and "." 00 ''. It shows just like 12340000000000.

    Or sometimes it shows black + sign right lower corner, although it shows the correct format. Where is that I made a mistake?

    In addition, I have data of type float format.

    Hi, sorry I misunderstood your question.

    1 remove the template edit

    2. Add this script to the event enter:

    this.rawValue = null;

    3. Add this script to the exit event:

    If (this.rawValue = null)

    {

    this.rawValue = 0;

    }

Maybe you are looking for

  • The screen backlight not working anymore on Satellite M

    Hello I have a problem with my laptop screen. The backlight of the screen does not work no matter how suspect more and I switch that turns off the screen when I close my laptop is broken. When I press the power button and release, a fast and light th

  • USB recording device

    It seems that using a USB peripheral to help video streaming buffer would be a great solution for a slow DSL speed. But when I try to do, the choice of 'Register' on 'Préférences' is grey and says that this feature is not supported by network video s

  • Error STATSMGR - failure of the collectorGet function

    I started getting errors STATSMGR the log files excluding anyone on the core of PowerConnect 7048 of filling pile. The current firmware is 4.1.0.6 and I hesitate to upgrade the firmware after that an update of the firmware on a sharp N2048s corrupt t

  • T61 with login problems

    Several days ago, I discovered that my dial-up connection did not work, so I tried to reinstall it. But after I uninstalled it, it would be never installed again. When I try to install the downloaded 5.02 login, the same error occurs - error occurs w

  • WIN8 Blue Screen DRIVER_OVERRAN_STACK_BUFFER

    I have a pc of win8. The pc was generally fine until I started playing full-screen games. The blue scree occurs very frequently and some of them are other problems, something like "attempted_execute_of_no_execute_memory". I've updated my graphics car