Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming to ASCII senteces

I am receiving an analog signal from a sensor (0 to 10 volts) and I need to convert this signal to a stream of ASCII senteces containing one of the fallowing discrete readings {1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ... 20}; when the sensor reading vary between 0 and 10 volts.
 
The reason I need the data in ascii sentences is because I need to pick up each discreet value with my code. 
 
Can the Data Logger give me asscii sentences with the discreate values? Or, what other options I have?

0 Kudos
Message 1 of 4
(5,559 Views)

I'm a little confused on what you want to accomplish?  Do you wish to get the value rounded to the nearest 0.5 and then convert that number to a string?  If that's the case, you can create a function that will round to the nearest 0.5 and then use a convert to string function.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(5,546 Views)

Thanks for your response.

 

I am sorry, you are right, 0 to 20 is the digital output range.

 

I need to convert 0 to 10 Volts (analogue) to 0 to 20 (digital). The sample frequency can be 1 second. I need to pack this data into ASCII data packets as a contnious byte stream over a serial port.

The data packets will contain a discrete number between 0 and 20 with a time stamp.

 

After this I can capture the data with my code (client application running on the computer) by parsing the ASCII sentence, if I know the sentence protocol or structure.

 

Summary: I need an analog to digital to ascii converter

0 Kudos
Message 3 of 4
(5,541 Views)

This sounds like you need to create a function in your code that takes the number, converts it to the 0 - 20 number you desire, then converts it to a string, and then tacks on a time stamp.  The output could then be sent out to the other system.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(5,538 Views)