Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ADC communiction with UART to Labview

Solved!
Go to solution

Hello i am tryin to send a AC voltage of about .2 volts from the ADC on my MCP3903 board with dspic33f microchip. I am able to communicate with labview through UART but not able to get the sine wave i am hoping for. Im not sure how the data is being plotting like if just garabage or what. I have attached my code and image of the what being plotted on the graph. IF somone can help me that would be great.

0 Kudos
Message 1 of 47
(7,384 Views)
Please don't use your phone to send a picture.

You have not included the actual string you are receiving so it is impossible to say if you are parsing it correctly. We also have no idea of your code on the micro to know how it is being sent.
0 Kudos
Message 2 of 47
(7,341 Views)

what do mean like concatentate to single string, and what do you need to know about the code as far of how the data is sent

0 Kudos
Message 3 of 47
(7,332 Views)
If you don't know the actual string you are receiving, how do you know how to parse it? You are receiving a single string now, you just don't have an indicator for it.
0 Kudos
Message 4 of 47
(7,321 Views)

If you mean the return count on the visa read its a 1000

0 Kudos
Message 5 of 47
(7,314 Views)
That makes no sense. The string returned is the output of the VISA Read.
0 Kudos
Message 6 of 47
(7,305 Views)

Okay here is what the string is ouputing ASCII values and then does the unsigned int conversion. The data on the graph though is just random plots. I want to know how to get the appropraited sine wave function for my AC signal.also it a 24 bit number coming out of my ADC and uart can only send 8 bit. I also attached a picture of  the data in a virtual terminal.

0 Kudos
Message 7 of 47
(7,281 Views)
Finally some useful information. I think your scheme is fatally flawed. You are not joining the 3 bytes at all and even if you did, you have no idea of the order since the communication is completely asynchronous. You display random noise because that is what you are sending. You need to change the micro code.
0 Kudos
Message 8 of 47
(7,270 Views)

it not random cause when i send it to a dataviewer program that designed to view the ADC it actually produces my AC signal. and forms a sine wave.

0 Kudos
Message 9 of 47
(7,244 Views)

Hi muscle05,

 

I think a step in the right direction to handle that error I see in your screenshot is to take a look at Producer/Consumer architecture:

https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...

 

Regards,

G-IV

0 Kudos
Message 10 of 47
(7,240 Views)