Jump to content

Recommended Posts

Hello

I have a question about the protocol RS232

I have to communicate with an instrument so:

I send a data then i read the buffer then i erase the buffer

my question is:

After sending the data i have to wait how many time for read the buffer

because sometime i have some error.

Best regards

Share this post


Link to post
Share on other sites

Hi Mikael,

RS232 is not protocol - it's a physical layer.

Can you post the telegrams you need ot send and receive?

Which controller you're using?

Share this post


Link to post
Share on other sites

It depends on the other device needs. In V570 you can send out string in the same scan you received confirmation that the expected string is received and recognized.

If the other device don't like such fast reaction, you can put a small timer from the bit Message arived to the Send block.

I gues you're using FB Protocol.

Share this post


Link to post
Share on other sites

In fact i send the data (for example:S1) to the device ont a positive front of a pulse

and on the negative front i read the buffer (value like "12:55" in ascii) then i erase the buffer

And i dont know what is minimum clock to do this

Share this post


Link to post
Share on other sites

I really don't like your way. I'm not surprised you have problems!

The way I'll recommend:

On a positive transition of the bit, which needs to give command to send, SET a MB "Request to send"

With N.O. contact of "Request to send" and N.C. contact of "Funciton in progress" (See FB Protocol - Cofig module!) activate Send block. At the end of this net RESET "Request to send" MB. This way, even if the port is busy in the moment, the controller will wait a little and will send the command. There will not be mess or commands missed.

Then, in Scan module, when the bit "Session complete" becomes active (N.O. contact, there is no need for positive transition)and the number of received message is the one you expect, you will SET another MB " MY Message arrived" and will activate "Reset buffer" Reset buffer block resets immediatelly MB "Message arrived" (the one from Scan module).

You can use now the bit "My message arrived" as condition to send reply - the way described above.

Share this post


Link to post
Share on other sites

I have try the scan module but

i think that i don't know how it can be used exactly

Because it was not OK

But for send data i do like you tell me

I will try again on monday morning (in france it's 8.30 Pm)

Thank's a lot Emil

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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.

Sign in to follow this  

×
×
  • Create New...