05-28-2010 06:32 PM
05-28-2010 06:47 PM - edited 05-28-2010 06:52 PM
Use Digital to Analog vi and send analog output to a Waveform Graph.
Ooops. I forgot that when sending and receiving serial, the data will get converted to ASCII characters and be received back as ASCII. You can use Type Cast to convert the returning characters back to numbers (which should be a series of 1s and 0s since you sent digital data. Then load the 1s and 0s into the Build Waveform function and then send it into Digital to Analog vi.
05-28-2010 06:57 PM
05-28-2010 07:20 PM
05-29-2010 04:21 AM
How many bit do your AD converter have? And also do you know how a AD converter works? Then you send data on a serial port the data is broken up in single bytes. At the receiver end the data is recombined to its original form. The typecast function is useful for this purpose.
Have you any code you can show us. It would help.
05-29-2010 06:30 AM
i know AD conversion and i convert data to string then send it via serial port
when i receive it on labview by simulation i convert it from string to number and i display it on graph but it didnt give the sine waveform
its a simple question how to regain my signal on its shape
05-29-2010 06:36 AM
Which Labview version do you use? Also how many bit is your AD. I think I may help you. But that require that you post your current code! No code no help. And please you must tell us in more detail, why you struggle
05-30-2010 01:17 AM - edited 05-30-2010 01:19 AM
using labview 8 ,i use 10 bit ADC this code was written in microbasic
program ADC_10
dim temp_res as word
dim output as string[5]
DIM AD_RES AS WORD
USART_INIT(9600)
main:
TRISA = %111111 ' Port A is input
trisb=0
TRISD = %00000000
ADCON1 = %1000010 ' Port A is in analog mode,
' 0 and 5V are reference voltage values,
' and the result is aligned right
' (higher 6 bits of ADRESH are zero).
ADCON0 = %00000001
Delay_ms (1) ' 1 ms pause
eloop:
ADCON0.2 = 1 ' Conversion starts
wait:
' wait for ADC to finish
Delay_us(50)
if ADCON0.2 = 1 then
goto wait
end if
temp_RES=ADC_READ(0)
PORTD=LO(temp_RES) ' Set LOWER 8 bits on port D
Delay_ms(1) ' 1 ms pause
while true
if Usart_Data_Ready = 1 then ' Check if there is data received
' if Usart_Read = "g" then ' is it "g" ?
Usart_Write(13) ' Write CR
Usart_Write(10) ' ... and LF
temp_res = ADC_read(0) ' Read ADC
WordToStrWithZeros(temp_res, output) ' Convert result to string
Usart_Write_Text(output) ' Send string to Usart
Usart_Write(13) ' CR
Usart_Write(10) ' LF
'end if
end if
wend
end.
05-30-2010 02:56 AM
As homer simpsons would have said D'oh!. This is a Labview forum. So posting Basic code is not the correct thing to do LOL. Then I asked you to post code I meant Labview code. So I could get an idea of how much you understand, and whay you do not not understand. I have made some code to simulate your setup. You should be able to solve your problem now.
05-30-2010 09:20 AM
thank you for your reply
but it seem that you dont got me i asked about connecting labview with serial port to read and write and plot the signal that i input it after digitizing and i said also that i did ADC AS HARDWARE NOT SOFTWARE if it wasnot hardware what is the use
thanks