From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with ASCII Conversion?

Solved!
Go to solution

Hello everyone;

 

I am working with AVL DIGAS4000 to measure the emissions of an engine, I want to see the values on labview screen.

 

I was able the get ascii characters(I am not sure) but I am not very experienced with them, so can't quite convert them and get the numeric results for each string?

 

tried some solutions of other topics like this : http://forums.ni.com/t5/forums/v3_1/forumtopicpage/board-id/170/thread-id/1015559/page/2

 

but mine characters look very different, I need some other way to converse them. Tried trim whitespace and Fract/Exp String To Number Function, it did'nt even showed anything.

 

There is VI and screenshot but also ascii characters were:

 

410F     34000.00 3430000  348   H34100.0  34420.9  3520000  902-----9000505179011549  3D

 

There is no clean manuel about this but, the pattern is like;

 

410 Code for Mode of operation F=Gasoline

340 Code for CO , 0.00 is value

348 Code for if it is either "H" Hexane, "P" Propane

341 Code for  CO2 etc.  The last line with 9's for date and time..

Download All
0 Kudos
Message 1 of 5
(2,978 Views)

Can't edit for some reason.. Yeah the problem is not converting, I needed to parse the string. Which I did but there is a problem which I can't get the bot NOx and O2 values together, I can only get one, if I get NoX I wouldn't get O2 etc.

0 Kudos
Message 2 of 5
(2,926 Views)

look at your strings in a different representation (right mouse on the control/indicator and then "\ Codes Display") so you can see the control chars as well. (or even in hex)

 

find something reliable where you can split your string on (e.g. whitespaces)

then you have split your problem and you can go from there

 

EDIT: and close your VISA session at the end


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 3 of 5
(2,918 Views)
Solution
Accepted by topic author MsCEn

to get you started

split.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 4 of 5
(2,913 Views)

Well thanks everyone! Actually this topic was just what I needed : http://www.ni.com/documentation/en/labview-comms/1.0/g-prog/scan-string/

 

I figured out this and executed as shown in the ss, everything is ok.(except some indicators are unstable like o2 NOx, they change when I add a new indicator but that is just fine)

 

note: should still close the visa 🙂

0 Kudos
Message 5 of 5
(2,887 Views)