arteta Posted April 15, 2006 Report Share Posted April 15, 2006 :headbang: I have some problem down here, thanx in advance for help - I 've write a example like below to read back the value sent to Com port , but the program does not run as i thought. I have to click the RUN button several time to get something in the indicator and it's wrong most of the time. Can anyone help me figure out the reason? - I am trying to communicate my 8952 uController with Labview. write something to uC is working but reading is not. I have my uC sending continuously a character and then reading it in Labview with the VI downloaded in NI webpage (the Serial.vi). The problem is it always read the wrong value. I think that it is the problem of not recognize the right "frame". So how can i solve it ? - Another thing, i want to use VISA READ to read continuosly from Com port then display the value to an indicator . So what kind of structure should i use ? Thanks again. Excuse my bad English Quote Link to comment
Rolf Kalbermatter Posted April 16, 2006 Report Share Posted April 16, 2006 :headbang: I have some problem down here, thanx in advance for help- I 've write a example like below to read back the value sent to Com port , but the program does not run as i thought. I have to click the RUN button several time to get something in the indicator and it's wrong most of the time. Can anyone help me figure out the reason? - I am trying to communicate my 8952 uController with Labview. write something to uC is working but reading is not. I have my uC sending continuously a character and then reading it in Labview with the VI downloaded in NI webpage (the Serial.vi). The problem is it always read the wrong value. I think that it is the problem of not recognize the right "frame". So how can i solve it ? - Another thing, i want to use VISA READ to read continuosly from Com port then display the value to an indicator . So what kind of structure should i use ? Thanks again. Excuse my bad English LabVIEW is highly parallel in execution. Unless you do not provide data dependency the execution order of code is totally random. In your case this means that the Read function can execute before the Write function is executed. In that case you never will be able to read the value you just wrote! Another problem is probably the amount of data you read with the count character! You typecast an int32 which will result in 4 characters being written and then you should read 4 characters too. Last but not least the serial port settings will terminate by default on carriage return on read. Since you are writing binary data the decimal 13 character can happen anywhere in the data stream and the default setting will sometimes terminate on that character on Read instead of returning all 4 characters. Rolf Kalbermatter Quote Link to comment
arteta Posted April 17, 2006 Author Report Share Posted April 17, 2006 Thank you, i think the problem is about the parrallel thing u said. In the basic_read_and_write.vi example, they perform the write first and then the read and it work smoothly . and, thank u for the other thing like carriage return, i am confusing about it. :thumbup: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.