LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ASCII to decimal conversion function

So what kind of problems are you encountering if you try to wire it as shown? it should work just fine.
 
You can either use "string to byte array" or typecast it to an array of U8. Same difference.
0 Kudos
Message 21 of 48
(4,442 Views)

after conversion i will use that number for comparison of a range like

 

0 to 100 ===> sensor 1 data

101 to 200===> sensor 2 data

201 to 255 ==> sensor 3 data

 

and then it will be sent to a sensor gauge for display.

0 Kudos
Message 22 of 48
(4,439 Views)


ehsanelahimirza wrote:

after conversion i will use that number for comparison of a range like


It seems you are now talking about a completely new problem instead of answering my last question. 😮
 
Can we assume that you solved the original issue? 😉
 
To select depending on the value range, you can wire the number to a case structure and define three cases according to the desired ranges.
0 Kudos
Message 23 of 48
(4,433 Views)
Hi ehsa,

try the attachment. Type any char into ASCII string control...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 24 of 48
(4,431 Views)
i am attaching my VI.
 
you can see it and will syrely understand what i need.
 i want my converted number to connect to the node which is below waveform chart. ( where string to decimal number converter is attached). if i attach converted U8 array to it then there is an error because my comparison is based upon number whereas output of conversion is array
0 Kudos
Message 25 of 48
(4,424 Views)
in my VI i dont require, " Make selection"  loop. if there is some lack in my explanation then plz do tell me. i will be really thankfull for help.
 
thanks
0 Kudos
Message 26 of 48
(4,422 Views)
Hi ehsa,

"you surely understand" - no, we can't! You only ask (new) questions, but don't provide answers to our questions...

As you have been asked before: provide some sample data you're receiving from the serial port! When we see actual samples we can pin down how to convert those "ASCII bytes"!

Is the char that you get from the U8 conversion not ok?


Message Edited by GerdW on 06-12-2008 11:25 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 27 of 48
(4,421 Views)

ok, sorry for that

my actual data is only one byte. it gives 256 values.

here i am providing serial data scheme of my project

i am receiving data from 3 sensors in a controller.

that controller reads temperature sensor data and sends to serial using value of 1 byte (0 to100)

humidity sensor (101 to 200)

pressure sensor (201 to 255)

my all bytes will be (in bits) ( 00000000 to 11111111) == 0 to 255

 

 

0 Kudos
Message 28 of 48
(4,396 Views)
Hi ehsa,

when all you get from serial port is just one byte then take that one single byte you get after the U8 conversion (& index array) operation. It's all you need!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 48
(4,391 Views)
after receiving data in single byte i will check it from which sensor it is and then i will send it to front panel display of that sensor.
there i am also checking limits of this data i.e. if i need temperature to 050 only then after receiving data >50 and <101 will send a constant to serial out.
 
if i am not clear still then plz plz ask me where i am not clear in explanation.
 
thanks very much
0 Kudos
Message 30 of 48
(4,389 Views)