Instrument Control (GPIB, Serial, VISA, IVI)

取消
显示结果 
搜索替代 
您的意思是: 

ADC communiction with UART to Labview

已解决!
转到解答

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 项奖励
1 条消息(共 47 条)
7,480 次查看
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 项奖励
2 条消息(共 47 条)
7,437 次查看

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 项奖励
3 条消息(共 47 条)
7,428 次查看
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 项奖励
4 条消息(共 47 条)
7,417 次查看

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

0 项奖励
5 条消息(共 47 条)
7,410 次查看
That makes no sense. The string returned is the output of the VISA Read.
0 项奖励
6 条消息(共 47 条)
7,401 次查看

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 项奖励
7 条消息(共 47 条)
7,377 次查看
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 项奖励
8 条消息(共 47 条)
7,366 次查看

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 项奖励
9 条消息(共 47 条)
7,340 次查看

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 项奖励
10 条消息(共 47 条)
7,336 次查看