String to number conversion problem
I have a VI that pulls in data from a device using VISA, and I got it on another computer to work a few weeks back. I had to transfer the VI to a laptop computer to run a few tests, and now I can't make it work. I am unable to put my VI because the laptop on it's is unable to access the network companies, I will do my best to explain it all, I apologize for the inconvenience! My problem is not however with VISA, it's with an exit VISA number conversion chain.
I have attached a painting drawing of VI to better explain it.
I use the block series Visa football match in baud rate and all that many good things to the unit and port settings set of device management. Then, a while loop is entered. The loop will run until you press the stop"" button. The next block of visa is the writing block, he asks for a reading of the device. The next block of visa is the first block of reading, he returns playback in the form of "NA-XXX. X' where x are numbers. The next block of visa is the second reading block, this block just echoes back the command sent to the device. Playback of the first visa read block, "NA-XXX. X' is going exponential/fractional chain to digital converter.
When you perform a run/debug to highlight run, the release of visa reports the correct value, is the value of the device reading - however the string to number converter generates a 0,000, no matter what channel number is. I am at a loss as to what may be wrong because it's the EXACT set up I had to work very well a few weeks ago!
I'm using Labview 10 on the laptop, the old computer was labview 7. I'm guessing that this is perhaps the rub... I Redid the VI from scratch, although I have not opened the old VI in labview 10.
Any help would be appreciated. Again, sorry I am unable to attach the VI.
DARB wrote:
I have attached a painting drawing of VI to better explain it.
Would it not have been easier to just post a screenshot? You might also have used the Tool of Capture of Code. (Which reminds me that I need to install it to my previous versions of LabVIEW, as evidenced by the screenshot I took.
)
As to the question: you probably either:
- employee analysis of chain initially and when you rewrote the VI you used the regular string conversion functions.
- Wired an offset value in the string to the number function.
Tags: NI Software
Similar Questions
-
The decimal string to number Conversion, cutting necessary zeros
I'm new to the forum, but have been using labview for awhile. Finally found something that really puzzled me, hope I can find someone who is smarter than me! It may be something obvious too, but here goes. The attached vi is the cause of the error. I have a serial number I need to convert a decimal string into a number, I use later the number of "math" so he need as a number. The system always receives a serial number of 6 characters (ie. 123456), but today the system has received a serial number with two leading figures of the scale (ie. 003456) zeros. This compensation of all the bells of alarm stream (sent 4 digits), but the error found that started the 'intelligence' at the beginning of the monitoring program. I would like to know if there is a way to force the zeros in the decimal number in string to not shave off the coast of the 6-digit value above.
File is located in LabVIEW 2014
Ideas or comments, thank you!
The problem is not the string functions. This is the display format for your digital indicator. Change the properties on that.
-
Varchar2 to the number conversion problem
I have some difficulty conversion strings to numbers. On my Oracle 9.2 server, it gives me an error ORA-1722:
SELECT TO_NUMBER ('1.2') OF DOUBLE
Apparently, this is because my server is configured to use the Greek number format (comma instead of decimal point) and substitute "1.2' above with '1.2' will work correctly."
Is it possible for me to convert strings with decimal number type, independent of the culture so that my application will not have to depends on the locale setting of the server?
Thank you.Hello
Welcome to the forum!
If you don't want to change the NLS settings for your session, you can specify what settings to use for a particular call to TO_NUMBER (and other features), like this:
ALTER SESSION SET NLS_TERRITORY = GREECE; SELECT TO_NUMBER ('1.2') AS wont_work FROM dual; SELECT TO_NUMBER ( '1.2' , '999999999.999999' , 'NLS_NUMERIC_CHARACTERS = '',.''' ) AS n FROM dual;
The output below shows the TO_NUMBER 1-argument fails, but the 3-argument TO_NUMBER works:
Session altered. SELECT TO_NUMBER ('1.2') AS wont_work * ERROR at line 1: ORA-01722: invalid number N ---------- 1,2
The actual format of the string (the first argument) should not match precisely the format mask (the second argument). You can include signs, or omit the decimal points, so '3', ' '-1,2. '-3', ' + 1.2 ' and ' + 3' will be all converted correctly.»»» "
-
Basic question on the string-to-number conversion
Hello
I have a string, for example '23,2445,45'
I want to extract the numbers of this string and put it in an array of numbers.
Any keyword SQL is available. What is the best way to do it.
Thank you
MDTry this
declare type vnum is varray(20) of number; vnum1 vnum :=vnum(); j number; begin j:= 1; for i in ( with t as ( select '23,2445,45' product_string from dual ) SELECT * FROM (SELECT RTRIM(LTRIM(SUBSTR(product_string, INSTR(',' || product_string||',', ',', 1, n), INSTR(',' || product_string||',', ',', 1, n + 1) - INSTR(',' || product_string||',', ',', 1, n))), ' ,') AS prod FROM t, (SELECT ROWNUM n FROM DUAL CONNECT BY LEVEL < 10)) WHERE prod IS NOT NULL) loop vnum1.extend; vnum1(j):= to_number(i.prod); dbms_output.put_line(vnum1(j)); j:=j+1; end loop; end;
vnum1 vnum: = vnum (0,0,0,0,0,0,0,0,0);
I did it because I don't know how to initialize the array. Need to read more about it.
This will put the values in the vnum1 table.
If you need to do something with the numbers in the string
so you can do the following without using a table.
declare begin for i in ( with t as ( select '23,2445,45' product_string from dual ) SELECT * FROM (SELECT RTRIM(LTRIM(SUBSTR(product_string, INSTR(',' || product_string||',', ',', 1, n), INSTR(',' || product_string||',', ',', 1, n + 1) - INSTR(',' || product_string||',', ',', 1, n))), ' ,') AS prod FROM t, (SELECT ROWNUM n FROM DUAL CONNECT BY LEVEL < 10)) WHERE prod IS NOT NULL) loop -----Do what ever you want with the number. dbms_output.put_line(i.prod); end loop; end;
Published by: alvinder on March 11, 2009 15:18
Discovered how to initialize the array.
-
Problem with string to Int conversion
Dear friends,
Problem with string to Int conversion
I'll have a column where most of the values is digital. Only 4 values are not numeric.
I have replaced the non-numeric values to numeric in order to maintain the data type.
Grade.Grade DEAL WHEN "E4" THEN "24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' Grade.Grade OTHER END"
This is the result as inactive
Grade
_0_
_1_
_10_
_11_
_12_
_13_
_14_
15
_16_
_17_
_18_
_19_
_2_
_20_
_21_
_22_
_23_
_24_
_3_
_4_
_5_
_6_
_7_
_8_
_9_
Discount
- - -
Now I want to convert this value in digital and do some math
So I changed the formula as below
Cast (CASE Grade.Grade WHEN "E4" THEN "24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' Grade.Grade END as an INT. ELSE")
Now I get the following error
View display error
Driver Odbc _ returned an error (SQLExecDirectW). _
Error details
Error codes: OPR4ONWY:U9IM8TAC:OI2DL65P
_State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 17001] Oracle error code: 1722, message: ORA-01722: invalid number in the OIC calling OCIStmtFetch. [nQSError: 17012] In bulk fetch failed. _ (HY000)
SQL issued: SELECT cast (CASE Grade.Grade WHEN "E4" THEN "24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' Grade.Grade END as an int. ELSE") seen'Human Capital' 0 - Costing Manpower WHERE LENGTH (Grade.Grade CASE WHEN 'E1' THEN '20' WHEN 'E2' THEN '21' WHEN 'E3' THEN '22' WHEN "E4" THEN "23 ' ELSE Grade.Grade END) > 0 ORDER BY saw_0_
Discount
Could someone help me
Concerning
Mustafa
Published by: Musnet on June 29, 2010 05:42
Published by: Musnet on June 29, 2010 06:48Are you sure you don't have another non-digital value in your column. I want to get this filter temporarily just to check if your plaster works or not. If it works, then you can remove this filter.
-
Sub - VI with the entry as a string og number
At this small Subvi. I wonder if I could make it more flexible and be able to take the string and number as a value ('value dbl' market) entry. Is there some sort of variable of variant type that could be used?
Michael.Koppelgaard wrote:
At this small Subvi. I wonder if I could make it more flexible and be able to take the string and number as a value ('value dbl' market) entry. Is there some sort of variable of variant type that could be used?
It is possible with the key to write OpenG (varying) _ogtk.vi. But the problem is that when you want to read this back, you need to know what type it is. If you write to a different section of the config file each with a specific type, the TI will work. With this solution, you must use the key to reading OpenG (varying) _ogtk.vi to read and convert the value to LV
Another way is to use Get Type Information.vi of the Variant Data Type palette. The trick here is to convert double or string before saving it in the config file (wire structure dealing with the output type of the vi and do conversions in the case of type dbl and string). Here, too, you must use a different section, one for dbl for string. Here, you use the standard Read button live file configutaion palette.
Ben64
-
Is the locale-specific number conversion chain?
I would like to know what effect the computer's regional settings may have on the string number conversion in AS3. Specifically, in locales that use a comma as the decimal separator instead of a period, different conversion methods (Number() function, parseNumber(), Builder of the Number() class) they treat the comma as decimal separator? None of the documents I've read resolves this problem and all the examples use periods as a decimal separator. I suspect periods in strings will always be handled as decimal separators (and this is the behavior I want), but I would like to know for sure.FTR, an Adobe employee comes to informs me on programmers list that the answer to this question is no. period is always interpreted as a decimal separator, regardless of the location of the BONE.
-
"Decimal string to Number.vi" bug in LabVIEW 2009 SP1
The "decimal string to Number.vi' seems to be the conversion of the input data in the type int32 internally even when the input tape in vi data is expanded floating point (no points of constraint). This is causing me grief. See attached vi
This bug is still present in LabVIEW 2010?
Thank you
Richard Ballantyne
There is no bug. You use the wrong function (see Help) If you want a floating point output. Use Fract/Exp string to a number.
-
How convert string to number
my character
Select form double to_number ('1,6,9,4'); my putting here 1,6,9,4
get the character of number conversion error.
concerning
Published by: vr on March 31, 2011 23:59
Published by: vr on March 31, 2011 23:59VR says:
Getting error while the conversion of character to the number in instring is possible to get the position of the channels at one timeI have the following table, called pack
Acct_No pack2 pack3 pack1
1000 10101011 111111101 01010101111Select * Pack
where instr (pack2, ' 1') and * (to_number (replace('1,6,9,4',','))); * - getting values of function as string '1,6,9,4'If you want to retrieve lines where the position of the first "1" in the pack2 chain is one of the positions in your list number e.g. position 1, 6, 9, or 4?
Something with regexp_like can help...
SQL> ed Wrote file afiedt.buf 1 with pack as (select '1000' as acct_no, '10101011' as pack1, '111111101' as pack2, '01010101111' as pack3 from dual union all 2 select '1001', '10101011', '000011111', '10101010110' from dual union all 3 select '1001', '10101011', '000000001', '10101010110' from dual) 4 -- 5 -- end of test data 6 -- 7 select pack.*, case when regexp_like('1,6,9,4','(^|,)'||to_char(instr(pack2,'1'),'fm9999')||'(,|$)') then 'Yes' else 'No' end as x 8* from pack SQL> / ACCT PACK1 PACK2 PACK3 X ---- -------- --------- ----------- --- 1000 10101011 111111101 01010101111 Yes 1001 10101011 000011111 10101010110 No 1001 10101011 000000001 10101010110 Yes
-
PL/SQL: digital or value error: character number conversion in the TRG error
Hello
I have a strange problem with a trigger that, during the update of the table of reports (DB is 9.2.0.8):
but the 345 line is:ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at "UDR_LOG", line 345 ORA-04088: error during execution of trigger 'UDR_LOG'
END IF;
This kind of strange
error is raised by the update on a column.the code looks like 343 IF nvl(to_char(:old.PKD_ID),'''') <> nvl(to_char(:new.PKD_ID),'''') THEN 344 v_zmn := v_zmn || 'PKD_ID''' || to_char(:old.PKD_ID) || '''' || to_char(:new.PKD_ID) || ''''; 345 END IF; so its concatenation not to_number usage .
I'm sorry that I can't provide you with the code in the trigger everything.
So, if you could recommend only whole method of inquiry that would be great.
Concerning
GregHi, Greg.
When there is an error in a trigger, the line numbers in error messages are compared to the first statement DECLARE or BEGIN; often, it is a few lines after CREATE OR REPLACE TRIGGER. Post a few lines after what you have already posted.
If you do not find the error, then create another table to test this and create a small trigger on that table, who did just enough to cause the error. Then, you will be able to post the complete relaxation, and the code needed to recreate the problem.
-
I have 22 SPSS for Mac. Since I upgraded to El Capitan, I have a number of problems. I checked the Web sites of IBM, but they only mention fixes for SPSS 23. Any thoughts would be greatly appreciated. Thank you.
I am running SPSS 23.0
You can upgrade to 23.0?
Also, have you looked here
-
How to convert string to number in TS?
Hello
Anyone know how to convert string to number in TS?
I couldn't find the Num() function.
Thank you
Val()
-
Whole singed to hexadecimal string to number converter
HI guys...
I want to convert the number to hex string to number converter but when I connect integer, otherwise it does not change the value (as if you write 'EC78' you should get "-5000", but I get the value in the range of 60 thousand ")...
Any ideas?
Thanks in advance...
MADO...
Hi Eric,.
clearly, the OP asked for signed integers!
Use this approach:
,
It will mean by '-' 5000 for your example EC78h...
-
string to double conversion table
Hello
I try to convert the string in the array in DBL, but I can't find the function
Someone can help me. my program is attached
Thank you
Use "fact/Exp string to number. http://zone.NI.com/reference/en-XX/help/371361H-01/Glang/fract_exp_string_to_number/
-
Number del problema evento: BEX application number: devenv.exe
I can't launch the application by all means, I have tried almost everything
This error whenever I try to start the application
Number del problema evento: BEX
The application number: devenv.exe
Application version: 12.0.21005.1
Marca of tiempo of the application: 524fcb34
Number del modulo con errores: StackHash_4150
Version del modulo con errores: 0.0.0.0
Tiempo del modulo Marca con errores: 00000000
Exception offset: d4aa3de8
Exception code: c0000005
Exception data: 00000008
Led operating system version: 6.1.7601.2.1.0.256.48
ID of regional config: 8202
Additional 1:4150 information
Additional information 2: 415033a9f1ae6fcc5aebaf4daaa5684d
3: 86 additional information has 0
Additional information 4: 86a011b887b8da0d2c7df6b38f9d7e04This error seems to be related to Visual Studio. If you explain what you do to cause this error to appear, it is possible that someone here may be able to help, but I suspect that you would be more likely to get help by asking in the appropriate MSDN (developer) or TechNet forums (technical):
https://social.msdn.Microsoft.com/forums/vstudio/en-us/home?Forum=visualstudiogeneral
https://social.technet.Microsoft.com/forums/en-us/home?Forum=whatforum
Maybe you are looking for
-
iPhone 5s does not start after the update of 9.3.3
I upgraded my iPhone to ios 9.3.3 5s. Subsequently, he asked my security code, but would not accept. I stopped the phone and now the phone does not start. No nails?
-
OfficeJet pro 8500: Officejet 8500 scan of the computer
I try to use the scan to computer option. The scanner sends me this turn on my computer and I don't have the software and it can not find anywhere... This site has me fired everwhere and in circles. The assistance Center has only notified me that I
-
How to copy and paste text from the page of the book one photo to another.
Hello, I downloaded this software 2 days ago, and I had so much fun with it. pls I need help on how to copy and paste text from the page of the book one photo to another. Second, how to copy my photo book completed pages project to another laptop com
-
Hello Sorry this is kind of a simple question, but I have two on the code, I write for my senior design project. (1) my first question is how do you run a timed sequence by applying a switch. I want to "Reset Device", so I'll send a voltage of [5-0]
-
HP ENVY m6 problems audio / visuals
HP ENVY m6-1117TX 64-bit Windows 8 My laptop worked perfectly well until the "HP Support Assistant" recommended I have install the updates. After installation a list of updates and restarting the PC I tried to play music via iTunes, but there was no