Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can labview do D to A conversion?

Student needing help:
Can Labview do D to A conversion? I am reading a digital signal in serial form of 1 start bit, 8 data bit, and 1 stop bit. I want to convert this signal into analog signal and graph it with respect to time.
I already have the VI to read in the signal. I need help with the D to A conversion. Also, how do you time stamp the signal so you know when data is received.
I'm new to labview, please be detailed and specific. Thanks for all the help.
0 Kudos
Message 1 of 6
(3,484 Views)
You'll need to provide a bit more information. How is the data actually encoded? Does the instrument transmit characters of the actual value (i.e. "+5.123") or as binary, hex? Is it floating point or integers? LabVIEW can convert any of these but I can only give generic suggestions without knowing the actual representation of the data received. There are functions on the string palette such as Scan From String that might work or using the type cast function.

For getting the time, there is Get Date/Time in Seconds on the Time & Dialog palette.
Message 2 of 6
(3,478 Views)
My original signal was an analog signal. It was converted into digital signal and transmit out serially by a PIC microcontroller. The signal was transmitted using a wireless RF transceiver. At the receiver side, an identical RF transciever recieves the signal. Then I use the data acquistion instrument to collect in this signal.

For example an analog input of 3.4 volts was converted into AA and transmitted out starting with a start bit(which is a 0) and then 01010101(inverse of AA since LSB is transmitted first)then a stop bit(which is a 1).

So as of right now, the transmitted data is in binary format in groups of 10(1 start,8 data bits, 1 stop), one right after the other. What I want labview to do is to reverse the process I have done at the beginning and convert this serial data back to its original analog form.

With the stream of data coming in, Labview needs group these data bits in group of 10, starting with the very first bit received. If this group is 0010101011 like mentioned above, then it would convert back to roughly 3.4 volts.

I am not sure if the process I described about is possible with labview. I suspect that I might need additional D/A hardware to accomplish this task? I'm not sure.

Help is greatly appreciated, and please let me know if any more information is needed. Thanks,
0 Kudos
Message 3 of 6
(3,474 Views)
The start and stop bits are part of the normal serial framing so you will need to do a VISA Read and this will retrieve the data. You will then need to convert the characters returned into hex. You can use the type cast to do this. Wire the input to the VISA Read output and wire a U8 constant to the type input. You then need to do the bit reversal. There was a posting here that talks about that and has some example code. The lst thing is to convert that AA back to the voltage. I don't know how 3.4 volts was converted to AA but if you can provide that information, the conversion to a floating point number would be the last step.
Message 4 of 6
(3,457 Views)
Are you saying that when VISA Read reads in the bits, it automatically recognizes the serial frame and eliminates the start and stop bit? Or do I have to go through the trouble of eliminate those start/stop bits myself?
When converting the analog voltage into digital signal, the PIC mictrocontroller was set up to do A/D, and it converts in a linear manner such that
0.2V converts to 0A hex which is equivalent to 10(decimal)
0.4V converts to 14 hex 20(decimal)
0.6V converts to 1E hex 30(decimal)
3.4V converts to AA hex 170(decimal)

How do I convert it back in labview?
I'm working on this as a team project, however, the person who's supposed to help with data acquisition isn't helping. So I end up having to learn labview to do this.
You have been a great help. Thanks for everything.
0 Kudos
Message 5 of 6
(3,440 Views)
VISA will automatically strip out the start and stop bits. When you get the decimal or hex number, you multiply that by .02. That is the voltage equivalent of a single bit.
Message 6 of 6
(3,436 Views)