Mickael Posted December 17, 2010 Report Share Posted December 17, 2010 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 More sharing options...
Emil Posted December 17, 2010 Report Share Posted December 17, 2010 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? Link to comment Share on other sites More sharing options...
Mickael Posted December 17, 2010 Author Report Share Posted December 17, 2010 Thank's for your quick answer I'm using V570 my question is if we have to wait between send and receive or if ther an other way Link to comment Share on other sites More sharing options...
Emil Posted December 17, 2010 Report Share Posted December 17, 2010 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 More sharing options...
Mickael Posted December 17, 2010 Author Report Share Posted December 17, 2010 Yes i use FB protocol because there is other way ? Link to comment Share on other sites More sharing options...
Emil Posted December 17, 2010 Report Share Posted December 17, 2010 Practically not. Link to comment Share on other sites More sharing options...
Mickael Posted December 17, 2010 Author Report Share Posted December 17, 2010 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 Link to comment Share on other sites More sharing options...
Emil Posted December 17, 2010 Report Share Posted December 17, 2010 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 More sharing options...
Mickael Posted December 17, 2010 Author Report Share Posted December 17, 2010 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 Link to comment Share on other sites More sharing options...
Emil Posted December 17, 2010 Report Share Posted December 17, 2010 In Israel now is Weekend, 9:40 PM. Bon Nuit! Link to comment Share on other sites More sharing options...
Mickael Posted December 17, 2010 Author Report Share Posted December 17, 2010 ليلة جيدة google translate Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now