Jump to content

R/W through Serialport with NullModem


arteta

Recommended Posts

: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

post-4445-1145112804.jpg?width=400

Link to comment
: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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.