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

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

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.