ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

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

problem --serial port reading one character at a time

Hi Friend,

I reading the serial port  one character at a time ,  i specified it in the "serial bytes to read" option in serial port read examples.
The problem is ----------i can able to read  the data.
but only the first character is reading again and again...and "reading string indicator" in the serial port example shows only the first character sent ..only for a single time.since i am reading continously ----aleast the first character should display as many times i running the program
(i am running the vi by run continous option..........)..

please help me ....how to read the character one by one.....

regards
rajasekar





0 项奖励
1 条消息(共 5 条)
3,756 次查看
Do not use run continuous option. That is not the correct way to keep executing a portion of code. Put a while loop around just the read. That way, the serial port is not initialized with each run.
0 项奖励
2 条消息(共 5 条)
3,751 次查看
Hey rajasekar,

Dennis is exactly right.  You will need to put the read vi in a while loop.  A great example that implements this in LabVIEW can be found in the Example Finder.  The example is called Basic Serial Write and Read.vi

I hope this helps!

Best regards,

Jason W
Applications Engineer
National Instruments
0 项奖励
3 条消息(共 5 条)
3,735 次查看
Hi jason...

I can able to read the serial port by 1 byte or 2 byte or 4 byte as i can specify it in the serial port read bytes option..(in visa serial read)..
I need to acquire 4 bytes of data and pass it to the Math-script node..and save these 4bytes of data in array (1 row and 4 column)..
And split this array(just like array-indexing.vi) and processing it each each column separately....
or suggest some method to achieve my task.....please.

one more thing the math-script node is placed in a while loop.....in order to read sequence of bytes continously.......


regards
rajasekar



0 项奖励
4 条消息(共 5 条)
3,723 次查看

What exactly are you having difficulty with? Is it the building array, indexing it, or the math script? When you say 'just like array-indexing.vi', the array indexing function is able to get an entire column so you don't need something like it. You just use it.

If you can post the code you've written (7.1 format please) or an image of the block diagram, it would help to understand what you need to do.

0 项奖励
5 条消息(共 5 条)
3,714 次查看